Comments aren't for everybody. On the one hand, they can be an effective way to engage visitors and build a community on your WordPress site. But a comments section can also be a breeding ground for trolls, spam, and links to malware.

Want to disable comments on your site? In this post, I'll show you how...

Disabling Comments on a Specific Page or Post

Let's start with disabling comments on a particular page or post, rather than your whole site.

On the left sidebar of your WordPress dashboard, open the "Pages" or "Posts" tab.

how to disable comments on wp

Select "All Pages", then click on the "Edit" option next to the page/post you want. The next steps of this process depend on whether you're using the Gutenberg editor or the classic editor.

 

Using the Gutenberg Editor

disable comments on wp pages

After you open the post, you'll see a sidebar on the right side of your screen. Open the "Discussion" section, and uncheck "Allow Comments". That's it, you're done!

 

Using the Classic Editor

With the classic editor, click on the vertical three dots icon in the top-right corner of your screen after you open the post. From the dropdown menu, select "Options", and check the box for "Discussion" in the "Document Panels" section.

Disable comments, classic editor

 

Now, you should be able to see the "Discussion" section in your editor (if not, you can get there from the "Document" tab). All you need to do at this point is uncheck the box next to "Allow Comments".

 

Disabling Comments on Pages or Posts in Bulk

Maybe you want to disable comments on more than one page or post.

To do so, you'll first need to go to "Posts" or "Pages" from your dashboard and select the pages/posts you want. Then, open the "Bulk Actions" dropdown menu, select the "Edit" option, and click on the "Apply" button.

disable comments on wp

You'll see another dropdown menu next to "Comments". Select "Do Not Allow" to finish the process.

 

Disabling Comments on a New WordPress Site

If you're just now setting up your site, disabling comments is easy. Open the "Settings" tab from the left sidebar, and select "Discussion". Then, simply uncheck the box next to "Allow people to post comments on new articles" and save your changes.

 

Delete All WordPress Comments

In addition to blocking future comments, you may be interested in removing existing comments as well.

From your dashboard, open the "Comments" tab. Then select some or all of your comments, open the "Bulk Actions" dropdown menu, and use the "Move to Trash" option to get rid of those comments.

delete bulk comments

 

Disabling Comments on Media

You can use the disabling methods mentioned previously in this article to disable comments on media, but that would need to be done manually and could take quite a bit of time.

To disable comments on media in bulk, plug the code below into the functions.php file of your WordPress theme:

1
2
3
4
5
6
7
8
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 );

 

Disabling Comments with a Plugin

It's not hard to disable comments through the standard WordPress interface, but a plugin always makes things easier.

Specifically, I would recommend the "Disable Comments" plugin.

[button-red url="https://wordpress.org/plugins/disable-comments/" target="_blank" position=""]More Info and Download[/button-red]

Once the plugin is installed and activated, go to “Settings > Disable Comments” from your dashboard. You can disable comments everywhere, or you can disable comments only on certain post types:

 

Removing The ‘Comments Are Closed’ Message

After you disable comments, your site might automatically display a "comments are closed" message.

To get rid of this, connect to your WordPress site using an FTP client. Open the current theme folder, which is in "/wp-content/themes/". Find the file called "comments.php" and rename it to "comments_old.php". After that, create a new file and name it "comments.php" - this will remove the message.

If your theme doesn't have a "comments.php" file, contact the theme's developer and ask them which file you need to edit to solve this problem.

Originally published Jun 5, 2019 7:33:54 PM, updated October 16 2019