How To Disable Comments In WordPress? (4 Ways)

how to disable comments on your website
Share

You wish to know how to disable comments In WordPress? As your site grows, you can receive hundreds of spam comments every day. Moderating so many comments to approve only a handful of genuine ones is not an easy task.

Eventually, every Webmaster tries to search how to disable comments in WordPress?
That is what we will answer today. Before that, however, we will help you understand why it makes sense to disable comments in WordPress.

Why should you disable comments in WordPress?
The reasons why you should disable comments in WordPress include:

1. Spam

If your site allows visitors to submit comments, you will receive hundreds, perhaps thousands of comments every day. The larger your site, the more comments you will receive. To avoid moderating so many comments, it is a much better idea to disable comments in WordPress altogether.

2. Security issues

Many of the commenters leave dangerous links that can lead to viruses, Trojans, and so on. When you try to moderate such comments, you will have to visit these links. That is why these comments can, in turn become a security risk.
The best way out is to disable comments altogether.

3. No need for comments

WordPress allows you to create an e-commerce store and professional corporate websites. Both these types of sites do not need any comments. If you are creating such a website, it is a good idea to disable the comments altogether.

4. Ability to have discussions:

You can easily create a community, a membership website, or even a forum with WordPress. In that case, providing the ability to the users to comment will be redundant. That is why; you have to avoid doing so.

These are the cases where it does not make sense to enable comments on your WordPress website.

Now that you are aware of why you might want to disable comments, let us look at different methods.

How To Disable Comments In WordPress?

To disable comments in WordPress, there are quite a few methods. We will cover 4 such methods so that you can choose between them.

Method 1: disable manually:

The first method is one in which you disable the comments manually. They will be disabled across all the posts and pages.

Step 1: navigate to all posts

Once you login to the WordPress dashboard, you have to click posts from the sidebar and click on all posts. That will display all the posts on your WordPress site.

Step 2: select all posts

Above posts, you will see the checkbox in the upper left corner of the table. You have to tick that, and after that, select edit from the bulk actions menu.

Step 3: choose to not allow comments:

Then, you will be able to view the comments section, and in the drop-down menu, you will be able to select the do not allow option. Once you do so, you have to click update.
Since you have selected all the posts from the drop-down menu in the first step, this will disable comments across all the posts.

Method 2: Disable comments using plugin:

This is the easiest way to disable comments in WordPress, In case, you do not want to disable comments in WordPress manually, you can do so by installing the right plug-in.

Step 1: Search for the right plugin:

After logging in to your WordPress dashboard, you have to click plug-ins from the sidebar and click on add new. In the right corner, you will have a search box in which you have to search for a plug-in that goes by the name of Disable comments, there are many plugins for such task, for example, this plugin.

Step 2: Install the plugin:

Initially, you will see the install option. Once you click it, the same button will be activated after a few minutes. After that, you have to click activate.

Step 3: go to the plug-in settings:

From the sidebar, you have to click on the Settings option and after that disable comments. It will take you through the settings of the plug-in. There you will get the option to disable comments and delete older comments. You can select the respective options to achieve the same.

Thus, if you do not want to disable the comments or delete the older comments manually, this method is best for you.

Method 3: Disable with custom code:

There is also an option to add a custom code to your WordPress website to disable the comments.
Wondering how to do so?
We will share with you the step-by-step procedure below.

Step 1: Go to theme editor:

You have to 1st click on the appearance option from the sidebar and then click on theme editor.

Step 2: Choose page.php:

After that, you will get a list of PHP files on the right side. From that list, you have to select page.php.

Step 3: Search and replace the code:

Once you select page.php, you can view the PHP code in the box at the center of the page. The code is pretty lengthy, and therefore you have to use the find option in your browser to find the code that we will highlight below.

<?php comments_template( ”, true ); ?>

You have to replace this code with;

<!– Begin Comment

<?php comments_template( ”, true );

?> End Comment →

Step 4: Click update file:

Then, you have to click the update button below the main box.
Since this method requires you to edit the code, it is always good to take a full site backup before you use this method to disable the comments on your WordPress website.

Method 4: Disable comments on media:

Did you know that visitors can comment on your media files as well?
When you’re planning to disable the comments, it is a good idea to disable them on the media files as well. The procedure to do so is as follows:

Step 1: Go to theme editor:

Select the appearance option from the sidebar and the theme editor. That will provide you access to all the PHP files of the theme.

Step 2: Select functions.php:

After that, you have to select the functions.php file from the right-hand side list of files.

Step 3: Add code to the file:

function disable_media_comment( $open, $post_id ) {

$post = get_post( $post_id );

if( $post->post_type == ‘attachment’ ) {

return false;

}

return $open;

}

add_filter( ‘comments_open’, ‘disable_media_comment’, 10 , 2 );

Step 4: Update the file:

Click on the update file.
Once again, since this method involves editing the PHP files, it is good to take a backup of your site before you make these changes. If anything goes wrong, you can restore the backup, and your site will still be working fine.

How to disable comments in wordpress for future posts?

Step 1: Go to the discussion:

You have to select the settings option from the sidebar and then discussion.

Step 2: Deselect comments option:

After that, you will be able to view the default post settings section. You have to deselect the option to allow people to submit comments on new posts.
Once you deselect that, all the future posts won’t show the comment form to the visitors.

Step 3: Click apply:

This setting is only activated when you click apply at the bottom.

How do I disable comments on one post in WordPress?

Methods that we have highlighted until now will help you disable comments or multiple posts at once. It can be past posts or future posts.
The question arises, what if you have to only disable comments for one particular post or page?
In that case, you have to adopt a different method that we will highlight below.
This is a discussion on the actions of a particularly controversial post.

Step 1: Visit the posts list

Once you log in to WordPress, select posts and then all posts.

Step 2: Select the edit option

You have to look if the post comments are on or off. Below the title, you will be able to view the edit option. Click that.

Step 3: inspect the right inside bar

Once the next page loads up, the right-hand sidebar will have the option to allow comments. Deselect that option.

Step 4 click publish:

After that, you have to just click the publish button.
That’s it!
You have to separate comments for that particular post.
Now that you know all the available methods to disable WordPress comments, we will answer some FAQs regarding the same.

Are these methods applicable on any wordpress version?

Yes, they apply to any version of WordPress. Sure enough, the placement of some of these options might be a bit different depending on the WordPress version that you are running. Still, you can easily improvise the steps above and disable comments in WordPress irrespective of the version.

Can you disable WordPress comments from Cpanel?

No, to disable the comments, you will have to log in to WordPress. There is no way to do the same through cPanel.

What happens if I never approve comments?

If you do not approve the WordPress comments, they will remain in the pending approval state. They won’t go live.

Conclusion:

It is not difficult to disable comments in WordPress once you follow the steps and the guide above. You can do so within a couple of minutes. It’s now time to take control of your WordPress website and offer the visitors only the features and the discussion options you want them to have.

We hope this tutorial regarding how to disable comments in WordPress was helpful, feel free to ask anything in the comments.

Leave a Comment

Your email address will not be published.

Scroll to Top