New: professional WordPress services from the team behind your theme

Tutorial WordPress Website Level: Beginner 10 Minutes

How to Disable Comments in WordPress (7 Easy Methods)

Seven ways to disable comments in WordPress: on future posts, single posts, existing posts in bulk, sitewide with a free plugin or code, on media pages and automatically on older posts.

How to disable comments in WordPress with 7 easy methods: future posts in Settings, a single post in the editor, existing posts with bulk edit, the whole site with a free plugin or code, and auto-close for older posts

Want to disable comments in WordPress? You are not alone. Comments can attract spam, and moderating them takes time you may not have.

WordPress gives you several free ways to do it. You can switch comments off for one post, for every page, or for the whole site.

In this guide, we walk through seven methods, from a single tick box to a short code snippet. Pick the one that matches your goal and follow the steps.

Video Tutorial

Prefer to watch? This short video walks through the main methods in under three minutes. The written steps continue below.

Should you disable comments in WordPress?

It depends on what your site is for. A busy blog may rely on discussion, while a business site or portfolio often has no use for it.

Here are the main reasons to switch comments off:

  • You have less spam to clean up.
  • There is no moderation queue to check.
  • You receive fewer comment notification emails.
  • Static pages, such as a contact or services page, look tidier without a comment form.

And here are the reasons to keep them:

  • Readers can ask questions and give you feedback.
  • Discussion can build a community around your content.
  • Visitors can point out mistakes or steps that no longer work.
  • Switching comments off does not suit every site, and a quiet blog can feel less welcoming.

If spam is your only problem, you may not need to switch comments off at all. We cover gentler options near the end of this guide.

Which method should you use?

People describe this job in different ways. Some search for “turn off comments WordPress”, others for “remove comments WordPress”. The settings involved are the same.

7 ways to disable comments in WordPress: future posts, a single post or page, existing posts in bulk, a free plugin, a code snippet, media pages and auto-close, plus cleaning up old comments

Use this table to find the right method for your goal. The times are rough guides for a typical site.

GoalMethodTime
Stop comments on posts you publish from now onMethod 1: Discussion settingsAbout 1 minute
Switch comments off for one post or pageMethod 2: Editor sidebarAbout 1 minute
Close comments on posts you have already publishedMethod 3: Bulk editAbout 5 minutes
Switch comments off everywhere without codeMethod 4: Free pluginAbout 5 minutes
Switch comments off everywhere without a pluginMethod 5: Code snippetAbout 10 minutes
Stop comments on media pagesMethod 6: Media post typeAbout 5 minutes
Keep comments on new posts onlyMethod 7: Automatic closingAbout 1 minute

You can combine methods. For example, many site owners use Method 1 for future posts and Method 3 for older ones.

Method 1: Disable comments on future posts

This is the quickest way to disable comments in WordPress for new content. It tells WordPress to keep comments closed on everything you publish from now on.

  1. In your dashboard, go to Settings » Discussion.
  2. Untick Allow people to submit comments on new posts.
  3. Untick Allow link notifications from other blogs (pingbacks and trackbacks) on new posts as well.
  4. Scroll down and click Save Changes.

This setting affects new posts only. Posts and pages you have already published keep their current comment setting, so use Method 3 for those.

Method 2: Disable comments on a single post or page

Sometimes you only want one post to be comment-free, such as an announcement or a policy page. You can change that inside the editor.

  1. Open the post or page in the block editor.
  2. Open the post settings sidebar on the right.
  3. Find the Discussion panel.
  4. Untick Allow comments. In newer versions of WordPress, the option is labelled Open/Closed, so choose Closed.
  5. Click Save or Publish.

Pages have comments off by default, so you rarely need to disable comments on pages by hand. It is still worth checking any page that shows a comment form.

This setting overrides the site-wide default in Method 1. That means you can also use it in reverse, to open comments on one post while the rest stay closed.

Method 3: Disable comments on existing posts in bulk

Method 1 leaves your published posts untouched. To close comments on those, use the bulk editor instead of opening each post in turn.

  1. Go to Posts » All Posts.
  2. Click Screen Options at the top of the screen. Raise Number of items per page so more posts fit on one screen, then click Apply.
  3. Tick the box at the top of the list to select all posts.
  4. Open the Bulk actions menu, choose Edit, and click Apply.
  5. In the bulk edit panel, set Comments to Do not allow.
  6. Click Update.

If your posts run over more than one screen, repeat the steps for each one. You can follow the same steps under Pages » All Pages if any pages have comments open.

Existing comments stay visible after this change. Visitors simply cannot add new ones.

Method 4: Disable comments in WordPress with a free plugin

A plugin is the easiest route when you want comments gone across the whole site. We suggest Disable Comments, which is free.

  1. Go to Plugins » Add New Plugin.
  2. Search for “Disable Comments”, then click Install Now and Activate.
  3. Go to Settings » Disable Comments.
  4. Choose Everywhere to switch comments off across the whole site. Choose On Specific Post Types if you only want to target posts, pages or media.
  5. Click Save Changes.

The second option is handy when you want comments on blog posts but nowhere else. Tick the post types you want to close and leave the rest alone.

Looking for more free tools? See our list of the best free WordPress plugins.

Method 5: Disable comments in WordPress with code

If you would rather not add another plugin, a short snippet does the same job. This method suits you if you are comfortable pasting code.

Back up your site first. If you can, try the snippet on a staging site before you add it to your live site.

  1. Take a full backup of your site.
  2. Install a code snippets plugin, or open the functions.php file of your child theme.
  3. Paste the snippet below.
  4. Save the file, or save and activate the snippet.
  5. Visit a post while logged out to confirm the comment form has gone.
add_action( 'admin_init', function () {
    foreach ( get_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_filter( 'comments_open', '__return_false', 20, 2 );
add_filter( 'pings_open', '__return_false', 20, 2 );
add_filter( 'comments_array', '__return_empty_array', 10, 2 );
add_action( 'admin_menu', function () {
    remove_menu_page( 'edit-comments.php' );
} );

Here is what the snippet does:

  • It removes comment and trackback support from every post type.
  • It closes comments and pings on the front end of your site.
  • It stops existing comments from being displayed.
  • It removes the Comments menu from your dashboard.

Always use a child theme rather than the parent theme. A theme update replaces the parent theme files, and your snippet would be lost.

To undo the change, delete the snippet or deactivate it in your code snippets plugin.

Method 6: Disable comments on media pages

WordPress can create a separate page for each file you upload, called an attachment page. These pages can carry their own comment form, which spammers sometimes target.

Since WordPress 6.4, attachment pages are disabled for new sites. Older sites may still have them, so this method is mainly for sites that have been running for a while.

  1. Install and activate the Disable Comments plugin, as described in Method 4.
  2. Go to Settings » Disable Comments.
  3. Choose On Specific Post Types.
  4. Tick the media post type.
  5. Click Save Changes.

The snippet in Method 5 also covers media. It removes comment support from every post type, and attachments are one of them.

Method 7: Close comments automatically on older posts

Most spam lands on old posts that nobody is watching. You can keep comments open on fresh posts and let WordPress close them later.

  1. Go to Settings » Discussion.
  2. Tick Automatically close comments on posts older than X days.
  3. Enter the number of days you want comments to stay open.
  4. Click Save Changes.

This is a good middle ground. Readers can still respond while a post is new, and you have far fewer old threads to watch.

How to delete existing comments

Closing comments does not delete the ones you already have. If you want a clean slate, you can remove them in bulk.

Deleting comments is permanent once the trash is emptied, so back up your site first.

  1. Take a full backup of your site.
  2. Go to Comments in your dashboard.
  3. Tick the box at the top of the list to select all comments.
  4. Open Bulk actions, choose Move to Trash, and click Apply.
  5. Open the Trash view and click Empty Trash.

If you have many comments, raise Number of items per page in Screen Options first. Then repeat the steps until the list is empty.

If you used the snippet in Method 5, the Comments menu is hidden. Delete your comments before you add the snippet, or deactivate it for a moment.

A regular clear-out like this fits well into a wider routine. Our WordPress maintenance checklist covers the other jobs worth doing.

How to remove the “Comments are closed” message

After you close comments, some themes show a short notice under each post. If you see a “WordPress comments are closed” line, it is coming from your theme, not from WordPress settings.

The text sits in the comments template of your theme. Whether you can hide it depends on the theme you use.

  • The code in Method 5 stops existing comments from being displayed.
  • Ask the support team for your theme whether it has an option to hide the notice.
  • Use a child theme if the comments template needs changing, so updates do not undo the work.

We do not recommend editing the files of a parent theme directly. The next theme update would overwrite your change.

Prefer to keep comments? Fight spam instead

You do not have to disable comments in WordPress to get rid of spam. If you value the discussion, try these options first.

  • Moderation. Go to Settings » Discussion and tick Comment must be manually approved. Nothing appears on your site until you approve it.
  • Closing after X days. Use Method 7 to close comments on older posts, where most spam lands.
  • Anti-spam. Antispam Bee is a free plugin that filters spam comments for you.

For a fuller walkthrough, read our guide to WordPress spam protection. You can also add Cloudflare Turnstile in WordPress to challenge bots before they submit a form.

If you moderate by hand, let readers know when their comment goes live. Our tutorial on setting up a comment approval notification shows you how.

Need a hand?

Not keen on changing settings or pasting code yourself? We can help.

Open a $29 priority ticket with VIP Support and tell us where you want comments switched off. We will take it from there.

Frequently asked questions

Does disabling comments help SEO?

There is no direct ranking benefit. The gain is practical: you have less spam on your site and less moderation to do.

Will disabling comments delete old ones?

No, closing comments only stops new ones from being added. Your old comments stay in place until you delete them yourself. The code in Method 5 hides them from visitors without deleting them.

Can I disable comments on pages only?

Yes, and pages have comments off by default, so you may not need to do anything. If some pages have comments open, bulk edit them as in Method 3. You can also use the plugin in Method 4 and choose pages as the post type.

How do I turn comments back on?

Reverse the method you used. Tick the box again under Settings » Discussion, or bulk edit your posts and set Comments to Allow. If you used the plugin or the snippet, deactivate it.

Do pingbacks and trackbacks count as comments?

They are link notifications from other blogs, and WordPress handles them alongside comments. Spammers use them too, so it makes sense to switch them off together. Untick the pingbacks and trackbacks box in Method 1, or use Method 4 or 5.

Reactions

How did this make you feel?

Be the first to react

One reaction per visitor. Tap again to change or remove it.

Keep reading

Browse all resources

Discussion

Leave a reply

Your email address stays private. Required fields are marked *