I created a block template and attached it to my cpt and I get this message on the post page neither of the two buttons or the two links in the vertical dot button work unless I disable $pages_type_object->template_lock = 'all';

enter image description here

So how can I get rid of this message and keep the $pages_type_object->template_lock = 'all';?

2 Answers 2


seems my problem was in my array

'level' => '3',

should've been

'level' => 3,

There sounds like there may be a couple issues going on.

Regarding the message "this block contains unexpected or invalid content": That message is occurs when the Gutenberg has noticed that the HTML that is to be generated (stored in the post_content column of your database) has changed in an unexpected.

This issue occurs very often and best practices of how block developers should avoid is not resolved.

Secondly, the resolve and the convert to hotel buttons should both respond to you when you click or select the button, by displaying an html block with your code. If you click or select either button and nothing happens, then there is possibly a bug with the Gutenberg editor or a bug with your custom post type code. It's hard to diagnose what could the issue be unless you share more code but as a start, I'd recommend installing the query-monitor plugin to see if there's any php errors as well as looking in for in your browser's web console (cntrl + shift + k).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.