How to Hide Comments in the Listing Gallery

By default the users can add comments and also display comments count within the images of the listing gallery.

Using WordPress comments can be turned off in the individual pages via the screen options, but this does not work within the listing gallery hence the reason to add this workaround.

This can be hidden with custom CSS for users who do not wish to show comments in the listing gallery.

Hide Comments Section

To hide the comment section displayed below the image preview, please use this custom CSS code:

.gallery-comments.widget {
    display: none;

Hide Comments Count Section

To hide the comments count section kindly add this custom CSS code:

.content-single-job_listing-gallery-wrapper article.type-attachment .comment-count a { 
display: none; 

You can add these two CSS codes in your child’s theme style.css file for them not to be affected by a future theme update.

Hide Comments section using Theme Customizer settings.

If you wish to hide the comments within your gallery section using the theme settings under default WordPress customizer please follow these steps:

  • Proceed to WordPress Admin > Appearance > Customizer.
  • In the customizer options go to Listings > Labels & Behaviour.
  • On the left bottom, section ensure that you have disabled the option to Allow comments on gallery images

By doing so your listing gallery will not have any comments in while users are viewing them.

Was this article helpful?

Related Articles