![图片[1]-如何有效管理和删除 WordPress 块以提升用户体验-光子波动网 | WordPress教程、Elementor教程与故障修复](https://www.361sale.com/wp-content/uploads/2024/07/2024070602540670.png)
During the WordPress website management process, you may encounter situations where you need to delete, hide or manage blocks. In this article, we will detail how to effectively manage and delete blocks in WordPress in different scenarios to enhance the user experience and editing efficiency of your website.
Why should I remove, hide or delete blocks in WordPress?
- Simplified Interface: Some blocks may not be relevant to your site's content, and removing them creates a cleaner, more focused editorial interface. For example, the poetry block may not be useful for a food or fashion blog.
![图片[2]-如何有效管理和删除 WordPress 块以提升用户体验-光子波动网 | WordPress教程、Elementor教程与故障修复](https://www.361sale.com/wp-content/uploads/2024/07/2024070602543444.png)
- Improve editing efficiency: The editing process can be simplified and less intrusive by hiding or deleting blocks that are not commonly used.
- content management: Removing specific chunks in content helps keep a post or page neat and readable.
![图片[3]-如何有效管理和删除 WordPress 块以提升用户体验-光子波动网 | WordPress教程、Elementor教程与故障修复](https://www.361sale.com/wp-content/uploads/2024/07/2024070602545280.png)
Ways to Delete and Manage WordPress Blocks
Method 1: Delete the block in the WordPress editor
If you only want to delete a block in the content, you can use the following steps:
- Select the block to be deleted.
- Click the three dot icon in the block toolbar to open the menu.
- Select the "Delete" option.
![图片[4]-如何有效管理和删除 WordPress 块以提升用户体验-光子波动网 | WordPress教程、Elementor教程与故障修复](https://www.361sale.com/wp-content/uploads/2024/07/2024070602551743.png)
This method will not remove the block from the block menu, but will remove it from the current blog post or page.
(computer) shortcut: Windows and Linux users can press Shift + Alt + ZFor example, macOS users can press ⌃ + ⌥ + Z to quickly delete selected blocks.
![图片[5]-如何有效管理和删除 WordPress 块以提升用户体验-光子波动网 | WordPress教程、Elementor教程与故障修复](https://www.361sale.com/wp-content/uploads/2024/07/2024070602553820.png)
Method 2: Hide the block in WordPress
If you don't want to delete a block completely, you can choose to hide it:
- Open the block editor and click on the top right corner of thethree-pointicon, select "preference".
![图片[6]-如何有效管理和删除 WordPress 块以提升用户体验-光子波动网 | WordPress教程、Elementor教程与故障修复](https://www.361sale.com/wp-content/uploads/2024/07/2024070602573740.png)
- Switch to "blocs" tab, uncheck the checkboxes next to the blocks you want to hide. You can also disable plugin blocks from here, such as WPForms blocks or Soliloquy blocks.
![图片[7]-如何有效管理和删除 WordPress 块以提升用户体验-光子波动网 | WordPress教程、Elementor教程与故障修复](https://www.361sale.com/wp-content/uploads/2024/07/2024070602580311.png)
- When you're done, click "X"Exit Tip.
of this methoddrawbacksIt is not possible to unhide a block individually, only to restore them all.
Method 3: Remove the core block in WordPress
To remove the default WordPress core blocks, you can add PHP code snippets. We recommend using the WPCode plugin to securely add code snippets.
![图片[8]-如何有效管理和删除 WordPress 块以提升用户体验-光子波动网 | WordPress教程、Elementor教程与故障修复](https://www.361sale.com/wp-content/uploads/2024/07/2024070602593053.png)
- Install and activate the WPCode plug-in.
- Access Code Snippets " + Add Code Snippet page, select "PHP Snippet" as the code type.
![图片[9]-如何有效管理和删除 WordPress 块以提升用户体验-光子波动网 | WordPress教程、Elementor教程与故障修复](https://www.361sale.com/wp-content/uploads/2024/07/2024070602594542.png)
- Add the following code snippet:
add_filter( 'allowed_block_types_all', function( $allowed_blocks, $editor_context ): array {
$allowed_blocks = [
'core/paragraph',
'core/list', 'core/list-item'
'core/preformatted', 'core/pullquote', 'core/preformatted'
'core/pullquote', 'core/table', 'core/preformatted', 'core/pullquote'
'core/table', 'core/gallery'
'core/gallery', 'core/image', 'core/gallery
'core/video', 'core/spacer', 'core/video
'core/separator', 'core/separator', 'core/shortcode', 'core/shortcode'
'core/embed', 'core/video', 'core/spacer', 'core/separator', 'core/shortcode', 'core/embed'.
]; }
return $allowed_blocks; }, 100, 2 ); return $allowed_blocks.
}, 100, 2 );
- Save the code snippet and activate it.
Method 4: Remove Plugin Blocks in WordPress
To remove the blocks introduced by the plugin, you can add custom code snippets using the WPCode plugin:
- Install and activate the WPCode plug-in.
- Add the following code snippet, replacing the
aioseo/breadcrumbsis the name of the plug-in block to be deleted:
add_action( 'init', function() {
unregister_block_type( 'aioseo/breadcrumbs' );
}, PHP_INT_MAX ).
- Save the code snippet and activate it.
Creating Reusable Blocks in WordPress
In addition to hiding unnecessary blocks, you can also create reusable blocks to save time and effort:
- Open the Block Editor and enter the content to be converted to a reusable block.
- Click the three dot icon in the block toolbar and select "creation mode"Options.
![图片[10]-如何有效管理和删除 WordPress 块以提升用户体验-光子波动网 | WordPress教程、Elementor教程与故障修复](https://www.361sale.com/wp-content/uploads/2024/07/2024070603020012.png)
- Add a name for your block and click "establish"Button.
![图片[11]-如何有效管理和删除 WordPress 块以提升用户体验-光子波动网 | WordPress教程、Elementor教程与故障修复](https://www.361sale.com/wp-content/uploads/2024/07/2024070603022777.png)
Reusable blocks will be saved in the WordPress database and can be easily found in the block menu and added to a page or post.
reach a verdict
By using the above methods, you can effectively manage and remove blocks in WordPress, improving editing efficiency and user experience. Using the right tools and steps, it's easy to avoid common mistakes and ensure that your website's content management is more efficient and concise. Whether it's hiding, deleting or creating reusable blocks, these tips will help you better control and optimize your WordPress site.
Link to this article:https://www.361sale.com/en/12664/The article is copyrighted and must be reproduced with attribution.



















![表情[wozuimei]-光子波动网 | WordPress教程、Elementor教程与故障修复](https://www.361sale.com/wp-content/themes/zibll/img/smilies/wozuimei.gif)
![表情[baoquan]-光子波动网 | WordPress教程、Elementor教程与故障修复](https://www.361sale.com/wp-content/themes/zibll/img/smilies/baoquan.gif)

No comments