Skip to Content

How to Resolve WordPress Featured Image Caption Not Showing

How to Resolve WordPress Featured Image Caption Not Showing

Images are an essential part of any website. They help break up the content, add visual interest, and can even help with SEO. However, if your WordPress website featured image caption is not showing in various posts, it can be a hassle to try and fix it.

In this guide, we’ll discuss five quick solutions to help you display the featured image on your website again.

Why is WordPress not displaying featured image captions? 

  • Your active theme does not support the featured image caption and needs additional CSS coding.
  • You have not placed the featured image caption correctly. 
  • A specific conflicting plugin is preventing your website from displaying the featured image caption. 
  • The browser cache is filled up with junk and corrupt temporary files.

How do I fix featured image caption not showing in WordPress?

Clear your browser cookies and cache data

Corrupted cookies or cache data of your browser can affect your WordPress website performance, due to which it might not display the picture caption. To resolve the issue, clear your Chrome browser cookies and cache data in the following way:

  • Open your Google browser and click on the three dots at the top right-hand side. 
  • From the menu, click on the More Tools option. 
  • Next, click on the Clear Browsing Data and set the Time Range from the drop-down menu. 
  • Make sure to tick the cookies and cache data boxes. 
  • Now, click on the Clear Data option. 
  • Open your WordPress website and see if the issue is resolved. 

Note: You will need to sign in to the platforms where you were previously logged in because clearing cookies will sign you out automatically. 

Deactivate the conflicting plugin 

Sometimes, certain plugin(s) create conflicts on your WordPress website or the WP theme. Such conflicting plugin(s) can affect how your website performs or displays featured images. To fix the issue, deactivate the plugin(s) in the following way.

  • Navigate to the Plugins option from your WordPress dashboard and click on the Installed Plugins. 
  • Next, click on the Active option to only see the activated plugins. 
  • From the Bulk Action menu, select the Deactivate option. 
  • Tick the box at the start of the plugins list and click on the Apply option to activate all the plugins. 
  • Refresh your WordPress admin dashboard and verify the fix.

Note: It might be impossible to know which plugin needs to be deactivated immediately. Therefore, try deactivating all the plugins and reactivating them one by one to see which plugin is creating the issue.

Deactivate the activated theme

Some WordPress themes, by default, do not support displaying the image caption. So, if you have activated a new theme, try deactivating it by following the steps below:

  • Use your hosting provider’s cPanel or FTP to access your WordPress Root Directory. 
  • Next, click on the wp-content folder and find the Themes folder. 
  • Now, look for the theme that you have activated on your website. 
  • Rename the activated Theme file and add .disabled or .hold
  • Your WordPress website will now use the default theme. 
  • Now, check if deactivating the theme worked in resolving the featured image caption issue. 

Use the featured image caption plugin

If you do not want to deactivate the theme, you can also use plugins specifically developed to help the users apply captions to their featured images. To do so:

  • Open your WordPress dashboard, and from the left-hand side menu, navigate to the Plugins option. 
  • Click on the Add New option, and from the keyword bar, search for the Featured image caption plugins
  • Choose the plugin that is most downloaded and click on the Install option. 
  • Now, click on the Activate option and head to Settings from the left-hand side menu. 
  • Under Settings, click on the activated plugin’s option and do the necessary settings. 
  • Finally, click on the Save Changes option. 
  • Open your WordPress website; your issue will be resolved. 

Add Additional CSS code 

Adding a CSS code can also help with resolving your problem. Follow the steps below to add the code lines:

  • From your WordPress dashboard, head over to the Appearance and click on the Customize option 
  • Next, scroll down to locate the Additional CSS option. 
  • Now, place the following lines of code:
<!-- wp:paragraph -->
<p><em>add_filter( 'post_thumbnail_html', 'custom_add_post_thumbnail_caption',10,5 );</em></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><em>function custom_add_post_thumbnail_caption($html, $post_id, $post_thumbnail_id, $size, $attr) {</em></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><em>&nbsp;&nbsp;&nbsp;&nbsp;if ( !$html == '' &amp;&amp; is_single() ) {</em></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><em>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Get Excerpt of thumbnail</em></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><em>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$thumbnail_image = get_posts(array('p' =&gt; $post_thumbnail_id, 'post_type' =&gt; 'attachment'));</em></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><em>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$thumbnail_caption = $thumbnail_image[0]-&gt;post_excerpt;</em></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><em>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if ( $thumbnail_caption ) {</em></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><em>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$html .= '&lt;div class="wp-caption thumb-caption"&gt;</em></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><em>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;p class="wp-caption-text thumb-caption-text"&gt;'. $thumbnail_caption .'&lt;/p&gt;</em></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><em>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/div&gt;';</em></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><em>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</em></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><em>&nbsp;&nbsp;&nbsp;&nbsp;}</em></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><em>&nbsp;&nbsp;&nbsp;&nbsp;return $html;</em></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><em>}</em></p>
<!-- /wp:paragraph -->
  • Finally, click on the Publish option to save the code. 
  • Now check your website and see if the issue is resolved. 

Add a caption correctly

Sometimes, the issue arises because you have not correctly placed the featured image caption. Place the caption in the following way:

  • Head over to the Posts option from your dashboard and click on Add New
  • On the new post page, create your post and click on the Settings icon. 
  • Next, scroll down a bit and select the Set Featured Image option.
  • Now upload the image or select it from the Media Library.
  • On the right side, you will see the Caption box, type the caption and click on the Set as Featured Image option. 
  • Finally, check your website and see if this fixes your issue.

Conclusion

This guide walked you through resolving the “WordPress Featured Image Caption Not Showing” issue. You should now have a properly functioning featured image caption if you followed the steps correctly. However, if you are still experiencing the problem, contact WordPress Support for further assistance.

Author

  • Tauqeer Ahmed

    Tauqeer Ahmed is a technology expert with over 10 years of experience in the industry. He has a degree in Computer Science and specializes in network security and software troubleshooting. You can find out more about him at https://helpfixthat.com/tauqeer-ahmed/

Leave a comment

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