Back to Support Content and Media Blocks Block Error: Unexpected or Invalid Content

Block Error: Unexpected or Invalid Content

Occasionally a block will display an error if it contains content that has a formatting problem. There are a few different ways to fix this if it comes up.

Error Overview

When a block contains an error, it displays the following message:

This block contains unexpected or invalid content.

This can happen for a number of reasons. Commonly, it will appear if 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.

In the case of third-party blocks installed via plugins, the error can appear if you are using an old version of the block or the markup is somehow incorrect. In these cases, you can report the error to the plugin’s developer directly.

Four Ways to Solve The Error

The block will give you several options to fix the error: Attempt Block Recovery, and an ellipsis (three-dot) button containing the options Resolve, Convert to HTML, and Convert to Classic Block.

Attempt Block Recovery

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

Screenshot of an error when a block contains unexpected or invalid content.

This option can allow you to review the block as it was so that you can potentially remove the cause of the error yourself.

Resolve

Screenshot of an error when a block contains unexpected or invalid content. Arrows pointing to the ellipsis (three dots) button and Resolve option from the drop down.

Click on the ellipsis (three dots) button to see more options. The first option is Resolve, it attempts to automatically present a block-based solution with the Convert to Blocks button on the right-hand side, and compares it with converting directly to HTML:

Screenshot showing that appear when Resolve option is clicked. The two options are Convert to HTML and Convert to Blocks.

Convert to HTML

Click the ellipsis (three dots) button to see more options. Click the Convert to HTML block to convert the invalid content directly into an HTML block. This is the same function as the Convert to HTML option which is part of the Resolve option above.

Screenshot of an error when a block contains unexpected or invalid content. Arrows pointing to the ellipsis (three dots) button and Conver to HTML option from the drop down.

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:

Screenshot of an error when a block contains unexpected or invalid content. Arrows pointing to the ellipsis (three dots) button and Convert to Classic Block option from the drop down.

Was this guide helpful for you?

Not quite what you're looking for? Get Help!

Copied to clipboard!