How To Use WordPress Blocks - Gutenberg Editor

WordPress Block Editor – How To Use Blocks

Blocks
WordPress Block Editor – How To Use Blocks

This tutorial is part of our series on How To Use The WordPress Block Editor (Gutenberg).

In this tutorial, you will learn what Blocks are and how to work with blocks when creating or editing content.

Links to detailed tutorials on how to use many default WordPress content editor blocks are provided at the end of this tutorial.

For a complete understanding of how to use the WordPress Block Editor, see these tutorials:

WordPress Gutenberg: A Block-Based Content Editor

As mentioned in our overview of the WordPress Block Editor, WordPress 5.0 introduced a new content editor called Gutenberg (named after Johannes Gutenberg, who invented the printing press over 500 years ago).

The Gutenberg editor (now referred to simply as the Block Editor) aims to simplify the content creation and content editing process in WordPress using ‘blocks’.

WordPress Content Editor - Blocks
The WordPress Block editor includes many default blocks.

WordPress Block Editor – What Are ‘Blocks’?

Think of ‘blocks’ as being the smallest units or modules you can use on your site to build something or get something done.

This could be adding a paragraph of text, a layout or media element, or some other functionality.

Imagine too, that no matter how different each block’s purpose may be, they all fit and work together seamlessly (like ‘Lego’ blocks).

By combining different blocks, you can build complex web pages with sophisticated layouts and modular functionality.

WordPress, however, aims to extend the functionality of blocks beyond just creating content pages on your site.

Imagine turning your entire web presence into a giant Plug’n’Play site where you can combine content blocks with block-based plugins, widgets, themes, third-party apps, integrations, etc., and add these seamlessly anywhere to your site at any time with just the click of a button and without requiring any coding skills.

One of the main advantages of switching to a block-based content editor is that it opens your website up to many possibilities for simplified future development.

For example, WordPress’s block-based environment allows third-party developers to create new block types that can integrate seamlessly with your existing website, giving you the power to add a whole new level of functionality to your web presence without having to start from scratch or make major changes to what you have already built.

Focusing back on the content editor, Blocks let you add different types of content (e.g. paragraphs, images, quotes, multimedia, etc.) into your posts and pages and rearrange your post/page layouts using features like:

  • ‘Point and click’ (e.g. move your cursor over an item and click to select it or add an element to your page).
  • ‘Drag and drop’ (e.g. rearrange your page layout).
  • Resizing handles (e.g. for resizing images).
  • Drop-down menus (e.g. select one of several options to configure a setting).
  • Incremental Sliders (e.g. slide right or left to increase or decrease values, adjust widths, etc.)
  • Value fields (e.g. enter a number of items to display for an element).
  • Up and down arrows (e.g. move content sections up and down the page).

WordPress has published a great video introduction to publishing content with the block editor. To watch this video, go here:

Working With Blocks

As mentioned earlier, with the Gutenberg editor, adding content to posts and pages is all done using ‘blocks’.

WordPress block editor - Block directory.
Just some of the blocks you can use to create posts and pages on your site.

The Block Editor contains tools that let you select and insert different blocks into your content.

Let’s go through these tools:

Block Inserter Tool

The Block Inserter tool (Add Block) can be accessed from the Editing Toolbar, or inside the Content Area.

The Add Block tool is the button with the [+] sign. It is the second button on the top left side of the Editing Toolbar.

WordPress Block Editor - Add Block tool
Use the Add Block tool to view and insert blocks into your posts and pages.

You can also access the Add Block tool inside the content area by clicking above or below an existing block.

WordPress Block Editor - Add Blocks inside the content area
Add Blocks inside the content area.

The ‘Add Block’ tool is divided into the following tabbed sections:

  • Blocks – Blocks are the building elements of your content. This section displays a list of all the default and installed blocks in your content editor.
  • Patterns – Patterns are predefined block layouts (groups of blocks) created by designers. This section is explained further below.
  • Reusable Blocks – Reusable blocks can be used repeatedly in your content. Note: You must create at least one Reusable Block for this section to display in the Add Block tool’s tabbed menu section.

Additionally, the Blocks menu contains a ‘Search’ field and different menu sections:

  • Most Used
  • Common Blocks
  • Formatting
  • Layout Elements
  • Widgets
  • Embeds
  • Reusable Blocks – Note: You must create at least one Reusable block for this section to display in the Add Block tool’s menu.

To insert a block into the content editor, either search for the block inside the ‘Add Block’ tool and then click on the block or scroll down the list and click on the block. If you’re not sure what a particular block does, hover over it and a description will pop up.

Search and add blocks
Search and add blocks to your content using the Add Block tool.

You can also add a block to your content by selecting it and then dragging and dropping it into place.

Add block using drag and drop.
Add blocks to your content using drag and drop.

Important

To learn more about the block types found in each of these sections, see the links provided at the end of this tutorial.

Block Directory

Just like plugins and themes, you can also add blocks to endlessly extend your site’s functionality.

This is where the Block Directory comes in handy.

After the block editor became the new default WordPress editor, WordPress made the creation of a Block Directory one of its next priority projects.

While the default block editor includes a sizeable number of useful blocks already, the Block Directory allows web and plugin developers to create and add new types of blocks with specific functionalities to the Block editor.

It also allows users to discover, test, and install new blocks for their website without leaving the editor, as the Block Directory is built right into the block editor.

You can install blocks from the built-in Block Directory into your site using the Add Block tool.

Just search for a specific functionality you would like to add to your content and a list of blocks matching your search will display inside the menu.

Important

Note: The block directory is only available to users that have the capabilities to install and activate plugins on their site.

To download and install these custom blocks, click on the Add block button.

Block Directory results.
Add new blocks to your content from the Add Block tool using the built-in Block Directory.

You can also access the Block Directory while working inside the content area by selecting the Block Inserter tool and clicking on the Browse all link.

Add Block tool - Browse All
Click on the Add Block tool’s Browse All link inside the content area to access a list of blocks from the Block Directory.

The WordPress team has put together a great video that explains how the Block Directory works.

Block Patterns

Block Patterns are predefined block layouts (groups of blocks) that you can insert into your posts and pages and then tweak and customize to suit your needs.

Block patterns allow web designers to create complex, beautiful, and stylized layouts using combinations of text and media blocks that you can then instantly add to you enhance the look and feel of your content without having to design or create these yourself.

Block patterns can be found in a wide variety of plugins and themes, with more patterns being constantly added as WordPress evolves.

Like Blocks, you can select and add patterns into your content from the Inserter tool.

WordPress Block Editor - Patterns
Create complex content layouts using Block Patterns.

Just select and click on a Pattern and it will be automatically added to your content.

WordPress Block Editor - Patterns
Click on a Pattern to insert it into your content.

You can then easily tweak and customize the block elements inside the Block Pattern to suit your needs.

WordPress Block Patterns can be easily edited.
Block Patterns can be easily tweaked and edited to suit your needs.

The WordPress team has also put together a video explaining how Block Patterns work.

Block Editors

Depending on the type of block you add to your post or page, you will see that each block has its own Block Editor with a menu of options that let you change things like format, add or remove links, replace color, change the alignment of elements, etc.

These appear when you click inside the block.

For example, here is the Block Editor of a Paragraph block

Block Editor - Paragraph Block
Block Editor – Paragraph block

Each block also has its own set of controls that will display in the Settings section when you select the block.

Some blocks let you adjust various settings, and some blocks have few or no settings.

Also, many blocks share common settings. We cover these in our WordPress Block Settings section.

You can show or hide these settings from the Block Editor’s More Options menu. Click the three dots (vertical ellipsis) to reveal additional settings in your Block Editor.

WordPress Block Editor - Block Settings
Each block type has its own set of controls with additional options and settings.

For a great overview of how Block settings work in the WordPress Block Editor and how to adjust these, see the video below:

  • For in-depth tutorials about using different types of blocks, see the links at the end of this tutorial.
  • To learn how to configure common block settings, see this tutorial: WordPress Block Editor: Block Settings

Block Editor Settings

As mentioned in the previous section, every block type has its own set of controls with additional settings and options.

All block types, however, follow a similar build structure.

Some of the universal elements you will find in most Block Editors include features that let you:

  • Move Blocks
  • Change Block Type or Style
  • Access Additional Options
  • Access Advanced Block Settings

Moving Blocks

You can easily reorder, rearrange, or reposition blocks in your content using ‘move up’ and ‘move down’ arrows in the Block Editor.

Block Editor - Move Up and Down arrows
Reorder blocks on your post or page using the up and down arrows.

You can also place blocks wherever you like and rearrange the layout of your content in your post or page using drag and drop.

Block Editor - Drag and Drop feature.
Rearrange blocks on your page using drag and drop.

Additionally, you can move blocks using the Move To function in the More Options menu (this is explained further below).

Moving blocks is covered in more detail in our tutorial on how to use the Block Editor’s Content Area.

Change Block Type Or Style

Some blocks allow you to easily change or substitute the block type or style.

This feature is useful for converting content from one type into another without having to insert a new block and transfer its content over.

For example, here are the options available for changing a Paragraph Block into another type of block (e.g. a Quote block or Verse block)…

Change Block type
You can easily change some blocks into other types of blocks.

Block Editor Settings – Options

Another common element of block editors is the ‘Options’ section, which includes the following standard settings:

  • Show/Hide Block Settings
  • Copy Block
  • Duplicate
  • Insert Before
  • Insert After
  • Move To
  • Edit as HTML
  • Lock
  • Create Reusable Block
  • Group
  • Remove Block

To display the ‘Options’ menu, click on the three dots (vertical ellipsis) on the Block Editor menu.

WordPress Block Editor - More Options Menu.
WordPress Block Editor – Options Menu.

Let’s go through each of these settings.

Useful tip

Once you’re familiar with the settings below, you can save time accessing these features using Keyboard Shortcuts.

Show/Hide Block Settings

Hiding block settings lets you work on your content free of distractions (i.e. (‘Distraction-Free’ Mode).

WordPress Block Editor: More Options - Show/Hide Block Settings
More Options – Show/Hide Block Settings

To hide block settings:

  • Click anywhere inside the block to view the Block Editor.
  • Select the ‘Options’ menu
  • Click ‘Hide Block Settings’ to hide the ‘Settings’ sidebar from view.
  • Click ‘Show Block Settings’ to display the ‘Settings’ sidebar on your content editor again.
More Options - Show/Hide Block Settings
Use this function to show or hide your block settings.

Copy Block

This function copies all the content inside your selected block to your clipboard (e.g. text, images, etc.) and preserves all formatting tags.

This function is useful if you would like to copy and paste the content from a block into a different post or page.

WordPress Block Editor: More Options - Copy setting.
More Options – Copy setting.

Note: if you plan to reuse the same block content often, you can also turn the block into a Reusable block – see further below for more details.

To copy content from a block to your clipboard:

  • Click anywhere inside the block to view the Block Editor.
  • Select the ‘Options’ menu
  • Select ‘Copy’ to copy all the content from the block to your clipboard.
  • Use the normal ‘Paste’ function to paste the content into another block (e.g. on a different post or page), save the block content to a text file, etc.
More Options - Copy
Use this function to copy content from a selected block to your clipboard.

Duplicate

This setting lets you save time recreating an existing block. Use the Duplicate setting to create and add an identical copy (i.e. a clone) of any selected block into your content, then tweak the content on your duplicated block to suit your needs.

WordPress Block Editor: More Options - Duplicate setting.
More Options – Duplicate setting.

To duplicate a block:

  • Click anywhere inside the block to view the Block Editor.
  • Select the ‘Options’ menu.
  • Click ‘Duplicate’.
  • Edit and/or reposition the duplicated block if required.
  • Save your post or page to update your content.
Duplicate a block.
Use this function to duplicate a block.

Insert Before

This setting lets you insert a new block into your content above the block you are currently working on.

WordPress Block Editor: More Options - Insert Before setting.
More Options – Insert Before setting.

To insert a block above your selected block:

  • Select the block where you want to insert a new block before it.
  • Click anywhere inside the block to view the Block Editor.
  • Select the ‘Options’ menu.
  • Click ‘Insert Before’.
  • A new block ‘placeholder’ will be inserted above your selected block.
  • Use the ‘Add Block’ tool to select the type of block you want to add to the new block placeholder.
  • Save your post or page to update your content.
More Options - Insert Before
Use this function to insert a block before a selected block.

Insert After

This setting lets you insert a new block into your content below the block you are currently working on.

More Options - Insert After setting.
More Options – Insert After setting.

To insert a block below your selected block:

  • Select the block where you want to insert a new block after it.
  • Click anywhere inside the block to view the Block Editor.
  • Select the ‘Options’ menu.
  • Click ‘Insert After’.
  • A new block ‘placeholder’ will be inserted below your selected block.
  • Use the ‘Add Block’ tool to select the type of block you want to add to the new block placeholder.
  • Save your post or page to update your content.
WordPress Block Editor: More Options - Insert After
Use this function to insert a block after a selected block.
Move To

This function lets you reposition a block on your post or page using your keyboard instead of clicking on the Block Editor’s Move Up and Down arrows or using the drag and drop handle.

WordPress Block Editor: More Options - Move To setting.
More Options – Move To setting.

To move a block:

  • Select the block you want to move to a different location on your post or page.
  • Click anywhere inside the block to view the Block Editor.
  • Select the ‘Options’ menu.
  • Select ‘Move to’.
  • A blue horizontal line will display above the block.
  • Move the blue horizontal line up and down your content using your keyboard’s ‘up’ and ‘down’ arrow keys until the line is in the desired location you want the block moved to.
  • Hit the ‘Enter’ key.
  • Your selected block will be moved to the new location on your post or page.
More Options - Move To
Use this function to move your selected block to a different location in your content.
Edit as HTML

Normally, you view, edit, and format your content using a visual editor. This setting lets you view and edit the block’s underlying HTML code.

WordPress Block Editor: More Options - Edit as HTML setting.
More Options – Edit as HTML setting.

To view and edit a block’s HTML code:

  • Click anywhere inside the block to view the Block Editor.
  • Select the ‘Options’ menu.
  • Click ‘Edit as HTML’.
  • The block content will switch to the HTML editor.
  • To return to the visual editor, select the ‘More Options’ menu again and click on ‘Edit visually’.
  • Save your post or page to update your content.
More Options - Edit as HTML
Use this function to view and edit the HTML code of your block.
Copy and Paste Styles

In version 6.2, WordPress introduced the option to copy and paste one block’s styles to other blocks for a more consistent appearance.

WordPress Block Editor: More Options - Copy and Paste Styles
More Options – Copy and Paste Styles

To copy and paste a block’s style:

  • Click anywhere inside the block to view the Block Editor.
  • Select the ‘Options’ menu.
  • Select ‘Copy styles’
  • Select the block you want to apply the copied styles.
  • Select ‘Paste styles’
  • The copied styles will be applied to the new block.
  • Save your post or page to update your content.
Lock

Block locking helps to prevent important blocks from being moved on the page or accidentally removed by users.

You can lock core and experimental blocks in WordPress.

Web developers can perform several types of block locking to prevent users from:

  • Inserting blocks.
  • Removing blocks.
  • Moving blocks using drag or drop, arrow keys, or the list view.
  • Editing anything except text and media.
  • Restrict the editing of reusable blocks.

Users can lock and unlock blocks in the editor, depending on their user permissions.

WordPress Block Editor: Options - Lock setting.
More Options – Lock setting.

Choosing to lock a block brings up a pop-up window giving you a choice of the following attributes:

  • Lock all – Tick this box to enable all lock options or select the individual options below:
    • Disable movement – Prevents users from moving blocks using drag or drop, arrow keys, or the list view.
    • Prevent removal – Prevents users from deleting the block
    • Apply to all blocks inside – This option appears in the modal when locking the inner blocks of container blocks such as Group, Cover, and Columns.
WordPress Block Editor: Options - Lock setting.
Block locking options.

The Apply to all blocks inside toggle appears when working with grouped blocks.

WordPress Block Editor: Options - Lock setting - Container blocks
Container blocks include an additional option to lock all blocks inside the group.

You can tell that a block is locked if the padlock icon displays in the block menu toolbar.

WordPress Block Editor: Options - Lock setting.
This block is locked.

To unlock a blocked lock, either:

Click on the padlock icon in the block menu toolbar and select unlock options…

WordPress Block Editor: Options - Unlocking a block from the toolbar
Click on the padlock icon to unlock the block.

Or click on the Options menu and select Unlock

WordPress Block Editor: Options - Unlock setting.
Click Unlock to unlock a locked block.

Note: depending on user permissions, a user may not be able to unlock a block that has been locked by an administrator or developer.

Create Reusable Block

This setting lets you store a customized block that can be reused anywhere you like on your site.

WordPress Block Editor: More Options - Create Reusable block setting.
More Options – Create Reusable block setting.

To save a block as a reusable block:

  • Click anywhere inside the block to view the Block Editor.
  • Select the ‘Options’ menu.
  • Click ‘Create Reusable Block’.
  • Give the newly-created block a name and click Save.
  • Your block will be stored in your site’s ‘Blocks’ library.

Note: Reusable blocks are global. This means that any edits you make to a reusable block will be applied to every instance of that repeatable block used on your site.

More Options - Add to Reusable blocks
Use this function to add a selected block to your site’s Reusable block library.

To learn more about creating, editing, using, and managing reusable blocks, see this tutorial: Reusable blocks

Group

This setting lets you group different blocks together.

WordPress Block Editor: More Options - Group
More Options – Group setting

To group blocks together:

  • Either:
    • Drag your cursor to highlight a group of blocks, or
    • Hold down the ‘Shift’ key and click on the blocks you want to group together
  • A Block Editor will display after you have selected multiple blocks.
  • Either:
    • Click on the left-hand icon (i.e. the two overlapping boxes) and select ‘Transform to Group’, or
    • Click on the three dots (vertical ellipsis) to expand the ‘More Options’ menu and then select ‘Group’.
  • Your selected blocks will be grouped together.
  • You can also ungroup the blocks using the same process.
More Options - Group setting.
Use this function to group blocks together.

Note: You cannot move other blocks on your post or page (eg using the ‘Move to’ function) between grouped blocks.

Remove Block

This setting lets you remove a block that you no longer need from a post or page.

WordPress Block Editor: More Options - Remove block setting.
More Options – Remove block setting.

To remove a block from your post or page:

  • Select the block you want to remove.
  • Click anywhere inside the block to view the Block Editor.
  • Select the ‘More Options’ menu.
  • Click ‘Remove Block’.
  • Your block will be deleted from your post or page.
  • Save your post or page to update your content.
 More Options - Remove block setting.
This function lets you remove a block.

To hide the ‘More Options’ menu, click on the three dots (vertical ellipsis) on the Block Editor menu.

WordPress Block Editor: Hide More Options menu.
Click on the three dots (vertical ellipsis) to hide the More Options menu.

More Rich Text Controls

Many block editors include a ‘More rich text controls’ section with the following options:

  • Inline Code – Convert selected text into code (e.g. printf("Enter a character: ");)
  • Inline image – Insert an image directly within your text (e.g. a logo or image thumbnail).
  • Strikethrough – Add a strikethrough effect to your selected text.
  • Subscript – Convert selected text into subscript text. (e.g. H2O)
  • Superscript – Convert selected text into superscript text. (e.g. 102)
  • Text color – Change the color of your selected text (select a color from a predefined palette or add your own custom color).
More rich text controls - Options
More rich text controls.

Advanced Block Settings

Many blocks contain an Advanced Settings section with advanced options such as:

  • Title Attribute – The title attribute can be used to add text for a tooltip, an image credit or a description of the image, etc. Note: many devices and browsers do not display this text.
  • HTML Anchor – Also known as Page Jumps or Jump Links, this allows you to link directly to any section of your page using a unique URL. Learn how to use HTML anchors.
  • Additional CSS Class(es) – This field lets you add multiple CSS classes to your block separated with spaces. This allows you to write custom CSS and style the block as you see fit. Note: This requires having knowledge of CSS (Cascading Style Sheets).

How To Add Blocks To Content

Blocks can be added anywhere on the page with the click of a button, inserted before or after other blocks using dropdown menus, converted into different block types, and easily reordered using ‘drag and drop’, or ‘up and down’ buttons.

You can add blocks to content in several different ways.

For example, you can add blocks:

  1. From the ‘Add Block’ tool in the Editing Toolbar
  2. From the ‘Add Block’ tool in the Content Area
  3. From inside an existing block.
  4. From your ‘Reusable Blocks’ library.

To learn how to add blocks to your posts and pages, see this tutorial: The WordPress Block Editor Content Area

Important

Creating content for posts and pages using the WordPress Block Editor works the same way regardless of what type of site you have (e.g. a blog, company website, eCommerce site, etc.).

Because blocks are designed to allow your website to integrate with all kinds of new and external applications, how your content will look after publishing your posts or pages depends on various factors like:

  • The WordPress Theme installed on your site (and any specific theme styles or customizations).
  • Different block settings, options, and configurations.
  • Any content modification plugins you have installed on your site (most plugins now include their own custom blocks for the WordPress block editor).
  • Integrations with third-party applications (many third-party application developers are now also creating blocks that allow their apps to integrate seamlessly with the WordPress block editor),
  • Any additional site customizations, etc.

WordPress Gutenberg Blocks

The WordPress block editor includes many useful default blocks.

WordPress blocks
Some default WordPress blocks.

More block-enabled plugins are being continually developed by the WordPress developer community to help you extend and expand the functionality of the Gutenberg content editor.

WordPress Plugin directory - Block-Enabled Plugins
WordPress Plugin directory – Block-Enabled Plugins. (Source: https://wordpress.org/plugins)

If you click on ‘See all’ in the Block-Enabled Plugins section, you can browse many plugins that offer blocks for the block-based editor to help enhance and extend your content.

WordPress Plugin Directory - Browse: Blocks
Browse Block-enabled plugins in the WordPress plugin directory.

Additionally, you can search the WordPress plugins library from your dashboard for new block-enabled plugins (Plugins > Add Plugins).

Add Plugins screen - search for block-enabled plugins.
Search for block-enabled plugins in the Add Plugins screen.

WordPress Block Editor – Blocks

Clicking on the ‘Add Block’ tool in the WordPress Block Editor Toolbar brings up a list of Blocks.

WordPress Block Editor - Blocks List
Choose blocks from this list.

This tool contains a ‘Search’ field and tabbed sections for Blocks, Patterns, and your Reusable Blocks library (you need to create at least one reusable block for this tab to display).

The Block List is divided into the following sections:

  • Most Used (see below to learn how to add this section)
  • Text
  • Media
  • Design
  • Widgets
  • Embeds
  • Reusable (only displays when a reusable block is created)

See Your Most Used Blocks

If you use the same blocks often, you can display your most used blocks at the top of your block list.

WordPress Block Editor: Blocks - Most Used
Most Used Blocks category.

To enable the most used blocks category, do the following:

Click the icon with the three dots (vertical ellipsis) in the top right-hand corner of the editor screen to access the ‘More tools & options’ section.

WordPress Block Editor - More tools & options
Click on More tools & options…

Click on Preferences.

More tools & options - Preferences.
Select Preferences…

In the Preferences > General section, check the box next to Show most used blocks.

More tools & options - Preferences - Show most used blocks.
Check the box.

The ‘Most Used’ blocks category will now display at the top of your list of Blocks.

List of Blocks with Most Used Blocks category.
The Most Used blocks category now displays in the list of Blocks.

Troubleshooting Issues With Blocks

Sometimes when editing a post or page, a block will not display in your content and you will see this error message instead:

WordPress Block Error message: "This block contains unexpected or invalid content."
“This block contains unexpected or invalid content.”

This can happen for a number of reasons:

  1. You created a page or post using the WordPress Block Editor, then edited later using the WordPress Classic Editor. When you go back to the Block Editor, this can affect some blocks and this message displays instead.
  2. You modify the HTML of the block in the Code Editor and make a syntax error. You can check the HTML to make sure you have used the correct syntax (see below).
  3. A third-party block installed via plugins can cause the error to appear if you are using an old version of the block or the markup is incorrect. If this happens, we recommend speaking to your web developer or reporting the error directly to the plugin’s developer.

How To Fix Block Errors

WordPress blocks give you several options to try and fix errors when you see the message “This block contains unexpected or invalid content.”:

  • Attempt Block Recovery – Displays as a clickable button.
  • Resolve – Select the “More options” menu by clicking on the ellipsis (three-dot) icon to access this option.
  • Convert to HTML – Select the “More options” menu by clicking on the ellipsis (three-dot) icon to access this option.
  • Convert to Classic Block – Select the “More options” menu by clicking on the ellipsis (three-dot) icon to access this option.
A block displaying the error message "This block contains unexpected or invalid content" with an "Attempt Block Recovery" button and an ellipsis menu visible with three additional options: 'Resolve' (highlighted), 'Convert to Classic Block' and 'Attempt Block Recovery'.
WordPress gives you 4 options to try and fix block errors.

Let’s go through each of these options:

Attempt Block Recovery

To check if the block editor can restore the block to how it was before the error appeared, click on the Attempt Block Recovery button.

Attempt Block Recovery
Attempt Block Recovery checks if the block editor can restore the block as it was before the error.

Clicking this button requires no technical skills and often fixes the block errors.

Attempt Block Recovery
Clicking this button will often fix the problem.

The other options below require some technical knowledge, so if you are a non-technical user, then it’s probably best to leave these to your website developer.

Nonetheless, let’s go through these options:

Resolve

Select the “More options” menu by clicking on the ellipsis (three-dot) icon and select Resolve

Resolve attempts to automatically present a block-based solution by splitting the results into two columns:

  • Left column – displays code and the Convert to HTML button.
  • Right column – displays code and the Convert to Blocks button.
Resolve Block pop-up.
Resolve Block compares converting the invalid content to a Custom HTML block (left column) or attempting to fix errors and return the fixed content to the block it was added to.

 

Convert to HTML

The Convert to HTML block converts the invalid content directly into an HTML block.

Note: This is the same function as the Convert to HTML option which is part of the Resolve option above.

Select the “More options” menu by clicking on the ellipsis (three-dot) icon and select Convert to HTML

A block showing the text "This block contains unexpected or invalid content" with 'Convert to HTML' option selected.
Convert to HTML

Convert to Classic Block

To convert the invalid content into a Classic block, click the ellipsis (three dots) button, and choose Convert to Classic Block from the menu.

A block showing the text "This block contains unexpected or invalid content" with 'Convert to Classic Block' option selected.
Convert to Classic Block

This will convert the block into a Classic block and allow you to edit the block’s content using Classic editor features.

Block with error converted into a Classic block.
The Block with an error has been converted into a Classic block.

As mentioned above, clicking on the Attempt Block Recovery button will often fix most of the errors you experience with blocks and does not require any technical knowledge or skills.

If clicking on the Attempt Block Recovery button doesn’t fix the issue, you can try exploring the other options or contact your website developer for further assistance.

WordPress options for fixing "This block contains unexpected or invalid content" block errors.
WordPress gives you several options for fixing “This block contains unexpected or invalid content” block errors.

Default WordPress Editor Blocks – Tutorials

For detailed tutorials on using the WordPress Block Editor’s default blocks, click on the links below:

Congratulations! Now you know how to use WordPress Blocks when creating and editing content using the WordPress Block Editor.

Additional WordPress Block Editor Tutorials

To learn more about using the WordPress Block Editor, see these tutorials:

Blocks
Learn how to use WordPress Editor Blocks

***

Print Friendly, PDF & Email

Updated: April 12th, 2023

Terms Of Use | Privacy Policy

Scroll to Top