• WordPress 6.3.2

    I create a Gallery block and add a couple images. The images don’t have comments. It looks fine in the editor and when published.

    When leaving and then returning to edit the post, the Gallery block has the error, “This block contains unexpected or invalid content.” I have not edited the HTML of the block.

    Clicking the three dots and selecting Recover results in this modal.

    We aren’t using a block plugin, just the block feature of WordPress. We have used the Gallery block in many posts. All of them have this Block Recovery issue. ??

    Again, it doesn’t affect the rendered page, but it makes editing the page and optimizing it for SEO quite difficult. Any help appreciated.

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Dayn

    (@dayn)

    Correction: the images do not have “captions”. Mis-typed as “comments.”

    I can’t say where it’s coming from or if this is the “invalid content” the editor is complaining about, but ALL your gallery images (in the URL you provided) have the inline style attribute style="width:undefinedpx;height:undefinedpx" — which… is.. invalid.

    Thread Starter Dayn

    (@dayn)

    Thanks for checking that @gappiah. I see that. Hmm. Not sure what’s putting that in there.

    In fact, if I edit the HTML of the block and remove the invalid style attribute and save the draft, the “Attempt Block Recovery” error immediately appears.

    Choosing the three dot menu > Resolve reveals an interleaving of the characters of two class attributes:

    size-large

    and

    aligncenter

    I don’t think that’s necessarily invalid, but it sure is unexpected.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Gallery Block – This block contains unexpected or invalid content’ is closed to new replies.