How To Disable Comments on WordPress – 3 Easy Methods

wordpress disable comments

If you are looking at how to disable WordPress comments, we’ve got you covered. Comments are an integral part of the WordPress experience. It’s a way for your site visitors to give their thoughts on your content and engage them to interact with the site. Search engines index the comments as well, so they can slightly improve your SEO.

So why are we exploring different ways to disable them? Good question. The answer – comments can be problematic or simply unnecessary. For example, you don’t need comments on your ‘About’ or ‘Contact Us’ page. Some other undesirable aspects can be spam, trolls, phishing attempts, self-promotion, etc.

The good news is that you can disable WordPress comments easily and even partially if necessary. For instance, you can choose to disable comments on pages, posts, attachments, custom post types, or even just a selected few pages or posts. Depending on what you want to achieve, you can use different approaches.

Spam Management in WordPress: A Crucial Aspect of Site Management

In the digital world of WordPress, managing spam is a pivotal aspect of maintaining a healthy and engaging website. Spam comments, often irrelevant or promotional in nature, can clutter your site, detract from the user experience, and even harm your site’s credibility.

One effective method to combat this issue is by disabling comments entirely. This approach is particularly useful for websites where comments do not add significant value or for specific pages where interaction is not necessary. By turning off comments, you automatically shut down a common avenue for spam, ensuring a cleaner and more professional website environment.

However, completely disabling comments might not be feasible for every site, especially those that rely on user interaction. In such cases, it’s vital to implement robust spam prevention strategies. WordPress offers various built-in tools and plugins to help you in this endeavor. For instance, the Akismet plugin, a widely recognized solution, filters out spam comments using advanced algorithms, saving you time and effort in manual moderation. Additionally, you can fine-tune your discussion settings in WordPress to automatically moderate comments based on specific criteria, such as the number of links or the use of certain keywords.

Remember, the key to effective spam management lies in finding the right balance between open communication with your audience and maintaining the integrity of your website. Whether through disabling comments or utilizing anti-spam tools, each step you take towards managing spam is a step towards a more secure and engaging online presence.

Comments can be disabled:

1. Disabling comments through wp-admin dashboard

As mentioned before, there are different approaches based on what you want to achieve. The general comment settings are located under Settings -> Discussion in wp-admin dashboard. This is where you want to start with your changes.

Disable WordPress comments on any future posts

If you just recently published your WordPress site and don’t want to allow comments, you just need to uncheck the option ‘Allow people to post comments on new articles‘. This setting can be overridden on any individual post in case you want to make an exception.

Closing comments after a certain period of time

There is an option called ‘Automatically close comments on articles older than __ days’. You might want to change the default time (which is 14 days) to another number. You can also use this to turn off comments on all existing posts and pages by setting the value to 0. This will not remove the comments, just prevent any visitors from posting any comments on existing pages and posts.

If you want to remove comments from WordPress, all of them, through the wp-admin dashboard, navigate to ‘Comments‘ section. Select all the comments and move them to trash.

If you have a lot of comments you might have to repeat this process a few times. Depending on the number of comments, this can be a tiresome process. You can make it easier by increasing the number of comments per page (this applies to backend only). The default setting is 20 and it can be changed by clicking on ‘Screen options‘ and changing the number (I advise no more than 100 to avoid timeouts and errors).

If you have thousands or tens of thousands of comments, it is better to use a plugin to do this (more on this later).

Disable comments only on certain pages/posts

If you want to disable comments in WordPress on only some of the posts or pages on your site, navigate to posts/pages section. When you hover over a certain post or page in the list some options will appear, among which will be the ‘Quick edit‘ option. After you click on it, find the ‘Allow Comments‘ checkbox and uncheck it.

Use Bulk action to disable WordPress comments on multiple pages at once

This solution follows the same principle as the one mentioned before, but it can save you some time. Go to ‘Posts’ in wp-admin dashboard, select the posts you want to edit in a bulk, and select ‘Edit’ from ‘Bulk Actions’.  Click ‘Apply‘.

Go to the ‘Comments’ setting, choose ‘Do not allow‘ from the dropdown and click ‘Update‘. If you want to display more pages or posts in the list, use the ‘Screen Options‘ to increase the number of items per page in the backend.

Again, if you have been running the site for some time and have a lot of posts or pages, you might want to consider doing this with a plugin.

Disable WordPress comments on media files

Whenever you add an image, video or some other media file to your WordPress site, it is stored in the database as a post. It doesn’t matter if you’ve added it as a featured image or directly to the media library, this is how WordPress sees it. This means that even if you disable comments on the page, your visitors can still add comments to the media attachment page.

Theoretically, you can change this setting on each image one by one, but that is very time-consuming. Also, the media files don’t have a Bulk Edit action. Therefore, I suggest disabling comments either by using a plugin or disable comments programmatically by adding this to 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 );

2. Disabling comments with a plugin

Use the ‘Disable comments’ plugin

A simple name for a plugin and it does just what it says, disables comments on WordPress. It is one of the best-rated plugins with over 1 million active installs. The important thing to note is that this plugin does not allow to enable comments on individual pages. It does remove comments, but it also removes any comment related settings from edit and quick-edit screens.

It will, however, let you disable comments on only certain post types, but that cannot be overridden for individual posts/pages.

Regardless of being one of the best-rated plugins, it does not declare support for WordPress after version 5.1.1. It doesn’t mean that it won’t work, but it is something to keep an eye out for.

‘Disable Comments + Delete Comments’ WordPress plugin

This plugin is not as popular as its competitor, but it is rated very good, it is updated regularly and it declares the support for the latest WordPress core release. When it comes to disabling comments, it does pretty much the same thing the ‘Disable Comments’ plugin does and it offers similar options.

There is, however, one big difference. This plugin lets you DELETE comments as well. It is a handsome feature added in a recent version. If you have a problem with a lot of spam comments, then this is your all-in-one solution.

So far nobody reported major bugs or problems. The number of active installs since it was published is just over 2000, which fades in comparison to its competitor which has 1 million. Still, it is an option to consider.

Use ‘Akismet Anti-Spam’

Now, this plugin is not actually something you can use to disable WordPress comments. The reason why it made it to the list is that you might have an issue with spammers but don’t want to be bullied into disabling comments as a solution.

One of the greatest things about this plugin is that it automatically detects spam comments. It does so by checking comments against the global database of spam and filters the suspicious ones. This is a plugin with a great reputation and it is developed by ‘Automattic’ – a company that develops WordPress.

It is important to know that it requires an API key to work. You can obtain the API key here. It is free for personal blogs, while paid subscriptions are available for business sites.

Use reCaptcha to prevent spam

Another method you can try out is using Google reCAPTCHA to prevent bots from spamming your site. You will need a plugin to integrate the reCAPTCHA with your comment forms. One of the best solutions is ‘reCAPTCHA in WP Comments Form’ plugin.

In order to use it, you will have to generate the reCAPTCHA keys. This is a simple process that requires a Gmail address and the plugin actually has an installation wizard that will guide you through the process.

3. Disable Comments Programmatically in WordPress

The final method covered in this article is disabling comments by inserting code to your theme files. Depending on your knowledge, this may or may not be challenging. All you need to do is to paste this code at the bottom of your active theme’s functions.php file:

// Add to existing function.php file
// Disable support for comments and trackbacks in post types< function df_disable_comments_post_types_support() { $post_types = get_post_types(); foreach ($post_types as $post_type) { if(post_type_supports($post_type, 'comments')) {<c/ode> remove_post_type_support($post_type, 'comments'); remove_post_type_support($post_type, 'trackbacks'); } } } add_action('admin_init', 'df_disable_comments_post_types_support'); // Close comments on the front-end function df_disable_comments_status() { return false; } add_filter('comments_open', 'df_disable_comments_status', 20, 2); add_filter('pings_open', 'df_disable_comments_status', 20, 2); // Hide existing comments >function df_disable_comments_hide_existing_comments($comments) {
$comments = array();
return $comments; }
add_filter('comments_array', 'df_disable_comments_hide_existing_comments', 10, 2);
// Remove comments page in menu
function df_disable_comments_admin_menu() {
remove_menu_page('edit-comments.php'); }
add_action('admin_menu', 'df_disable_comments_admin_menu');
// Redirect any user trying to access comments page
function df_disable_comments_admin_menu_redirect() {
global $pagenow;
if ($pagenow === 'edit-comments.php') {
wp_redirect(admin_url()); exit; } }
add_action('admin_init', 'df_disable_comments_admin_menu_redirect');
// Remove comments metabox from dashboard
function df_disable_comments_dashboard() {
remove_meta_box('dashboard_recent_comments', 'dashboard', 'normal'); }
add_action('admin_init', 'df_disable_comments_dashboard');
// Remove comments links from admin bar
function df_disable_comments_admin_bar() {
if (is_admin_bar_showing()) {
>remove_action('admin_bar_menu', 'wp_admin_bar_comments_menu', 60); } }
add_action('init', 'df_disable_comments_admin_bar');

Exploring Alternatives to Comments for User Engagement

While disabling comments can streamline your WordPress site and reduce spam, it’s important to consider other avenues for user engagement. Keeping your audience engaged is key to building a vibrant online community and enhancing your site’s value.

Social Media Integration: One effective way to foster user interaction is through social media. By integrating social media platforms, you encourage users to engage with your content on their preferred networks. Share buttons, live feeds, and social media-based discussions can create dynamic interactions parallel to traditional comments.

Forums and Community Boards: If direct user interaction is essential for your site, consider setting up a forum or community board. Platforms like bbPress offer a structured, moderated environment for discussions, providing a more controlled space than open comment sections.

By leveraging these alternatives, you can maintain an interactive, user-focused experience on your WordPress site, even without traditional comment sections.

Conclusion

There are some advantages to using a code rather than installing a plugin for disabling comments on WordPress. First of all, you will get pretty much the same functionality as you would get with a plugin, and second, you won’t have to actually install one. Piling up plugins on your WordPress site can make it slow, therefore, it is always a good idea not to add plugin if you don’t have to.

Still, you should approach this carefully. Not pasting the code properly, leaving out as much as a semi-colon or any similar mistake can cause fatal errors and bring the site down. This is not a reason for big concerns, but it may cause an inconvenience for your visitors.

This article will hopefully provide you with a solution that works best for your site. If you need any assistance, you can always reach out to our professional WordPress Support team. Be sure to check out our services. For more step by step WordPress tutorials follow our WordPress blog.

More Resources: