Skip to content

How to Disable Comments in WordPress: 6 Methods We Tested

How to Disable Comments in WordPress: 6 Methods We Tested

This guide shows how to disable comments in WordPress on new posts, old posts, media files and your whole site.

We tested every method on a WordPress 7.1.3 test site with the Twenty Twenty-Five theme in October 2026. We also ran the Disable Comments 2.9.0 plugin and a short code snippet, and we recorded what each one does to existing comments.

You get six working methods and a table showing what each one does to old comments. You also get fixes for pages, media files, WooCommerce reviews and block themes.

What Happens to Existing Comments When You Disable Comments?

Closing comments stops new ones, but it does not delete the comments already on your site. On our test site, Bulk Edit, the editor, the auto-close setting and a code snippet all left existing comments visible. The Disable Comments plugin hid them instead, and only its Delete Comments tool removed anything.

Moving comments to the Trash is a different job. It hides them, but the comment form stays open. New comments keep arriving. We trashed every comment on one open post and then submitted a test comment. WordPress accepted it.

MethodNew commentsExisting comments
Settings > DiscussionClosed on new posts onlyUntouched
Bulk Edit or the editorClosedStill shown
Auto-close old postsClosedStill shown
Code snippetClosedStill shown
Disable Comments pluginClosedHidden but not deleted
Move to TrashStill allowedHidden and then deleted
What each method does to existing comments in WordPress
Closed post that still shows two existing comments

Note: WordPress empties the trash on a schedule. The WordPress developer documentation says the EMPTY_TRASH_DAYS default is 30 days, and the setting covers trashed comments.

Method 1: Turn Off Comments for New Posts in Settings

Open Settings and then Discussion, and untick Allow people to submit comments on new posts. WordPress then closes comments on every post you create after you save the change. The WordPress documentation for the Discussion screen says individual posts can still override this default.

  1. Open Discussion settings: In the WordPress admin, go to Settings and click Discussion.
  2. Clear the checkbox: Untick Allow people to submit comments on new posts and click Save Changes.
    How to disable comments in WordPress from the Discussion settings screen

The box above it controls pingbacks and trackbacks. Untick it too if you also want link notifications off.

If you are setting up a brand-new site, do this before you publish the first post. Every post you write later then starts closed, and you never need Bulk Edit for it.

We checked this on the test site. A post created after the change had its comments closed, while an older post stayed open with its two comments. So this method alone never closes the posts you already published.

Method 2: Disable Comments on Existing Posts with Bulk Edit

Bulk Edit changes the comment setting on many existing posts at once. Select the posts on the Posts screen, choose Bulk edit, and set Comments to Do not allow. On our test site this closed comments on six posts and kept every existing comment in the database.

  1. Open the list: Go to Posts and click All Posts. Pages work the same way under Pages. This is the fastest way to disable comments on all posts that already exist.
  2. Select the posts: Tick the box in the header row to select every post on the page, or tick single rows.
  3. Choose Bulk edit: Pick Bulk edit in the Bulk actions menu and click Apply.
  4. Close the comments: Set Comments to Do not allow and click Update.
    Bulk edit panel with Comments set to Do not allow

The Posts screen shows 20 posts per page by default. Open Screen Options and raise the number of items per page to catch more posts in one pass.

A site with hundreds of posts is faster to handle with WP-CLI. Back up the database first and then run this command on a test copy before the live site:

wp post update $(wp post list --post_type=post,page --format=ids) --comment_status=closed --ping_status=closed

Method 3: Close Comments on a Single Post in the Block Editor

Open the post in the editor, click Discussion in the Post sidebar and choose Closed. WordPress 7.1 explains the choice right under the option: visitors cannot add new comments or replies. Existing comments remain visible, and the setting applies to that one post and nothing else.

  1. Open the post: Go to Posts, hover over the title and click Edit.
  2. Find Discussion: Open the Post tab in the right sidebar and look for the Discussion row.
  3. Choose Closed: Click the current value, usually Open, and select Closed. Click Update to save.
    Discussion options in the block editor with Closed selected

Pingbacks have their own checkbox in the same popover. After we chose Closed, the sidebar read Pings only. Comments were closed while pingbacks stayed on.

Use this method for the odd post that attracts spam or an old announcement nobody should reply to. Once you have more than five or six posts to close, Bulk Edit saves time. Switching the option back to Open brings the form back at once.

Method 4: Close Comments Automatically on Old Posts

The auto-close setting closes comments on older posts without editing the posts themselves. Tick Automatically close comments on old posts and enter a number of days. The WordPress documentation says this prevents new comments while leaving previously approved comments visible.

  1. Open Discussion settings: Go to Settings and click Discussion.
  2. Set the age: Tick Automatically close comments on old posts and type the number of days.
  3. Save the change: Click Save Changes at the bottom of the screen.
    Automatically close comments on old posts setting with 14 days

We backdated one post to 1 August 2026 and set the limit to 14 days. The comment form vanished, and a test submission returned the message that comments are closed for this item. The post’s own comment status still read Open in the database.

WordPress checks the post date each time the page loads. When we raised the limit to 400 days, the form came back on that same post. So this method is easy to undo, and it closes posts only for as long as the setting stays on.

Method 5: Disable Comments Site-Wide with the Disable Comments Plugin

The Disable Comments plugin from WPDeveloper closes comments everywhere or only on the post types you choose. On our test site, version 2.9.0 removed the comment form, blocked new submissions and hid existing comments without deleting them. The plugin page on WordPress.org lists more than one million active installations.

  1. Install the plugin: Go to Plugins > Add Plugin and search for Disable Comments. Install and activate it.
  2. Open its settings: Go to Settings and click Disable Comments.
  3. Pick the scope: Choose Everywhere, or choose On Specific Post Types and tick Posts, Pages, Media or Products.
  4. Decide about old comments: Turn on Show Existing Comments if you want approved comments to stay visible.
  5. Save the change: Click Save Changes.
    Disable Comments plugin settings with Everywhere selected and Show Existing Comments on

With Everywhere on, we saw four results on the test site:

  • Form gone: The comment form disappeared from every post, and a direct submission returned HTTP 403.
  • Old comments hidden: Posts that had two comments showed none, and the database still held all of them.
  • REST API blocked: A comment sent to the REST API returned the code rest_comment_disabled.
  • Fully reversible: After we deactivated the plugin, the form and the old comments came back.

The plugin screen also warns that disabling comments disables trackbacks and pingbacks. Everywhere includes Products, and the plugin’s own text says reviews are stored as comments on that post type. WooCommerce stores should read the reviews section below before saving.

Method 6: Disable Comments Without a Plugin Using Code

Two WordPress filters close comments and pingbacks on every post type without a plugin. Put them in a small plugin file, because a snippet inside a theme file disappears when you switch themes. On our test site the filters removed the comment form, rejected new submissions and left existing comments visible.

The comments_open filter decides whether a post accepts comments, and WordPress has had it since version 2.5.0. Returning false closes every post, whatever its saved status says.

WordPress developer reference for the comments_open filter
Source: WordPress Developer Resources
  1. Create the folder and file: Make wp-content/plugins/close-comments/close-comments.php with SFTP or your host’s file manager.
  2. Paste the code: Add the lines below and save the file.
  3. Activate the plugin: Go to Plugins and click Activate under Close Comments.
<?php
/**
 * Plugin Name: Close Comments
 * Description: Closes comments and pingbacks on every post type.
 */

add_filter( 'comments_open', '__return_false', 20, 2 );
add_filter( 'pings_open', '__return_false', 20, 2 );

We ran this exact file as a normal plugin, as a must-use plugin and in a child theme. All three removed the form, and the two plugin versions returned HTTP 403 on a direct submission. A signed-in user posting through the REST API got the code rest_comment_closed.

To hide the comment options in the admin too, add this block to the same file. It removes comment and trackback support from every post type. On our test site the Discussion row left the editor and the comments column left the Posts list.

add_action(
	'init',
	function () {
		foreach ( get_post_types() as $type ) {
			remove_post_type_support( $type, 'comments' );
			remove_post_type_support( $type, 'trackbacks' );
		}
	},
	100
);

Warning: A site-wide filter also removes WooCommerce product reviews. On our test store it hid the Reviews tab and an existing review. Use this version instead to keep products untouched, and leave out the block above:

add_filter(
	'comments_open',
	function ( $open, $post_id ) {
		return 'product' === get_post_type( $post_id ) ? $open : false;
	},
	20,
	2
);

Add the same check to a matching pings_open filter if you want pingbacks closed on everything except products. We tested the version above and saw the Reviews tab stay in place on a product.

Filters cannot hide old comments in a block theme. We tried an empty comments_array filter on Twenty Twenty-Five. Both comments still showed. The Comments block reads them on its own. The next section covers that case.

Do not paste snippets into the Theme File Editor, because a typo there can take your site down. A child theme also works, and our guide to creating a WordPress child theme explains the setup. If you would rather have this handled and documented, our WordPress development services team can add it for you.

How to Disable Comments in WordPress on Pages and Media Files

New pages are closed by default, but uploaded media files are open by default. WordPress sets the default comment status of a page to closed in its core code. Media files only show a comment form when attachment pages are turned on, and since WordPress 6.4 new sites have them off.

On our test site, a page created from the command line came out closed. The Pages screen also offered the same Bulk Edit Comments menu as Posts. The WordPress core team’s attachment pages change note says existing sites kept their attachment pages when they upgraded.

With attachment pages switched on, one of our uploads showed a full comment form. With them off, the same URL redirected straight to the image file. Close comments on all existing media with one command:

wp post update $(wp post list --post_type=attachment --format=ids) --comment_status=closed
Comment form on a media attachment page

The Disable Comments plugin handles media with one tick, and the code filters above already cover it. If you want the pages gone entirely, read how to disable image attachment pages in WordPress.

How to Disable WooCommerce Product Reviews Without Touching Blog Comments

WooCommerce stores product reviews as comments. A site-wide comment block also removes your reviews. To keep reviews, exclude Products in the plugin or use the product-safe snippet. To turn reviews off, untick Enable product reviews under WooCommerce > Settings > Products.

  1. Open the setting: Go to WooCommerce, click Settings and open the Products tab.
  2. Find Reviews: Scroll to the Reviews heading near the bottom of the General section.
  3. Untick the box: Clear Enable product reviews and click Save changes.
    WooCommerce Enable product reviews setting

We turned the setting off on a product with one review. The Reviews tab and the form vanished from the product page. The review itself stayed in the database, and it came back when we ticked the box again.

Remove reviews only if you do not want public feedback on your products. Our guide on how to reward customers for writing reviews in WooCommerce covers the other direction.

How to Hide the Comments Section in a Block Theme

Block themes show comments through a Comments block inside the Single Posts template. They do not use a comments.php file. Closing comments removes the form but leaves that block showing old comments. To hide the whole section, delete the Comments block from the Single Posts template.

  1. Open the template: Go to Appearance, click Editor and open the Single Posts template.
  2. Open List View: Click Document Overview and expand the groups until you see Comments.
  3. Delete the block: Select Comments, press Delete and click Save.
    Comments block selected in the Single Posts template list view

On Twenty Twenty-Five the Comments block is a pattern row, and the editor confirmed with a Template updated notice. The front end then showed no comments section on a post that still had two comments. Classic themes behave differently: Twenty Twenty-One printed the line Comments are closed above its list of old comments.

Delete the block only when you want comments gone on every post. A closed post that keeps its old comments visible works as a record of past questions, and many sites prefer that. It is your call, and the template change is not tied to any single post.

The author line sits in a template block as well, and deleting it follows the steps to hide the author on a block theme.

How to Delete Existing Comments Instead

Move to Trash hides comments for 30 days by default and then deletes them for good. The Delete Comments tool in the Disable Comments plugin deletes them at once and skips the trash step. Neither is needed to disable comments, and both are permanent. Back up the database first.

  1. Open the Comments screen: Go to Comments in the WordPress admin.
  2. Select the comments: Tick the header checkbox to select every row on the page.
  3. Trash them: Choose Move to Trash in the Bulk actions menu and click Apply.
    Comments screen with Move to Trash chosen in the bulk actions

For large sites, the plugin’s Delete Comments tab can remove comments by post type and offers a Preview button first. On our test site, deleting only Posts removed all nine comments on posts and left a comment on a page untouched. A confirmation window warned that the action cannot be reversed without a database backup.

Delete Comments tab warning that order notes will also be deleted

Read the warning on the Everywhere option before you click. It says that on a WooCommerce site your order notes will also be deleted. Our guide to backing up the WooCommerce database shows how to take a safe copy first.

Which Method Should You Use to Disable Comments?

Here is how to disable comments in WordPress by goal: Settings for new posts, Bulk Edit for old posts and the plugin for everything. Pick the code snippet when you want no extra plugin. Whatever you choose, check a post in a private window afterward to confirm the form is gone.

Your goalBest method
Stop comments on posts you will publish laterMethod 1: the Discussion setting
Close a batch of old posts or pagesMethod 2: Bulk Edit
Close one post onlyMethod 3: the editor
Let posts close themselves with ageMethod 4: auto-close
Close everything including mediaMethod 5: the plugin
Avoid another pluginMethod 6: the code snippet
Keep product reviewsThe product-safe snippet or Products unticked

If you only want less spam, compare the best WordPress comment plugins before you switch comments off.

Three steps to close comments in WordPress safely

Conclusion

You can now handle how to disable comments in WordPress at any scale, from one post to a whole network of old content. Closing comments keeps the old ones in the database, and only the Trash and the Delete Comments tool remove them.

Pick the narrowest method that fits and close the new comments first. Then decide what to do with the old ones. Test the result logged out and keep a backup before anything permanent.

Frequently Asked Questions (FAQs)

Q1. Will old comments come back if I turn comments on again?

Yes, for every method that only closes or hides comments. When we deactivated the plugin, the form and all old comments returned. Comments that were trashed and passed the 30-day limit, or deleted with a plugin tool, cannot come back.

Q2. Can I disable comments on only some posts?

Yes. Use the Discussion option in the block editor for one post, or Bulk Edit for a batch. The plugin can also limit the change to chosen post types such as Pages or Media.

Q3. How do I disable comments on a WordPress page?

New pages are closed by default. For existing pages, open Pages, select them, choose Bulk edit and set Comments to Do not allow. You can also open a single page in the editor and choose Closed under Discussion.

Q4. Do I need a plugin to turn off comments on every post?

No. Settings and Bulk Edit cover new and existing posts, and two short filters cover the whole site. A plugin only saves you from writing code, and it adds tools like Delete Comments and role exceptions.

Q5. Does closing comments stop comment spam?

It stops it on every closed post. A direct submission to a closed post returned HTTP 403 on our test site. The same happened with the plugin and the snippet. Pingbacks and trackbacks have their own setting. Close those as well.

Q6. Why does my image have its own comment form?

WordPress opens comments on uploaded media by default. That form appears on the attachment page. Since version 6.4, new sites redirect attachment pages to the file. The form stays hidden there. Older sites may still show it.

Q7. Will the Comments menu disappear from the admin?

Not with the settings or the code above. In our test the Comments menu stayed in place even with a site-wide snippet. The Disable Comments plugin lists hiding Comments links in the admin menu among its features.

Q8. What does Comments are closed mean on my posts?

It means comments are closed on that post and the theme is saying so. Twenty Twenty-One printed that line above existing comments. Twenty Twenty-Five printed nothing. A block theme can show old comments with no notice at all.

Yash Kapoor
Yash Kapoor

Yash Kapoor is the founder and WordPress expert at DevDiggers, where he builds WordPress and WooCommerce plugins for loyalty programs, point-of-sale systems, digital wallets and affiliate management. He writes about developer tools, site performance and the technical side of running a WordPress store. He draws on years of building and maintaining production plugin codebases.

Leave a Reply

Your email address will not be published. Required fields are marked *