WordPress’s block editor, Gutenberg, is a versatile tool designed to make creating content easier. However, you may find certain blocks unnecessary or cluttering your workflow. Learning how to delete a block in WordPress can help you streamline your editor interface and improve your focus. This guide will walk you through different methods to delete, hide, or remove blocks in WordPress and explain why you might need to do so.
Why Delete Blocks in WordPress?
The block editor offers various blocks like Paragraph, Image, Video, and specialized ones like Verse or Pullquote. While these options provide flexibility, not all blocks may be useful for your content. Deleting or hiding blocks can:
- Improve your productivity.
- Reduce visual clutter.
- Help you maintain a clean interface.
- Keep your content focused and engaging.
For example, a food blogger might not need the Verse block meant for poetry. Similarly, hiding or removing plugin blocks you rarely use can help you focus on relevant tools.
How to Delete a Block in WordPress (Step-by-Step)
Method 1: Deleting Block in WordPress Editor
This method is perfect if you want to remove specific content blocks from a post or page without affecting the overall block menu.
- Select the Block
- Click on the block you wish to delete.
- Use the Toolbar Options
- Click the three-dot menu in the block toolbar.
- Select “Remove Block.”
- Shortcut for Faster Deletion
- Use the shortcut:
- Windows/Linux: Shift + Alt + Z
- Mac: Control + Option + Z ( ⌃ + ⌥ + Z )
- Use the shortcut:
You can also delete multiple blocks by selecting them and choosing the “Remove Block” option.
Method 2: Hide Unused Blocks
If you don’t want to delete a block completely but would like to hide it from the editor menu:
- Access Block Preferences
- Open the editor.
- Click the three-dot menu in the top-right corner.
- Select “Preferences.”
- Hide Blocks
- Go to the “Blocks” tab in the popup menu.
- Uncheck the blocks you don’t need.
To undo this, revisit the Preferences menu and reset block visibility.
Note: This method hides blocks but keeps them accessible if needed later.
Method 3: Remove Core Blocks Permanently
This method is ideal for advanced users who want to remove blocks they will never use.
- Use a Code Snippet Plugin
- Install and activate the WPCode plugin.
- Add a Custom PHP Snippet
- Go to Code Snippets > Add New Snippet in the dashboard.
- Add the following code:
phpadd_filter( 'allowed_block_types_all', function( $allowed_blocks ) {
$allowed_blocks = [
'core/paragraph',
'core/heading',
'core/image',
'core/list',
];
return $allowed_blocks;
}, 10, 2 );
- Modify the
$allowed_blocks
array to include only the blocks you need.
- Save and Activate
- Save the snippet and enable it to apply changes.
This removes unwanted blocks from the editor interface entirely.
Method 4: Remove Plugin Blocks
Plugins often add their own blocks to the editor, which can clutter the menu. Here’s how to remove them:
- Identify the Plugin Block
- Open the code editor in Gutenberg to find the block name (e.g.,
plugin/block-name
).
- Open the code editor in Gutenberg to find the block name (e.g.,
- Unregister the Block
- Use WPCode to add this snippet:
phpadd_action( 'init', function() {
unregister_block_type( 'plugin/block-name' );
});
Replace
plugin/block-name
with the actual block name.
Conclusion
Deleting blocks in WordPress is a simple yet effective way to improve your workflow. Whether you want to remove a block temporarily or permanently, there’s a method for you. By customizing your block editor, you can focus on creating high-quality content without unnecessary distractions.
If you’re a WordPress enthusiast or manage multiple sites, check out our comprehensive WordPress Theme Bundle. Packed with premium features and versatile designs, it’s perfect for bloggers, businesses, and developers looking to elevate their sites.