How to Hide Alt Text Captions on Gutenberg Image Blocks

Image Caption Hide

Earlier this week, I was optimizing a post with the new Gutenberg editor in WordPress, trying to improve the search engine optimization.

I added alt text to the image blocks. To my surprise, the alt text automatically appeared as a caption under the images:

Unpublish Modal
Unpublish Modal

This next image shows where I was entering the alt text. To be honest, I don't need the caption. All I need is the alt text to make my posts more accessible and more search engine optimized.

Alt Text Gutenberg
Alt Text Gutenberg

My solution was to add some custom CSS to our site. This CSS will hide many of the captions from your images:

.wp-block-image figcaption {
   display: none; 
}

Depending on your site's theme, you may also need to add !important; to make sure this CSS loads:

.wp-block-image figcaption {
   display: none !important;
}

I love using Gutenberg, but some some elements are confusing. We’ve written about adding GIF images, showing code in Gutenberg and re-arranging metaboxes. None of those tasks are particularly easy until you know the workarounds.

PS. If you do want more options for your image blocks in Gutenberg, check out the Advanced Gutenberg plugin.


Steve Burge

Steve is the founder of PublishPress. Originally from the UK, he now lives in Sarasota in the USA. (P.S. This profile is generated by the PublishPress Authors plugin)

Leave a Reply

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

Professional publishing plugins for WordPress! Get PublishPress