WordPress GuidePost → Disable Comments

How to disable WordPress comments site-wide or selectively

Image

Managing comments on your WordPress site plays a crucial role in shaping the user experience and engagement. Whether you aim to foster discussions or maintain a quieter space, disabling comments can streamline your site’s functionality. 

Let’s explore various methods to disable WordPress comments, both selectively and site-wide. From removing comments on all posts to disabling them on specific pages or media, you’ll find clear instructions here to tailor your site’s commenting system to your needs.

Get fast, reliable hosting for WordPress

Power your site with the industry’s fastest, most optimized WordPress hosting

Why disable WordPress comments?

Disabling comments can be strategic for several reasons:

Disabling comments can be strategic for several reasons:

How to moderate comments without disabling them

If you’d rather leave comments on but keep spam out, WordPress gives you several easy moderation tools.

Smart moderation keeps real conversations flowing while locking spam firmly outside the door.

How to turn off commenting in WordPress

To disable comments site-wide, access your WordPress dashboard, select ‘Settings,’ then ‘Discussion.’ Uncheck the box that allows people to post comments on new articles. For existing posts, edit each post individually and uncheck the ‘Allow comments’ option in the ‘Discussion’ section. 

Using a plugin can also bulk edit comment settings for multiple posts at once. 

How to disable and remove WordPress comments completely (site-wide)

To remove the distraction of comments entirely, follow these steps:

How to disable comments on a specific post or page

To selectively disable comments:

How to disable comments on future posts

To disable comments on future posts:

How to disable comments on all existing pages or posts

To disable comments on all existing pages or posts:

To change the default settings for future posts, go to ‘Settings’ then ‘Discussion’ in your dashboard and uncheck the box that allows comments on new posts. 

How to delete all existing WordPress comments

Deleting all comments from your site can be necessary for various reasons. Follow these steps:

Once you empty the trash, all comments will be permanently deleted. Ensure you want to delete all comments before proceeding.

How to remove the ‘Comments are closed’ message

Even after you disable comments, some themes still print a “Comments are closed” notice under every post. Here’s how to hide it for good.

If you’d rather not edit core theme files directly, work inside a child theme or enlist a developer to keep updates hassle-free.

How to disable comments on media

WordPress automatically creates an “attachment page” for every file you upload, and that page can collect comments just like a blog post. Most site owners never link to, let alone moderate, these pages, which makes them a magnet for spam. Turning off comments on media keeps these hidden corners clean and saves you hours of unwanted moderation.

Why media items attract spam

Step-by-step: turn off comments on media files

Once you save your changes, all comment forms should vanish from your media pages, closing a back door that spammers love to exploit.

How to use a plugin to disable comments

Using a plugin can be an efficient way to disable comments. Here are a few recommended plugins:

Let’s take a look at how to use the Disable Comments plugin. It is one of the top go-to options, trusted by more than one million active WordPress sites.

The plugin will hide existing comments, remove comment forms, and clear out comment-related menus and widgets for a cleaner dashboard.

The other plugins have similar settings as well, and any of these tools gives you an easy, reversible way to keep conversations under control without touching your theme files.

How to disable comments using code

If you’re comfortable poking around under the hood, you can shut off comments across your entire site with a short, safe code snippet—no plugin required. Here’s the quick-start guide.

// Disable comments on all 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 and pings 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);


Why this works: The first function removes comment and trackback support from every registered post type, while the second function forces WordPress to treat all comment and ping requests as closed on the front end. This lightweight solution keeps your site lean and eliminates one more plugin to maintain, yet you can roll back at any time by deleting the snippet.


Ready to get started?

Get the fastest, most secure WordPress.org hosting on the market.

Image

Wesley Whetten is the former Sr. Affiliate Program Manager at Liquid Web, SolidWP, and Nexcess. For almost five years, Welsey has worked tirelessly to help others understand the power of affiliate marketing and how to use it to generate new revenue streams.

Trust us to help you choose the ideal hosting solution

Loading form…