| 开发者 |
fernandot
ayudawp |
|---|---|
| 更新时间 | 2026年8月4日 14:33 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.0 |
| 版权: | GPLv2+ |
| 版权网址: | 版权信息 |
define( 'NO_GUTENBERG_OPTIONS', array( 'complete' => true ) ); define( 'NO_GUTENBERG_HIDE_SETTINGS', true );
Drop that second line and the settings page is still there, showing the configuration the site is really running, but read only. And if all you want is to lock the screen, leaving the configuration as each site has it stored:
define( 'NO_GUTENBERG_LOCK_SETTINGS', true );
NO_GUTENBERG_OPTIONS takes any of the settings on the screen, so a selective setup is written the same way:
define( 'NO_GUTENBERG_OPTIONS', array( 'complete' => false, 'disable_post_types' => array( 'post', 'page' ), 'disable_roles' => array( 'editor', 'author' ), 'frontend_css' => false, ) );
The keys are the settings on the screen. complete, widgets, patterns, frontend_css, theme_json, site_editor and fse_notices take true or false, while disable_post_types, disable_roles, disable_templates and switch_post_types take an array of slugs, and disable_ids an array of entry IDs. Any key you leave out keeps the value stored on the site. Note that defining NO_GUTENBERG_OPTIONS already turns the whole screen read only, so NO_GUTENBERG_LOCK_SETTINGS is not needed on top of it.
This plugin is perfect for:
No. The plugin disables everything as soon as you activate it, exactly as it always did. The settings page under Settings > No Gutenberg is there only if you want to bring some part of the block editor back.
Yes. Go to Settings > No Gutenberg, uncheck "Disable Gutenberg completely", and then choose where the block editor should go away: post types, user roles, page templates or individual entry IDs. Rules are independent, so anything that matches gets the Classic Editor and everything else keeps working as usual.
Yes. Once the master switch is off, the site wide pieces are independent checkboxes, so you can, for example, restore the classic Widgets screen and remove the block patterns while leaving the editor itself alone.
That is exactly why the plugin unchecks the frontend block assets and theme.json options for you when you switch to a partial setup: the content that still uses blocks would lose its styles on the frontend. The status panel tells you how many of your published entries are built with blocks, so you can decide with real numbers.
Yes, from wp-config.php. define( 'NO_GUTENBERG_LOCK_SETTINGS', true ); leaves Settings > No Gutenberg visible but read only, and define( 'NO_GUTENBERG_HIDE_SETTINGS', true ); takes it out of the menu. To fix the configuration itself, and not only lock the screen, there is NO_GUTENBERG_OPTIONS. The description has the three of them together, with the settings you can fix and the details worth knowing.
Yes, and it is what the plugin is best at. Activate it site by site, or Network Activate it and it runs on every site of the network. Settings are stored per site, so each site has its own Settings > No Gutenberg and each site administrator manages their own. For the whole network at once, the place is wp-config.php, the same file every site reads: what you define there reaches all of them, covers every setting the plugin has and wins over whatever each site has stored. There is no network settings screen, because that file does the job for the entire network in a couple of lines. They are in the description, under "One configuration for a whole network, or for a site you deliver".
Yes. In the post types table there is a second column, "Let each entry switch": check it for the post types where it makes sense. Those entries then get "Edit (Classic)" and "Edit (Blocks)" links in the list and a switch inside both editors, and each one remembers the editor you chose for it.
Yes. Products behave like any other post type: with the master switch on, or with Products checked in the rules, the classic product editor is forced and the WooCommerce block assets are removed from the frontend. If you leave blocks on for products, the block based product editor keeps working, without a separate setting contradicting it.
No, and the plugin goes out of its way to keep it that way. It never rewrites a single entry, and an entry that is already built with blocks keeps the block editor whatever the rules say, so nothing you set here can send it to an editor that would reflow its markup. The entries list labels those entries and can be narrowed down to them, so you can see exactly what you have. There is one visible change on the frontend: with the frontend block assets removed, content built with blocks loses the block styles. The status panel tells you how many entries are affected before you decide.
Yes. Uncheck the content protection under the master switch, on the settings page. From that point the rules apply to every entry, and the plugin warns you inside the Classic Editor whenever you open one that is built with blocks, because saving it there can break its blocks.
All Gutenberg functionality will be restored immediately. Your site will return to using the block editor and all block-related features.
Yes. This plugin is designed for maximum compatibility. It works with all properly coded themes and plugins by simply removing block functionality rather than conflicting with it.
You can, but block themes are built around the very features this plugin removes, so their Site Editor and template editing will not work while it is active. The plugin warns you when it detects a block theme. If you need that theme, switch off the Site Editor and theme.json modules on the settings page, or use a classic theme instead.
Because it does not stop at the editor. Others disable the block editor and leave the rest running: this one also removes the FSE Global Styles, the block widgets, the patterns, the WooCommerce blocks and the block CSS and JavaScript that every page of your site is loading. It also tells you what it is doing, with a status panel measured on your own site instead of a list of promises. And on a multisite network it is configured for every site at once from a single file, all of it, not only which editor opens.