• Home
  • About
  • Contact
  • DMCA
  • Privacy
  • Terms
  • Write For Us
famous themes
  • Themes
  • Plugins
  • Apps
  • Graphics
  • E-commerce
    • Business
    • Marketing
  • Academy
  • Hosting
  • WordPress
  • Blog
No Result
View All Result
famous themes
  • Themes
  • Plugins
  • Apps
  • Graphics
  • E-commerce
    • Business
    • Marketing
  • Academy
  • Hosting
  • WordPress
  • Blog
No Result
View All Result
famous themes
No Result
View All Result

How to Easily Disable Comments on Media Attachments in WordPress

admin by admin
August 7, 2024
in Blog
0
How to Easily Disable Comments on Media Attachments in WordPress
0
SHARES
0
VIEWS
Share on FacebookShare on Twitter

The comment section on WordPress lets visitors talk to you and each other. But sometimes, you might not want comments everywhere on your site. Maybe you want to stop comments on pictures and other media attachments in WordPress.

Not everything needs a comment box.

In this guide, I’ll show you how to remove the comment box from media attachments and different types of posts in WordPress.

You can turn off all comments in the “General” settings, but this stops comments on everything. Maybe you just want to stop comments on images.

Why Have Comments at All?

Comments help you connect with your visitors. They make your website more fun and engaging. Comments can make people stay longer, come back more often, and even turn visitors into customers.

You can add tools to make comments even more interactive.

Worried about spam in the comments? Don’t be. WordPress has many ways to stop spam from becoming a problem.

Disable Comments Using WP Plugin

Today, I’ll show you what the “Disable Comments – Remove Comments & Stop Spam [Multi-Site Support]” plugin can do for you. It’s an easy plugin that allows you to turn off comments in WordPress according to section.

It’s perhaps one of the most popular disable comments plugins for WordPress. With over one million active installs and an excellent review score, it appears many treasure this tool.

However, depending on how you have media attachments set up on your website, it might not be exactly what you’re looking for. If this is the case, I’ll also include a code snippet later on that you might find useful instead.

Install and activate the “Disable Comments” plugin. You’ll see a couple of plugins with a similar name. Use the one by, “WPDeveloper.”

Go to Plugin > settings and click,

You’ll have two options available from this disable comments plugin in WordPress. You can turn off all comments by clicking “Everywhere,” or you can choose which post types by clicking the box.

Click the “Save Changes” button.

Disable Comments by Adding a Code Snippet

Although this plugin works exceptionally well, perhaps you want to add a snippet of code instead.

For this, you’ll need to insert coding into the site’s functions.php file or a site-specific plugin you have installed. For this tutorial, I’m simply going to add it to the functions.php file.

NOTE: It’s probably a good idea to use a child theme when making adjustments like this. You don’t want to add the code to disable comments on media attachments in WordPress only to have an update erase it.

Edit the functions.php file of your website. You can do this in several ways such as an FTP program like FileZilla, cPanel’s File Manager, or other methods that let you access the site’s root directory.

Add this code to the file

Code
function filter_media_comment_status( $open, $post_id ) {
$post = get_post( $post_id );
if( $post->post_type == ‘attachment’ ) {
return false;
} return $open;
}
add_filter( ‘comments_open’, ‘filter_media_comment_status’, 10, 2 );

Note: if the code does not work kindly. improve it using chatgpt.com

In this example, I am using cPanel’s File Manager.

You can find the file by going to the “/wp-content/themes/” section of your site. Open the folder of the theme you’re using and edit the functions.php file.

Once you save the file, WordPress will turn off comments on media attachments throughout the website.

Not Everything Needs a Comment Section

You don’t need a comment section everywhere on your website. Sometimes, things like videos or images don’t need comments.

It’s easy to turn off comments on images and other attachments in WordPress. It depends on how you have your files saved and what you show to visitors.

How often do visitors leave comments on your site? Do you think having an interactive comment section makes people come back to your site more often?

Tags: attachmentscommentsmedia
Previous Post

10 Effective studying techniques for retaining new information

Please login to join discussion

Recent

  • How to Easily Disable Comments on Media Attachments in WordPress
  • 10 Effective studying techniques for retaining new information
  • Using online resources and MOOCs (massive open online courses) to learn new skills
  • Best Practices for Shipping and Fulfillment for an eCommerce Business
  • The Impact of Social Media Influencers on E-Commerce
  • Strategies for Handling Returns and Customer Complaints
  • How to Use Social Media to Drive Traffic to an Online Store
  • The future of web hosting and emerging technologies such as edge computing and 5G networks
  • The Pros and Cons of Using a Dedicated Server for Hosting
  • The Benefits of Using Cloud Hosting versus Traditional Hosting Options

Welcome to famousthemes.net! We provide a range of high-quality and creative website themes that are perfect for individuals, businesses, and organizations to build the websites they deserve.  Read More. . .

Categories

  • Academy
  • Apps and software
  • Blog
  • Business
  • E-commerce
  • Graphics
  • Hosting
  • Marketing
  • Plugins
  • Tech
  • Themes
  • Wordpress

Recent Articles

  • How to Easily Disable Comments on Media Attachments in WordPress
  • 10 Effective studying techniques for retaining new information
  • Home
  • About
  • Contact
  • DMCA
  • Privacy
  • Terms
  • Write For Us

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

No Result
View All Result
  • Themes
  • Plugins
  • Apps
  • Graphics
  • E-commerce
    • Business
    • Marketing
  • Academy
  • Hosting
  • WordPress
  • Blog

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.