How to Completely Disable Comments in WordPress (Ultimate Guide)

Comments sections were once a staple of the internet. A place for robust discussion, witty banter, and insightful feedback. But as WordPress has grown to power over 40% of all websites, comment spam has sadly grown with it.

Did you know that Akismet, the leading anti-spam plugin for WordPress, has blocked over 500 billion spam comments since its inception? That‘s more than 60 spam comments for every single human on earth!

So it‘s no surprise that many website owners are choosing to disable comments entirely. In this step-by-step guide, we‘ll cover exactly how to turn off comments in WordPress, both with a plugin or manually via code snippets. Let‘s dive in!

When to Consider Disabling WordPress Comments

Before we get into the how, let‘s talk about why you might want to disable comments in the first place. Comments can be great for user engagement, building community, and getting feedback. But they also have some downsides:

  1. Spam – As mentioned, spam is the biggest issue with WordPress comments. Even with anti-spam measures in place, some junk still gets through which site owners have to moderate.

  2. Time & Effort – Moderating comments takes time, even if you‘re just hitting "approve" or "spam". If your posts get a lot of comments, it can become a significant time sink.

  3. Lack of Quality Discussion – Many comment sections devolve into arguments, self-promotion, or off-topic chatter that doesn‘t add value for readers.

  4. Not Necessary for Every Site – Some types of sites, like business sites, portfolios, or landing pages, may not need a comment section at all.

In fact, many major publications and blogs have removed comments in recent years, including NPR, The Atlantic, Popular Science, and Vice. Their reasons range from spam to uncivil discourse to a lack of meaningful discussion.

Of course, every site is different. If your site thrives on interaction and discussion, disabling comments may not be the right move. But if any of the above resonates with you, read on to learn exactly how to disable comments in WordPress!

Method 1: Disable WordPress Comments with a Plugin

The easiest way to completely disable comments across your entire WordPress site is by using a plugin. There are a few good ones, but we recommend Disable Comments by WPDeveloper.

Here‘s how to use it:

  1. Install & activate the free Disable Comments plugin
  2. Go to Settings > Disable Comments in your WP dashboard
  3. Select "Disable comments everywhere"
  4. Click "Save Changes"

Disable Comments plugin settings

That‘s it! The plugin will now disable the comment system sitewide. This means:

  • Comment forms will be hidden on all posts, pages, and custom post types
  • Past comments will be hidden from view
  • All comment-related WordPress settings, widgets, and dashboard items will be removed
  • Your site will be excluded from comment-related checks by search engines

If you ever want to re-enable comments, simply deactivate the plugin.

Disable Comments on Certain Post Types

Want to be more selective about where comments are disabled? No problem. In the plugin settings, choose "Disable comments on certain post types" instead.

Then just check the boxes next to each post type you want to disable comments on, whether it‘s Posts, Pages, Media, or any custom post types.

Disable comments on certain post types

Using this option is a good choice if you still want comments on some parts of your site. For example, you may want to allow comments on blog posts while disabling them on pages.

Other Disable Comments Plugin Features

The Disable Comments plugin has a few other handy features worth mentioning:

  • Disables outgoing trackbacks and pingbacks (which can also attract spam)
  • Provides a tool to delete all existing comments in bulk
  • Hides the "Comments" link from the WordPress admin bar
  • Removes comment links from the admin dashboard and menus

So if you want a simple, set-it-and-forget-it solution for disabling WordPress comments, this free plugin is a great choice.

Method 2: Disable Comments in WordPress Using Code

If you prefer not to use a plugin, you can disable comments in WordPress by adding code snippets to your theme‘s functions.php file or to a site-specific plugin.

Important: Editing core theme files like functions.php can break your site if not done carefully. Please make a complete backup of your site before attempting any of these code snippets!

Got your backup ready? Here‘s the code to completely disable comments sitewide:

// 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‘)) {
            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‘);

To use this code snippet:

  1. Copy the entire code block
  2. Paste it at the very end of your theme‘s functions.php file before the closing ?>
  3. Save the file

This code will completely disable the WordPress comment system, hide existing comments, and remove all comment-related screens and options from the admin area.

Disable Comments On Specific Post Types

Similar to the plugin method, you can also selectively disable comments on certain post types with code.

For example, to disable comments on Pages only, use this code:

// Disable support for comments and trackbacks in Pages
function df_disable_page_comments() {
    if (post_type_supports(‘page‘, ‘comments‘)) {
        remove_post_type_support(‘page‘, ‘comments‘);
        remove_post_type_support(‘page‘, ‘trackbacks‘);
    }
}
add_action(‘init‘, ‘df_disable_page_comments‘);

You can replace page with any other post type like post, attachment, or a custom post type.

How to Deal with Existing Comments

So you‘ve disabled comments going forward, but what about existing comments on your site?

If using the Disable Comments plugin, you can delete all comments in bulk right from the plugin settings page.

If you‘re going the manual code route, you‘ll need to delete existing comments from the database. The safest way is to use a database management tool like phpMyAdmin:

  1. Go to phpMyAdmin and select your WordPress database
  2. Click on the wp_comments table ("wp" may be different if you changed the database prefix)
  3. Check the box to select all comments
  4. In the "Bulk Actions" dropdown, choose "Delete" and click "Apply"

Delete WordPress comments in phpMyAdmin

This will permanently delete all existing comments from your WordPress site. If you want to keep them backed up just in case, you can export the wp_comments table to a SQL file first.

Alternative Anti-Spam Measures

If comment spam is your main reason for wanting to disable comments altogether, there are some other measures you can try first:

  1. Akismet – This free plugin by Automattic automatically filters out spam comments with impressive accuracy. It‘s blocked over 500 billion spam comments to date!

  2. Moderation – In WordPress, you can require all comments to be manually approved before appearing. This ensures no spam slips through. Just enable "Comment must be manually approved" under Settings > Discussion.

  3. Honeypot – The free WPBruiser plugin adds an invisible "honeypot" field that only spambots see, blocking them without bothering human commenters.

  4. CAPTCHAs – CAPTCHAs are those squiggly word images that users must decipher to submit a comment. They‘re effective at blocking bots but can also deter real comments. If you use them, stick with simple and accessible ones.

  5. Disable URLs – Many spammers just want a backlink. You can remove the website field from your comment form under Settings > Discussion to discourage these folks.

  6. Close Comments After X Days – In WordPress, you can automatically disable comments on posts after a certain number of days. Most spam hits older posts, so this can help. Enable it under Settings > Discussion.

Here‘s a stat for you – websites using Akismet block an average of 53 spam comments per day, even with other anti-spam measures in place! So it‘s a great first line of defense.

Final Thoughts

There you have it – two methods for completely disabling WordPress comments, plus some alternative anti-spam options to consider.

If you want the simplest solution, go with the Disable Comments plugin. For more control and customization, use the code snippets to disable comments programmatically.

Whichever route you choose, remember that disabling comments is a big decision. You may lose out on valuable interaction and feedback. But if moderating spam has become unmanageable, or if comments just aren‘t necessary for your type of site, disabling them can save you a ton of time and headaches.

What are your thoughts on disabling WordPress comments? Have any other tips for combating comment spam? Let us know in the… just kidding! 😉

Did you like this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.