Support » Plugin: Gutenberg » Disable warning ‘This block contains unexpected or invalid content’ in html bloc

  • Firstly, I really, really like Gutenberg!
    I think it’s a great improvement & love the direction of travel.

    I have been using the html block to wrap multiple blocks in a div.
    The editor allows allows this approach:
    (see: )

    When revisiting this page a warning is (unsurprisingly?) prompted:
    (see link above)

    I’d like to hand over these pages to the author/editor without these warnings.
    Can I disable them?
    Are there issues that I’m missing why it’s not ok to use the html block to add unclosed/unopened tags??

    many thanks

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 15 total)
  • Mr_sordum


    Sounds like there was a change on the block… Try to bring a new “same” block inside. If it works, they changed something so thats why you got this error.

    I’m trying to do the same thing at the moment. I want to wrap some blocks into a section by using the html-Blocks, but the editor seems to check html structure and gives a warning when reloading. The html is the same but I always have to revert block to html block… is there a way to disable that warning / check?

    I would like to know this as well.

    I have the same problem!

    I have an HTML block on a page, and every time I go to edit that page, there is a message: “This block contains unexpected or invalid content”. I have to click the “Convert to HTML” button every time I want to edit it.

    My fear is that another editor will come along later, and click on the “Resolve” button, then mess up the page 🙁

    Any word or fix for this? Im getting this issue when mixing custom html blocks with standard blocks. It seems it’s detecting broken html but my closing div is after the wordpress block. So it’s not broken html! I’d like to turn this off, I have good reason to mix custom html with gutenberg blocks since your column system is limited to equal width.

    +1. Another fail for gutenberg.

    Yes. Me too also as well.

    It’s quite the annoying productivity killer when you have a ton of custom code to write and you deal with this warning many times on every page.

    I feel like when I first started using reusable blocks to wrap paragraphs in a div a couple months ago I wasn’t getting this message.

    I don’t know how I would have missed it. Because it’s horrible. I have a reusable block both for the open div and the end div. It’s hard to tell them apart now as they both look identical. All that is shown in the warning message.

    I can understand some people might want this message, Might be nice if it was an option that were easy to turn off.

    • This reply was modified 1 year, 6 months ago by shawn caza.
    • This reply was modified 1 year, 6 months ago by shawn caza.

    Agree, this warning needs to be disabled. It doesn’t give me an option to even close it, I am forced to either Resolve or Convert to HTML every time.



    This warning needs to be turned off. I’ve been writing html from scratch for 20 years!!!! I don’t need this to check my html. And when I start a comment out and toggle (which to a different window) away to confirm where I’m ending it…..THAT’S NOT WHEN I NEED AN HTML CHECK!!!! WordPress you need to stop trying to make our lives better….most of the time you break conventions we’ve all been using for YEARS!

    I frequently run into the same scenario as @graftedin – I will be working on an edit to the HTML code, switch to a different tab or window to look up something, and when I switch back I can’t resume working on the code! If it wants to warn me at the time I try to save the post, fine. But don’t touch anything while I’m in the middle of working in “Edit as HTML” and haven’t even moved to another block, let alone tried to save the post.

    Kanhaiya Yaduwanshi


    I’m facing the same issue when I clone or save and edit the page again.
    It shows me the “This block contains unexpected or invalid content”. could you please help me to fix this permanently.




    I’m having the same problem when I try to manually add html to a text block(e.g. aria-label or data-label).
    It shows me the “This block contains unexpected or invalid content”. could you please help me to fix this permanently.


    Yeah, I agree. It would be nice to be able to turn off this warning. It’s annoying.

    Ditto. Is there anyone here who knows who could be able to help remove this HTML check? Thanks in advance!

Viewing 15 replies - 1 through 15 (of 15 total)
  • You must be logged in to reply to this topic.