Spooktacular Halloween Sale: Grab 20% Off on WP Theme Bundle – 10+ Premium WP Themes! Use Code 'BOOSALE' 🎃

United States dollar ($) - USD
  • United States dollar ($) - USD
  • Indian rupee (₹) - INR
SPECTRA THEMES

How to Delete a Block in WordPress

How to Delete a Block in WordPress

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.

  1. Select the Block
    • Click on the block you wish to delete.
  2. Use the Toolbar Options
    • Click the three-dot menu in the block toolbar.
    • Select “Remove Block.”
  3. Shortcut for Faster Deletion
    • Use the shortcut:
      • Windows/Linux: Shift + Alt + Z
      • Mac: Control + Option + Z ( ⌃ + ⌥ + Z )

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:

  1. Access Block Preferences
    • Open the editor.
    • Click the three-dot menu in the top-right corner.
    • Select “Preferences.”
  2. 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.

  1. Use a Code Snippet Plugin
    • Install and activate the WPCode plugin.
  2. Add a Custom PHP Snippet
    • Go to Code Snippets > Add New Snippet in the dashboard.
    • Add the following code:
    php
    add_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.
  3. 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:

  1. Identify the Plugin Block
    • Open the code editor in Gutenberg to find the block name (e.g., plugin/block-name).
  2. Unregister the Block
    • Use WPCode to add this snippet:
    php
    add_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.

bundle-sec-img (1)
StrivioThemes WordPress Theme Bundle

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.

StrivioThemes

StrivioThemes is a skilled team of WordPress developers focused on creating high-quality themes and plugins. With a commitment to responsive and user-friendly designs, StrivioThemes empower businesses to build professional websites effortlessly. Dedicated to innovation, StrivioThemes offers customizable solutions that enhance user experiences and help clients thrive in the digital landscape.

Table of Contents

WP Theme Bundle

Need Help?

You will find a lot of tutorials how to setup and configure your theme in our support center.

Best Selling Themes

People are also reading

Explore Expert Tips and Fresh Ideas to Elevate Your Online Presence!