Restrict or disable blocks in the word press block editor (Gutenberg).

The new WordPress Block Editor for WordPress 5.0 named Gutenberg contains a large number of new blocks (hence, names!). In addition to 34 or more basic blocks, third-party plug-ins can add their own blocks for design. This means that when you create content using the new Gutenberg Block Editor, you may see hundreds of blocks. Please talk about chaos! To better handle these blocks, we’ll show you how to disable Gutenberg blocks in the new editor. You can disable blocking for all users. Alternatively, you can disable Gutenberg masking for specific user roles, user accounts, specific post types, and so on. The
Here are some potential use cases for this post strategy: Simplify the block editor interface by deleting blocks that you do not need to use. Basically not too complicated. Restrict the types of content that other users can create. For example, if your site has third-party authors, you can prohibit including blocking payments. Or, when building a client site, you may not be allowed to use all blocks. Limit the types of content that may be included in a particular post type. For example, for a specific post type, you might only need a specific set of default blocks. Ready to dive? Disable gutenberk masking or restrict access to masking based on user roles or user accounts: Let’s start with two simple plug-ins that can perform this task. Then, we will learn more about how to use our own code to execute. The
Note: to completely disable the new editor and continue using the previous TinyMCE editor, please see the full post on how to disable the new WordPress Gutenberg Block Editor. Although several other plug-ins claim that disabling WordPress Gutenberg Block Editor blocks with plug-ins helps disable Gutenberg blocks, I like the joomunited free advanced Gutenberg plug-in and the lighter option disable Gutenberg blocks plug-in discussed here a few months ago. I’ll tell you how to use both methods. The
Advanced Gutenberg plug-in guideadvanced Gutenberg allows you to create various configuration files and define available blocks. To globally disable masking, you can assign profiles to all users. Alternatively, you can create separate profiles for individual users or user roles and change the available blocks based on who uses the editor. Advanced Gutenberg has also added its own set of blocks, but can be disabled as needed. The article will continue with the following step 1: create a new configuration file WordPress. After installing and activating the plug-in, go to the new adv. On the WordPress dashboard, click the Gutenberg tab, and then click new profile. The
Male then specify the profile name and click save. Step 2: select the user profile to apply, and then go to the profile properties area. In this area, you can select the users who use this profile. You can select one of the following options: User account user role or both: To disable Gutenberg screening for all individual users on the website, just select all user roles and apply the profile globally. Step 3: to select a screen to disable, go to the screen list to select a screen that can be used by users with profiles. By default, all blocks are active. But with a simple toggle button,
How many blocks can be disabled? The
The article will continue below. In addition to selecting the default block and its own block, advanced Gutenberg also displays the blocks of other third-party plug-ins. All blocks are divided into the same parts as seen in the block inserter when using the editor. For example, the method to disable some blocks in the third-party stackable plug-in is as follows: And that’s all! After saving the changes, the user to whom the profile is applied can only see the active block. Gutenberg shielding plug-in guidedisabling disable Gutenberg blocks is another Gutenberg plug-in that helps disable shielding. Unlike advanced Gutenberg, it only focuses on disabling blocks, so it will be lighter in any case. The
However, blocks can only be disabled globally. That is, in advanced Gutenberg, there is no way to specify a specific user or user role as a target. WordPress After installing and activating the plug-in, please go to settings → disable shielding and start using. To disable a block, hover over the block and click disable. You can also use the batch drop-down box to batch disable multiple blocks. Male driver will continue below, maleafter disabling some blocks, gray display is helpful for identification. The
And that’s all! If you do not want to disable the WordPress Gutenberg Block Editor block as your own code using the plug-in, you can also use the allow\u block\u types filter to manually use your own code. For this approach, you can add code to the functionality of the subtopic. You can use PHP or use plug-ins such as code snippets to manage your code. Or, if you prefer styles, you can create custom plug-ins! The
Use this method to select the block to activate. So instead of using blocks, you can’t use all other blocks, including those you don’t want to use. The following is the default code snippet to use: Function my_allowed_block_types ($allowed_block_types, $post) {return array (‘core\/paragraph’);} Add\u filter (‘allowed\u block\u types’,’my\u allowed\u block\u types’); The
In this example, only paragraph blocks can be used, and all other blocks are disabled. To activate more blocks, simply add a block trace to the array as follows: Function my_allowed_block_types ($allowed_block_types, $post) {return array (‘core\/paragraph’,’core\/image’,’core\/heading’,’ugb\/button’);} Add\u filter (‘allowed\u block\u types’,’my\u allowed\u block\u types’); The
Gutenberg code editor can be used to find block trackers that must be included in an array. For example, the block stack of button block in stackable is ugb\/button. If necessary, you can further modify the default code segment and use the if rule to locate a specific post type. If you do not like sorting all available Gutenberg blocks, or if you want to restrict the blocks that specific users can access, you must use one of these methods. Advanced Gu
Tengberg is easiest to use if you want to restrict access to Gutenberg blocks based on user roles or user accounts. However, if you want to disable specific blocks globally, all three solutions can use disable Gutenberg blocks or unique custom code that provides the lightest solution, which is very simple. Are there any other questions about how to disable Gutenberg blocks in the new word press block editor? Please leave me a message and I will help you!

Author:

Leave a Reply

Your email address will not be published. Required fields are marked *