How to Disable Comments in WordPress (and When Not to)

The heart of an online presence lies in its engaging community, and what better way to foster such engagement than allowing users to post comments? Yet, there are moments when it might be necessary to hit the “off” switch. If your comments section gets flooded with spam, your impulse may be to automatically close comments before things get too messy. 

But you don’t necessarily need to do that. Today, we’ll delve into how to disable comments in WordPress and also discuss situations where this isn’t the best decision. And we’ll explore solutions to common concerns, such as managing spam, using powerful tools like Akismet.

Let’s get right to it.

Turning off comments to stop spam? Install Akismet instead

Before you disable comments altogether, consider what’s really bothering you.

Is it the flood of spam making your management duties unbearable? Or, are trolls wreaking havoc on your site’s overall positive vibes? It’s natural to feel overwhelmed and think of disabling comments as the quick fix. But there’s a better method you can employ.

Enter Akismet, your staunch ally in the battle against spam. This robust tool packs quite a punch when it comes to filtering out spammy content, letting you revel in the genuine, quality interaction with your users.

Akismet homepage with the text, "Spam shall not pass"

A blend of simplicity and power, Akismet is astoundingly easy to use. Once installed and set up, it works quietly behind the scenes of your entire WordPress site, sifting through incoming comments, and sweeping away spam. All you’re left with are the comments that truly matter. You’ll see the difference immediately and wonder how you ever managed without it.

Here are a few features that make Akismet your hero:

  • Automatic spam detection: It checks and filters every comment, so you don’t have to spend your precious time discerning real comments from spam.
  • A flexible discard feature: You have complete control. You can choose to discard the worst and most pervasive spam, so you’ll never have to see it.
  • A visible comment status history: For each comment, Akismet provides a status history, so you can understand where the spam was caught, cleared, or missed.

This is all fine and well, but maybe it seems like too much trouble. Couldn’t you just disable comments across the board and be done with it? Certainly, you could. But there are tangible benefits to keeping comments turned on in WordPress. 

For instance, comments can:

  • Boost community engagement
  • Encourage repeat visitors
  • Provide a way to get quick feedback
  • Improve on‑page SEO

But if left to run amuck, an overabundance of spam comments can leave a sour taste in visitors’ mouths. An unmoderated comment section can:

  • Look unprofessional
  • Affect site security
  • Attract more spam comments
  • Create more work for admins

All that being said, before you decide to disable comments in WordPress for future posts entirely, give Akismet a shot. As one of the best anti‑spam plugins on WordPress, it’s the solution that preserves your community engagement while keeping your WordPress website clean and spam free.

Still, there might be situations where you want to learn how to turn off comments in WordPress. Perhaps you’ve decided to repurpose your blog as a purely informational site, or maybe you have a specific WordPress post that doesn’t require engagement. Whatever your reasons, we’ll walk you through the process next.

Still want to disable WordPress comments? Here are four ways to do so:

While we advocate for keeping the comments section activated, there are times when you may feel it necessary to hit that “disable” button. If you’ve made up your mind, here are four ways to turn off comments in WordPress:

man in a maroon sweater looking at a computer screen

1. Turn off comments in your WordPress settings

One way to disable comments site‑wide is through the WordPress Discussion settings.

Here’s how you do it:

  1. From your WordPress Dashboard, navigate to Settings → Discussion.
  2. In the Default post settings section, uncheck the box that says Allow people to comment on new posts.
  3. Scroll down and click Save Changes.
discussion settings in WordPress

Remember, this setting only applies to future posts. Your old posts will still have comments enabled unless you disable them individually or in bulk, which brings us to our next point.

2. Disable comments on a specific post

Maybe you just want to turn off comments for one or a few specific posts. That’s easy to accomplish as well:

  1. From the WordPress dashboard, navigate to Posts or Pages and find the post or page where you want to disable comments.
  2. Click Edit to open the post or page.
  3. On the right‑hand side of the screen, in the Post tab, scroll down to Discussion.
  4. Uncheck Allow comments.
  5. Update or Publish the post to save your changes.
comment settings on an individual blog post

Or, you can do this from the Post or Pages list. Instead of clicking on the post to open the Block Editor, click Quick Edit, uncheck the box that says Allow Comments. then click Save.

turning off comments for a post

3. Disable comments in bulk on a group of posts

If you need to disable comments on multiple posts, you can do so quickly with the bulk edit feature:

  1. Go to Posts in your WordPress dashboard.
  2. Check the boxes next to the posts where you want to disable WordPress comments.
  3. From the Bulk Actions drop‑down at the top, choose Edit, then click Apply.
  4. In the Bulk Edit box that appears, find Comments and select Do not allow.
  5. Click on the Update button to save your changes.
turning off comments on posts in bulk

4. Turn off comments using custom code

If you feel comfortable tinkering with your site’s code, you can turn off comments by adding a few lines to your theme’s single.php file. This is the file that controls specifications for your site’s blog posts.

Note: Before making any changes to your site’s code, always make a backup. Accidents can happen, and you don’t want to lose your site’s data. Jetpack VaultPress Backup is the ideal solution for this purpose. Finally, it’s important to use a child theme in a staging environment before pushing your changes to your live site.

Once you’re ready, locate your single.php file and open it in an HTML editor. Find the follow line of code in the file:

<?php comments_template(); ?>

Highlight this bit of code and replace it with the following:

<!-- Begin Comment

<?php comments_template(); ?>

End Comment -->

This code will turn off comments for all the posts on your WordPress site (and will even remove existing comments). By using this method, you’re “commenting out” the line of code that enables comments on your WordPress site. This turns that line of code into a “note” (such as ones you might make for other developers to reference if they’re troubleshooting your work) instead of a line that would actually be executed. 

Disabling comments in this way is a better solution than simply removing the line of code entirely because you can more easily re-enable comments again in the future. 

You can repeat this process for additional post types, including your site’s pages.

Alternative solution: Keep comments enabled, but block spam

If you feel hesitant about taking the last‑ditch approach to disable comments in WordPress altogether, there is a better solution. Consider keeping comments enabled but blocking spam. It’s the middle‑ground solution that lets you foster community engagement while keeping spam at bay.

Akismet is your go‑to tool for this purpose. Once enabled, it screens every comment and filters out those that look like spam. You’re left with genuine interaction without the headache of moderating every single comment manually.

To get started with Akismet, you’ll first need to install and activate the Akismet plugin. Here’s a step‑by‑step guide to get you up and running:

  1. From your WordPress dashboard, navigate to Plugins and then click on Add New.
  2. In the search box, type “Akismet”. It should be the first result that appears.
  3. Click on the Install Now button and then Activate.

Now that the Akismet plugin is activated, you’ll need to set it up:

  1. Go to Settings → Akismet Anti‑Spam.
  2. You’ll be asked for your Akismet API key. If you don’t have one, go to the Akismet website, where you can sign up for an account and create a key.
  3. Once you’ve got your key, enter it in the API Key field, then click Save Changes.
  4. Akismet is now connected to your WordPress site.
settings for Akismet

That’s it! Akismet is now set up and ready to start blocking spam.

You can view stats and see how many spam comments Akismet has blocked by visiting the Akismet Stats page in your WordPress dashboard.

Remember, enabling comments doesn’t have to mean opening the floodgates to spam. With Akismet on guard, you can enjoy the best of both worlds: an engaged community and a spam‑free commenting experience.

How to delete past comments in bulk

Whether you’ve decided to disable comments or simply need to clear out old, irrelevant chatter on existing published posts, WordPress provides easy ways to delete all the comments from the past.

crumpled up paper by a trash can

Let’s start with handling this task in bulk:

  1. Create a backup of your WordPress site before making any major changes.
  2. Navigate to the Comments section in your WordPress dashboard.
  3. By default, all comments are displayed. You can filter them by clicking on the All, Pending, Approved, Spam, or Trash links at the top.
  4. Once you’ve chosen the comments you wish to delete, check the box next to Author at the top to select all comments on the page. Alternatively, you can manually select individual comments.
  5. From the Bulk Actions dropdown menu, choose Move to Trash and then click Apply.

This will send all selected comments to the trash. If you want to permanently delete these comments:

  1. Click on the Trash link at the top.
  2. Click the Empty Trash button.

And that’s it. Your selected comments are gone for good.

The only problem here is that, by default, you can only bulk delete 20 comments at a time. To get around this, click Screen Options at the top of the Comments page. Beside “Number of items per page,” change “20” to whatever you’d like and click Apply.

selecting the number of posts per page

How to delete past comments on individual posts

If you’re only interested in pruning comments from specific existing posts, WordPress offers an efficient way to do so. Here’s how:

  1. Navigate to Posts in your WordPress dashboard.
  2. Find the post from which you want to remove comments and, in the Comments column, click the number of published comments for that post.
  3. You’ll now see a list of all comments for that post. Hover over the comment you want to delete to reveal a menu and click Trash.
  4. If you want to permanently delete this comment, click on the Trash link at the top to view all trashed comments. Hover over the comment you just trashed, and click Delete Permanently.

That’s it! You’ve successfully learned how to manage and control the comments section on your WordPress site. While it might be tempting to disable comments during tough times, tools like Akismet can make the task a lot easier, ensuring your site remains a place for valuable discussion.

Frequently asked questions

Having shed light on how to disable comments in WordPress, let’s now address some frequently asked questions.

Why use Akismet instead of disabling comments?

Akismet is a powerful spam filtering service that can significantly reduce the time and effort you spend moderating comments. By using Akismet, you can maintain an open forum for your users to engage and interact without the headache of dealing with comment spam. 

This helps foster a sense of community around your content and can also improve your site’s SEO by encouraging user‑generated content. In contrast, disabling comments shuts down these possibilities.

What are other advantages of enabling comments?

Enabling comments on your site creates a two‑way communication channel between you and your visitors. This can lead to insightful discussions, provide feedback, and generate new ideas for content. Comments also increase the time people spend on your site, which can boost your SEO.

black coffee mug next to a laptop

What should I do if comments are disabled but still showing?

If you chose to disable comments in WordPress, but comments are still appearing on your site, it might be that they were posted before you disabled comments. In such a case, you’ll need to manually delete these comments. You can refer to our sections on how to delete comments in bulk or on individual posts for step‑by‑step instructions.

How can I disable comments on media files?

WordPress treats media files (images, videos, etc.) as separate posts, which means they can have their own comment sections. To disable comments on media files, you’ll need to do the following:

  1. Go to Media → Library in your WordPress dashboard.
  2. Click on the media file you want to disable comments for.
  3. On the right hand side of the screen click Edit more details.
  4. Under the Discussion section, uncheck the box that says Allow comments. If you don’t see this option, click Screen Options at the top and check the box next to Comments
  5. Click Update to save changes.

Repeat this process for each media file you want to disable comments for.

How can I remove the “Comments Are Closed” message?

The “Comments Are Closed” message typically appears when comments have been disabled on a post that had comments previously published. One way to remove this is by adding this CSS to your site.

In your dashboard, go to Appearance → Additional CSS. Add this line of code to the bottom:

.nocomments {

    display: none;


Then, click Publish. 

This should work for the majority of themes. If, however, your theme uses a different CSS class for the “Comments Are Closed” message, you’ll need to replace “.nocomments” with the correct line.

How can I remove the comment counter on my blog?

The comment counter is a feature that comes with many WordPress themes. To remove it, you’ll need to edit your theme’s files. Again, back up your site before making any changes.

  1. Go to Appearance → Additional CSS.
  2. Next, you need to hide the .comments_count class. To do this, paste this code snippet at the bottom:
.comments-count {

 display: none;

  1. Click Publish to save your changes.

Akismet: AI‑powered anti‑spam for WordPress comments and forms

Comments form a vibrant part of any blog or website, sparking discussions, fostering community, and generating valuable user engagement. However, managing spam can turn this asset into a hassle. That’s why Akismet is such a valuable plugin — it can transform the chore of comment moderation into an automated process.

Harnessing the power of AI, Akismet helps keep your comments section clean, filtering out spam and allowing genuine interactions to shine. While disabling comments might seem like a tempting quick fix, consider this alternative: a world where your users can freely submit comments to share their thoughts, ideas, and appreciation without you having to worry about an onslaught of spam.

Get started with Akismet