{"id":11396,"date":"2026-05-30T18:30:21","date_gmt":"2026-05-30T10:30:21","guid":{"rendered":"https:\/\/aeosub.com\/zero-blocks-given\/"},"modified":"2026-05-30T18:30:21","modified_gmt":"2026-05-30T10:30:21","slug":"zero-blocks-given","status":"publish","type":"post","link":"https:\/\/aeosub.com\/zh\/zero-blocks-given\/","title":{"rendered":"Zero Blocks Given"},"content":{"rendered":"<div class=\"post-img\" style=\"margin-bottom: 25px\"><img decoding=\"async\" src=\"https:\/\/ps.w.org\/zero-blocks-given\/assets\/banner-1544x500.png?rev=3554597\" alt=\"Zero Blocks Given\" style=\"width: 100%;height: auto;border-radius: 12px\"><\/div>\n<div class=\"plugin-info-card\" style=\"border: 1px solid #e2e8f0;border-radius: 10px;overflow: hidden;margin-bottom: 30px;font-family: -apple-system, system-ui, sans-serif;background: #fff\">\n<table style=\"width: 100%;border-collapse: collapse;font-size: 14px\">\n<tr style=\"border-bottom: 1px solid #edf2f7\">\n<th style=\"padding: 15px 20px;text-align: left;width: 35%;color: #4a5568;background: #fcfcfc\"><img decoding=\"async\" src=\"https:\/\/ps.w.org\/zero-blocks-given\/assets\/icon-256x256.png?rev=3554597\" style=\"width: 40px;height: 40px;border-radius: 6px;margin-right: 12px;vertical-align: middle\"> Developer<\/th>\n<td style=\"padding: 15px 20px;font-weight: 500\"><a href=\"https:\/\/profiles.wordpress.org\/myththrazz\/\" target=\"_blank\" rel=\"noopener\">MythThrazz<\/a><\/td>\n<\/tr>\n<tr style=\"border-bottom: 1px solid #edf2f7\">\n<th style=\"padding: 12px 20px;text-align: left;color: #4a5568;background: #fcfcfc\">Version<\/th>\n<td style=\"padding: 12px 20px\">v1.2.2<\/td>\n<\/tr>\n<tr style=\"border-bottom: 1px solid #edf2f7\">\n<th style=\"padding: 12px 20px;text-align: left;color: #4a5568;background: #fcfcfc\">Active Installs<\/th>\n<td style=\"padding: 12px 20px\">0 +<\/td>\n<\/tr>\n<tr style=\"border-bottom: 1px solid #edf2f7\">\n<th style=\"padding: 12px 20px;text-align: left;color: #4a5568;background: #fcfcfc\">Requires \/ Tested<\/th>\n<td style=\"padding: 12px 20px\">6.0 \/ 7.0<\/td>\n<\/tr>\n<tr style=\"border-bottom: 1px solid #edf2f7\">\n<th style=\"padding: 12px 20px;text-align: left;color: #4a5568;background: #fcfcfc\">Last Updated<\/th>\n<td style=\"padding: 12px 20px\">2026-05-30 10:26am GMT<\/td>\n<\/tr>\n<tr>\n<th style=\"padding: 12px 20px;text-align: left;color: #4a5568;background: #fcfcfc\">Official Link<\/th>\n<td style=\"padding: 12px 20px\"><a href=\"https:\/\/wordpress.org\/plugins\/zero-blocks-given\/\" target=\"_blank\" style=\"text-decoration: none;color: #4a3bca;font-weight: bold\" rel=\"noopener\">View Details \u2192<\/a><\/td>\n<\/tr>\n<\/table><\/div>\n<div class=\"plugin-short-desc\" style=\"margin: 20px 0;padding: 12px 15px;background: #f9fafb;border-left: 4px solid #4a3bca;border-radius: 6px;font-style: italic;color: #4a5568\">Turn off WooCommerce \/ WP block frontend output at the code level. Four tiers, optional one-click settings, no paywall.<\/div>\n<p>Most WooCommerce stores ship 80-150 KB of block CSS and JS that the store never actually renders. The WC <code>BlockPatterns<\/code> scanner is the one that bugs me most &#8211; it hits the filesystem on every request to scan a directory of pattern templates you don&#8217;t use. Then add core WP <code>global-styles<\/code>, <code>wp-block-library<\/code> and font-faces on top, and you&#8217;re loading a Gutenberg frontend you probably switched off a long time ago.<\/p>\n<p>Zero Blocks Given turns it off at the source, through WooCommerce&#8217;s own dependency injection container. No CSS dequeue band-aid, no UI checkboxes, no PRO upsell. One constant in <code>wp-config.php<\/code>, pick a tier, done.<\/p>\n<h3>How it works<\/h3>\n<p>Here&#8217;s the thing &#8211; WC registers its block hooks as closures wrapping instance methods on container-managed objects. So you can&#8217;t <code>remove_action()<\/code> them by string. You have to fetch the same instance back from the DI container and pass it in as the callable. That&#8217;s what this does:<\/p>\n<pre><code>$bp = AutomatticWooCommerceBlocksPackage::container()-&gt;get( BlockPatterns::class );\nremove_action( 'init', [ $bp, 'register_block_patterns' ] );\n<\/code><\/pre>\n<p>The DI-container path is the one that survives WC upgrades cleanly. String-callback matching and dequeue tricks tend to drift every release, so I went with the container.<\/p>\n<h3>Four modes. Three ways to set them.<\/h3>\n<p>  Mode<br \/>\n  What it turns off<br \/>\n  When to use it<\/p>\n<p>  <code>patterns<\/code><br \/>\n  WC <code>BlockPatterns<\/code> directory scanner only<br \/>\n  Block-based Cart\/Checkout &#8211; keeps all blocks rendering, just skips the file-I\/O scan<\/p>\n<p>  <code>blocks<\/code><br \/>\n  <code>patterns<\/code> + <code>BlockTypesController<\/code> + <code>Notices<\/code> styles + <code>wc-blocks-style<\/code> handle<br \/>\n  Classic-shortcode WC stores<\/p>\n<p>  <code>all<\/code><br \/>\n  <code>blocks<\/code> + WP <code>global-styles<\/code> pipeline + <code>theme.json<\/code> + font-faces + head <code>&lt;style&gt;<\/code> strip<br \/>\n  Sites with no Gutenberg frontend at all<\/p>\n<p>  <code>nuclear<\/code><br \/>\n  <code>all<\/code> + <code>unregister_block_type()<\/code> for every core block<br \/>\n  Page-builder sites &#8211; strips the editor inserter clean<\/p>\n<p>Default is <code>all<\/code>. Set the mode you want with any of these:<\/p>\n<ol>\n<li>The <code>&lt;dialog&gt;<\/code> settings &#8211; click the Settings link on the Plugins screen. Native HTML dialog, four radios, save. No menu items, nothing else added to your admin.<\/li>\n<li>A constant in <code>wp-config.php<\/code> &#8211; <code>define( 'ZEROBLG_MODE', 'patterns' );<\/code>. This wins over the dialog. Good devops escape hatch.<\/li>\n<li>A filter in a theme or mu-plugin &#8211; <code>add_filter( 'zeroblg\/mode', fn() =&gt; 'blocks' );<\/code>. Used when neither the constant nor the dialog set a value.<\/li>\n<\/ol>\n<p>Resolution order: constant, then settings, then filter, then <code>all<\/code>. An invalid value at any step just falls through to the next.<\/p>\n<h3>A few real cases<\/h3>\n<ul>\n<li>Service-form site on WC. You sell consultations, not products &#8211; no cart, no checkout. <code>mode=all<\/code> strips every block stylesheet across the site.<\/li>\n<li>Classic-shortcode WC store. You use <code>[woocommerce_cart]<\/code> and <code>[woocommerce_checkout]<\/code>, no block UI. <code>mode=blocks<\/code> turns off the block frontend without touching your classic flow.<\/li>\n<li>Block-checkout store with bloated patterns. You run the new Cart\/Checkout blocks but never the WC pattern library. <code>mode=patterns<\/code> skips just the directory scanner &#8211; saves the disk hit, leaves your checkout alone.<\/li>\n<li>FrankenPHP \/ worker mode. All hooks are idempotent, no <code>$GLOBALS<\/code> writes, <code>Throwable<\/code> catches around the DI lookups. Safe in a worker.<\/li>\n<li>Elementor \/ Divi WC stores. The page builder renders its own checkout, so <code>mode=all<\/code> clears the WC and WP block CSS your theme never uses anyway.<\/li>\n<\/ul>\n<h3>Why I built it this way<\/h3>\n<ul>\n<li>Activate it and it works &#8211; <code>mode=all<\/code> is the default, no setup needed.<\/li>\n<li>No settings page to learn. One constant or one filter is the whole API.<\/li>\n<li>Pure PHP. No database rows, no admin scripts, no frontend JS.<\/li>\n<li>No external requests, no tracking, nothing phoning home. GDPR is a non-issue.<\/li>\n<li>It uses the same <code>Package::container()<\/code> lookup as WC core, so it follows WC&#8217;s own object lifecycle instead of guessing.<\/li>\n<li>Worker-safe &#8211; FrankenPHP, Roadrunner, Swoole. No <code>die<\/code>, no <code>exit<\/code>, no session writes.<\/li>\n<li>mu-plugin friendly. Drop the folder into <code>wp-content\/mu-plugins\/<\/code> and it loads itself.<\/li>\n<li>GPL, no upsells. No PRO tier, no Freemius, no admin notice nagging you for a review.<\/li>\n<\/ul>\n<h3>From the maker of WP Multitool<\/h3>\n<p>This plugin handles the frontend block bloat. If you also want the backend cleaned up, that&#8217;s what <a href=\"https:\/\/wpmultitool.com\/\" rel=\"nofollow ugc noopener\" target=\"_blank\">WP Multitool<\/a> does &#8211; slow queries, autoload bloat, the database bottlenecks that caching plugins just hide instead of fixing. Most optimization plugins guess at the problem. WP Multitool runs <code>EXPLAIN<\/code> and shows you. 14 tools in there &#8211; slow-query analyzer, autoload optimizer, index suggestions, fatal-error recovery &#8211; and a free site scanner if you want to see what&#8217;s slow before paying for anything. If Zero Blocks Given earned a spot in your stack, that one probably will too.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Turn off WooCommerce \/ WP block frontend output at the code level. Four tiers, optional one-click settings, no paywall.<\/p>","protected":false},"author":1,"featured_media":9317,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[252],"tags":[2622,641,596,722,569,555],"class_list":["post-11396","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-trends","tag-disable-blocks","tag-gutenberg","tag-optimization","tag-performance","tag-woocommerce","tag-wordpress-plugin"],"_links":{"self":[{"href":"https:\/\/aeosub.com\/zh\/wp-json\/wp\/v2\/posts\/11396","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/aeosub.com\/zh\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/aeosub.com\/zh\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/aeosub.com\/zh\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/aeosub.com\/zh\/wp-json\/wp\/v2\/comments?post=11396"}],"version-history":[{"count":0,"href":"https:\/\/aeosub.com\/zh\/wp-json\/wp\/v2\/posts\/11396\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/aeosub.com\/zh\/wp-json\/wp\/v2\/media\/9317"}],"wp:attachment":[{"href":"https:\/\/aeosub.com\/zh\/wp-json\/wp\/v2\/media?parent=11396"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/aeosub.com\/zh\/wp-json\/wp\/v2\/categories?post=11396"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/aeosub.com\/zh\/wp-json\/wp\/v2\/tags?post=11396"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}