Clear Content Button

Empty a block’s text, links and images in one click while keeping its layout.

Lauren Gray Avatar

Clear Content Button adds a Clear Content button to the block toolbar. One click empties a block’s text, links and images but keeps the block and its layout, so you can reuse a design without deleting things line by line.

Before you start

  • WordPress 5.8 or later
  • PHP 5.6 or later
  • The block editor. The button only appears on core WordPress blocks (blocks whose name starts with core/), not on blocks added by other plugins.

Install

  1. In your WordPress dashboard, go to Plugins → Add New Plugin.
  2. Click Upload Plugin.
  3. Choose the plugin zip file.
  4. Click Install Now.
  5. Click Activate.

There’s no settings page. The button shows up in the editor as soon as the plugin is active.

How to use

Clear a block with the toolbar button

  1. Open a post, page or template in the block editor.
  2. Select the block you want to empty. For a group of blocks, select the outer block (for example, a Group or Columns block).
  3. In the block toolbar, click Clear Content.
  4. A Content cleared successfully notice appears at the bottom of the screen.

Clear a block with the keyboard

Select the block and press Cmd+Option+X on a Mac or Ctrl+Alt+X on Windows.

What gets cleared

The plugin empties these block settings, and does the same for every block nested inside the one you selected:

  • Text: content, text, caption, value and title
  • Links: URL, link target and link rel
  • Images: alt text, the attached media ID and any setting with “image” in its name

Styles, colors, spacing and the block structure stay as they are.

Cleared something by mistake? Press Cmd+Z (Mac) or Ctrl+Z (Windows), or click Undo in the top toolbar, to bring it back.

Developer reference

Coming soon: the hooks, filters and functions you can use with this plugin from your theme or a code snippet.

FAQs

Why don’t I see the button on some blocks?

The button is only added to core WordPress blocks. Blocks from other plugins don’t get it. If you select a core block such as a Group that contains third-party blocks, only the core blocks inside it are cleared.