How to Disable Comments in WordPress

WordPress is (obviously) an awesome solution for building websites. While some people still associate it with blogging, there are a hundred other ways you can build and customize a WordPress site. And if you’re building a business site, a common change you’ll probably want to make is to disable comments in WordPress.  

If you’re setting up a blog, having comments turned on is great for engaging your site visitors! And WordPress makes it super easy because that feature is built into the CRM automatically. But if you’re looking to utilize WordPress for your portfolio site or a client’s business, you probably shouldn’t allow comments on every page.

[article_callout]

Luckily, it’s pretty easy to halt the discussion, before and after it begins. Here are a few ways to disable comments in WordPress: 

[/article_callout]


Why Should you Care About Comments? 

Comments on a post or page may not seem like a major concern, but they can be. While they’re great for engaging site visitors in discussion, it’s important to make sure those discussions are happening in the right way in the right place. That’s why you should always monitor comments (both good and bad!) on your pages and posts, or disable them altogether. 

Additionally, pingbacks, trackbacks, and spam comments can be really tedious to monitor. By disabling comments on the pages that don’t need them, you’ll cut down the amount of maintenance you need to do on your site.

How to Disable Comments for Future Posts

 If you’re just starting your WordPress site (or are tired of running into issues on new content), this step is helpful for disabling comments on new posts/pages sitewide.  

To do this, go to Settings > Discussion on the left side panel of wp-admin. On this page, you’ll find a bunch of options related to comments on your site. 

Uncheck the option that says “Allow people to post comments on new articles” and then click on the “Save Changes” button to store your settings.

Image of Discussion settings. There are 3 listed out, but the 2 that are checked are "Allow link notifications from other blogs (pingbacks and trackbacks) on new articles" and "Allow people to post comments on new articles"
The “Discussion Settings” page where you’ll find the checkbox to disable comments on new posts.

This will disable comments on all future posts. If you want to disable or remove comments on an existing post, see the next section.

How to Disable Comments on a Single Post or Page

If you want some posts or pages on your site to have comments, but not others, you can easily disable comments on a case-by-case basis. 

I’ll start with Pages. Head over to Pages > All Pages on the left sidebar. Hover over the page you want to disable comments on and select Edit.

On the right-hand side in the Document settings, look for Discussion and un-select Allow comments. 

Example of a Hello World WordPress post
In the Document settings, look for Discussion and un-select “Allow comments”.

Hit save, and then view the page. The comments section should now be hidden, regardless if you had previous comments there or not. 

The process is the same for posts. Just go to Posts > All Posts on the left sidebar and follow the same steps as above. 

How to Disable Comments on Multiple Posts and Pages

If you have multiple posts or pages that you want to disable comments on, you can actually do that in bulk instead of one at a time. 

Go to Posts > All posts.

Select the checkbox for the posts you want to disable comments on. In the Bulk Actions dropdown at the top of the page, choose Edit and click on Apply. 

Screenshot of settings in the posts tab.
In the Bulk Actions dropdown, choose “edit” and click on “apply” to see this page.

Pro-tip: With this method, you can perform several actions in bulk, such as changing an author, the post status, format, etc.

Select Do not allow from the Comments dropdown and click Update. This will disable comments for all selected posts, meaning no new comments can be made and any existing comments will be hidden. 

The same process applies for disabling comments on Pages.

How to Disable Comments on Media

If you’re looking to disable comments on WordPress media pages, there are two ways to go about it:

  1. You can add a code snippet to your site
  2. You can use a WordPress plugin

Note: You should never make changes like this to your live site. I recommend using a staging site or local environment for proper testing. If you don’t have one set up yet, Local is a free solution for Mac, Windows, and Linux machines.

If you want to go the code route, simply paste the following snippet in your theme’s functions.php file.

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 );

That will globally disable comments on all media files you upload to your WordPress site. Then, you’ll never have to worry about it again! 

If you want to use a WordPress plugin, see the next section for my recommendations. 

How to Disable Comments Using a Plugin

As you probably know, WordPress allows you to do most things manually or you can always install a plugin for more functionality! 

An awesome option for this scenario is Disable Comments. This WordPress plugin gives you the ability to disable all comments, including any on past posts.

Once you install Disable Comments, you’ll see a new option in your Settings dropdown.

Go to Settings > Disable Comments.

Now you can quickly disable all comments on posts, pages, and media, including any past comments. If you’re dealing with a large site with lots of posts and pages, this is a great solution to avoid manually editing every single page.

A couple other plugin options for disabling comments in WordPress include: 

Conclusion

Disabling comments can seem like a hassle, but WordPress makes it super easy to disable comments in different ways. No matter if you’re disabling comments for your client’s website or your own blog post, I hope this tutorial helps you in your WordPress journey!

Get started.

Build faster, protect your brand, and grow your business with a WordPress platform built to power remarkable online experiences.