by admin
December 20, 2021

How to disable comments in WordPress completely (The detailed guide)

Comments can improve a blog in a variety of ways, such as they turn a monolog into a conversation and foster community. Besides, because search engines index comments as well, they can be a good factor to boost SEO. However, it also comes with some drawbacks, mostly because comments may be self-promotional, spammy, and even harmful at times. With this reason, in this article, Arrowtheme will let you know the main reason you need to wordpress disable comments and how to disable them completely. Then, explore with us right now! 

Moreover, in case you want to work with a reliable WordPress provider, let’s refer to WordPress Website Packages of Arrowtheme. In particular, we are having a shock discount upto 30% program for all of our WordPress services. For more details, let’s CONTACT US to get a free consultancy.

Key reasons you have to WordPress disable comments 

For disabling comments on your entire website or turning off comments on individual posts or pages, there are a variety of reasons. For instance, bloggers may choose not to allow comments on specific postings, such as announcements. They can easily block comments on certain specific posts or pages in these circumstances. 

What’s more, WordPress is widely used by many small company owners to build their websites. Typically, these websites frequently lack a blog and instead focus on static pages such as Services, About us, Contact us, and so on. This is the reason why allowing comments in such situations is pointless. 

Not only that, another equally common problem is that some business sites disable comments entirely in order to avoid spam.  Although you can always utilize spam prevention tactics, disabling comments will almost certainly eliminate this painful problem. Whatever your reason, you may disable comments and even delete the comment section entirely from your WordPress site.

How to disable comments in WordPress on future posts?

You may quickly wordpress disable comments on future posts as soon as you create your WordPress blog. Just need to go to Settings >> Discussion in your WordPress admin panel’s left sidebar to accomplish this. Then, you must uncheck the option: “Allow people to post comments on new articles” on this page, and don’t forget to click the Save Changes button to complete. 

Wordpress disable comments

After doing it, all future comments on your posts will be disabled. However, you can still enable or wordpress disable comments on a single article without making any changes to this setting. 

How to disable comments on a specific post/ page?

In fact, comments are disabled by default on all of your pages. On the other hand, WordPress still allows you to enable or disable comments on particular pages and articles. In order to do this, from the left sidebar, you have to navigate to Pages >> All Pages. After that, on the following page, you must hover your mouse cursor over the title of the page you wish to enable or disable comments on. And then, let’s click the Edit option.

how to WordPress disable comments

Now, you are able to see the three vertical dots icon in the top-right corner of your page. All you have to do is to click on it to bring up a dropdown menu, then select Options. Besides, this will bring up a popup box, and you must ensure to allow the Discussion box.

way to disable comments in wordpress

Then, you will see the Discussion meta box on the right side of your editor after you shut this modal box. However, in case you don’t see it, you must make sure you’re viewing it in the Document tab.

allow comments

After that, in order to wordpress disable comments on this page, you have to uncheck the Allow Comments box and click Update. However, in case you wish to enable comments for specific pages only, you can just click the box. 

Way to wordpress disable comments on pages/ posts in bulk

To begin, you must navigate Posts >> All Posts in order to see all your articles.

After that, let’s select all of the posts, then click the Apply button after choosing Edit from the Bulk Actions drop down box. 

Way to wordpress disable comments on pages/ posts in bulk

You can now execute bulk actions on all of the selected posts, such as altering the author name and turning off comments. Then, you must click Update after selecting Do not allow from the comments menu box. As a result, this will turn off comments on all of the posts you have chosen. 

Do not allow

How can you delete all WordPress comments? 

First of all, you must click Comments on the left sidebar of your admin panel if you want to delete all of the comments on your wordpress website.

How can you delete all WordPress comments?

After that, you have to select all of the comments and select Move to Trash from the Bulk Actions menu box before clicking the Apply button. As a result, your site’s existing comments will be completely deleted. Moreover, if your website has a large number of comments, you may need to repeat this process several times.

Disable comments on Media

If you want to deactivate comments on media pages, you can do so in one of two methods. 

The first one is you can deactivate comments on each media attachment file manually using the methods described above. However, this can be time-consuming. 

On the other hand, you can take advantage of a code snippet that is an easier approach to deactivate comments on all media assets in bulk. Following that, you just need to simply insert the code below into the functions.php file of your theme or a site-specific plugin. 

1   function filter_media_comment_status( $open, $post_id ) {

2            $post = get_post( $post_id );

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

4                  return false;

5             }

6             return $open; 

7     }

8     add_filter( ‘comments_open’, ‘filter_media_comment_status’, 10 , 2 );

How to disable WordPress comments by using a plugin?

Plugin enables you to disable all comments on your WordPress site. Besides, you can turn them off for specific sorts of posts, such as posts, pages, and media. Not only that, it also hides the comment form and hides the comments that have already been posted. For more details, the Disable Comments plugin is the first thing you will need to install and activate. To begin, you have to go to Settings >> Disable Comments on your admin panel’s left sidebar after enabling the plugin. In particular, you can deactivate comments throughout your entire WordPress website by using the “Everywhere” option. What’s more, the comments menu item will be removed from the WordPress admin area as well thanks to this plugin. 

Additionally, you can selectively disable comments on your posts, pages, or media by choosing the second option of “On Specific Post Types”. 

How to wordpress disable comments by using a plugin?

Now, let’s refer to this example. If you simply want to remove comments from media attachments, you just need to tick the Media checkbox and then pick On Specific Post Types radio button. Best of all, disabling comments on WordPress pages is as simple as installing the plugin. Finally, you just need to simply click Save Changes to finish.

How to wordpress disable comments through custom code?

You can use custom code instead of either of the above alternatives if neither of them provides enough control, or if you want more options but don’t want to add another plugin to your site. Although what you can achieve with this method will be limited by your technical knowledge and expertise, disabling your site’s comments section is rather simple. Then, by using some basic HTML commands, you may completely eliminate the comments section from your WordPress theme. You must bear in mind that altering the source code of your WordPress theme is hazardous. More importantly, if you do incorrectly, it can ruin your website. 

Moreover, if you want to try this strategy out for yourself, you must make sure to test it out first in a staging environment and always back up your production website before going live. Now, with your favorite HTML editor, you have to open your page.php file and look for the following piece of code: 

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

Then, let’s go ahead and then replace it with this line of code as below:  

<!– Begin Comment

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

End Comment –>

This will disable the comments section on all pages of your wordpress website, deleting any existing comments and preventing new ones from being submitted. Then, you have to find and copy the following code into your single.php file: 

<?php comments_template(); ?> 

After that, all you need to do is replace it with this following code:

<!– Begin Comment

<?php comments_template(); ?>

End Comment –>

After that, you will be able to disable WordPress comments on both your posts and pages. More importantly, you must keep in mind that you will have to repeat this step if you need to add other post types. 

How to wordpress disable comments through custom code?

How to remove “Comments Are Closed” in WordPress?

If your WordPress theme does not properly check the comment status, it may continue to display the comment form, existing comments, or even the notice “Comments are closed”. However, if you don’t like this, you can ask your theme developer to fix it. Best of all, you can also try to fix it yourself by following the steps below.

To begin, you have to utilize an FTP client or the File Manager in your WordPress hosting control panel to connect to your WordPress website. Then, let’s go to your current theme folder, which is located in the /wp-content/themes/ folder.

After that, you must locate the file comments.php in your theme folder, right-click it, and then rename it to comments old.php. 

disable comments through custom code

Then, on the right panel of your FTP client, you must right-click and choose Create new file from the menu. After that, let’s click the OK button and name your new file comments.php

In fact, this method simply adds an empty comments template to your WordPress theme, preventing any comments or related messages from appearing. However, if your WordPress theme lacks the comments.php file, you must ask your theme developer which file you need to modify. 

Techniques to protect spam

If you want to safeguard your WordPress website against spammers and link builders by disabling WordPress comments, you can take advantage of the approaches below.

1. Akismet plugin

In terms of protecting spam, one of the greatest plugins for dealing with it is Akismet that was created by WordPress. Basically, this plugin examines each remark on your site and determines whether or not it is spam. 

2. Closing comments

To begin, you must go to the Settings >> Discussion section and check the box next to “Automatically close comments on articles older than 14 days”.

Then, the comments form will be automatically closed after 14 days. However, you also are able to alter the amount of days according to your need. Moreover, because spammers frequently target older postings, some users have changed this setting to 180 days, which has considerably reduced spam. 

Techniques to protect spam

3. Honeypot with Antispam Bee

Using a second plugin called Antispam Bee in conjunction with Akismet will help to drastically minimize comment spam on your WordPress website. It also includes an unnoticed honeypot that filters out 99% spam bot comments. 

4. Comment Captcha

Adding a captcha to your comment form isn’t particularly user-friendly, but it will assist to safeguard your WordPress website from spammers. Besides, to add Google reCaptcha directly before the submit button of your comment form, you can utilize the Advanced noCaptcha and Invisible Captcha plugins. 

5. Remove Website URL Form Field

Remove the website URL field from the comment form as another measure to combat link builders and spammers. You can also use the Comment Link Remove and Comments Tool plugins to accomplish this. Alternatively, without modifying a single line of code, you can remove the website URL box from your comment form. 

6. Blocking Bad IPs

Bad IP addresses can also be blocked from accessing your WordPress site. As a result, this will assist you in thwarting spammers and hacker attempts. 

In conclusion

To sum up, in many cases, you may want to encourage users to your website to ask questions and initiate conversations with one another. However, you may wish to wordpress disable comments in order to avoid spamming content or enhance efficiency. While smaller websites can easily manage comments by modifying WordPress settings or installing a plugin, content-heavy websites frequently select third-party solutions. All in all, our article instructs you in detail how to disable comments in WordPress. In case you have any questions on this topic, you can let us know and we will contact you as soon as possible.

Related Posts