Software Development

Debugging Gutenberg Blocks: 1

I’m adding some tags for tips as I find them.

I found this tip helpful when debugging what the WordPress Block Editor (Gutenberg) was actually doing behind the scenes.

Find the post id (in the edit url there will be a field for post (e.g. post.php?post=121&action=edit). Using the WP-CLI tool you can quickly view the source of the post (assuming you have a very basic post with just the block you are developing) by running:

wp post get 121 --field=post_content

This will display the content showing the HTML as it is stored in the database — including the attributes for the block!

Leave a Reply

Your email address will not be published. Required fields are marked *


To respond on your own website, enter the URL of your response which should contain a link to this post's permalink URL. Your response will then appear (possibly after moderation) on this page. Want to update or remove your response? Update or delete your post and re-enter your post's URL again. (Learn More)