How to Completely Disable Comments in WordPress

Home Tutorial How to Completely Disable Comments in WordPress

Getting some spam comments lately? Don’t want people commenting irrelevant comments? Why not disable comments instead?

We know that comments enable powerful conversations around your website’s niche. But still, there are some webmasters who prefer to avoid enabling comments on their websites.

On WordPress, it is fairly easy to remove comments. Because of its open-source nature, not only can you disable comments for your entire website but also remove comments from specific posts and pages.

In this article, we’re going to show just how you can do that.

Reasons for Disabling Comments

  • Owners that don’t have a blog section on their website might not be inclined to have a comments section.
  • Bloggers might have faced some issues with spam trolls before, or they might not want comments on their news articles or other site-specific pages.
  • Business blogs and eCommerce stores might want to prevent spam comments on their products or articles, which is why they decide to disable comments.

Besides these, there are plenty of reasons why you would want to disable WordPress comments. Whatever your reason may be, in this article, you would find several ways on how you can disable comments on your store. So, without further ado, let’s begin.

Disable Comments on Future Posts

For future website posts, you can stop comments by navigating to Settings > Discussion on your WordPress dashboard.

Discussion

Here you will find a checkbox that says, “Allow people to post comments on new articles.” Uncheck it and Save Changes to disable any future comments.

Disable Comments on a Specific Page or Post

If you want to disable comments on a specific page, here is how you can go about doing it:

First off, navigate to Pages > All Pages. Once there, hover over to the page on which you want to disable comments and click on Edit.

2

At the top of the edit screen, you will see a dropdown menu. Click on it and go to Options.

This will prompt you to open a pop-up box. Ensure that the Discussion box is enabled.

3

Once the modal box is closed, you will see the Discussion enabled on the right side of the editor. If you don’t see it, go to the Document tab to enable it.

4

From within the Discussion tab, check on Allow Comments and click on Update to save changes.

Disable Comments on Pages and Posts in Bulk

Disabling comments in Bulk is a simple process. First off, you need to visit your Dashboard, and from there, click on Posts > All Posts.

Within the posts section, select all the posts and from there, click on Edit from the Bulk Actions dropdown and click on Apply.

5

You can now perform bulk actions on your posts, one of which is changing the comments.

From the comment dropdown, select Do Not Allow and click on Update. This will disable all the comments on your posts.

6

The same procedure can be applied to your page comments.

Delete All WordPress Comments

The methods we’ve mentioned above are meant to disable all future comments on your website. This does not mean that it’s going to delete comments that are already present.

For that, you need to navigate to Comments. Once there, select all the comments on your site and delete them through the bulk action toolbar.

7

Disable Comments on Media

Comments on media pages can be disabled using two methods:

Individually deleting the comments can be very time-consuming. To avoid going through such a lengthy process, you can either use a code-snippet or a plugin. For the former, you need to add the following code to your functions.php file.

Note: Before you start the code-insertion processes, you need to ensure that you have a backup of your site in the event things go wrong. Additionally, having a developer at your behest can prove very useful.

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

For an easier solution, read on the following section.

Disable WordPress Comments Through a Plugin

Using the Disable Comments plugin, you can disable WordPress comments with just a click of a button.

The plugin not only allows you to disable comments on your entire website, but also allows you to disable specific post types like posts, pages, and media files.

8

Once the plugin has been installed, head on over to Settings > Disable Comments.

Select the disabling settings you want to add to your website and voila, you’re done!

9

Disable the “Comments Are Closed” Section on your WordPress Interface

After deleting the comments one way or another, you might notice that your WordPress theme fails to respond to the changes. In effect, it shows the comments as they are or shows a “Comments are closed” message.

To remove it, you will have to go “under the hood,” so to speak and remove the code that displays the message.

For that, you can either employ the services of a WordPress developer or follow the steps below.

Note: Before you start this process, make sure to have a backup of your WordPress installation in the event things go wrong.

  • Connect your WordPress site to FTP through your WordPress cPanel.
  • Visit your themes folder at /wp-content/themes/folder.
  • Within the theme folder, navigate to the comments.php folder and rename it to comments_old.php.

10

Now, right-click and select Create a new file. Now, name your file as comments.php, and click OK.

11

How to Protect Your Site from Spam

If security is the reason why you want to disable WordPress comments, then don’t fret. To ensure that your site is secure from spam commenters and link builders, it’s recommended that you use the following techniques.

Akismet

12

This plugin is by far the best anti-spam plugin in the market. Built by Automattic, the company that builds and maintains WordPress, this plugin has everything you need to avoid spam comments.

It analyzes all the comments on your site and dutifully verifies which one is spam and which is not. The best part, this plugin comes pre-installed with every new WordPress version.

Closing Comments

If you want comments to disappear after a particular time period, you can do it by visiting Settings > Discussion from your WordPress dashboard.

13

In the third checkbox of Other comment settings, you can select the number of days a comment can exist on your website.

Honeypot with Antispam Bee

Another plugin that comes in really useful against spamming is Antispam Bee, which promises to block 99% of spam comments.

Remove Website URL Form Field

You can also reduce spam by removing the email field from your WordPress comment form. Here is what the general comment form looks like:

14

A plugin, aptly titled Comment Link Remove and Comments Tool helps you fulfill that purpose. Allowing you to remove the website URL field entirely without touching a single line of code, this plugin can prove rather useful in removing shoddy emails from your website.

Conclusion

Spam comments are a real bother to deal with, and spammers are the worst of them all. Troll comments, irrelevant link building, and obscene comments are all various types of spam comments that need to be dealt with.

Having them around for too long can prove disastrous in the long-term for a business’s website performance both internally and externally. Google, upon seeing such shady links, will start blacklisting your operations, and in time, your customers will start to notice this and blacklist you as well.

Read Also

Leave a Comment

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