How to disable comments in WordPress (every method)
Disable WordPress comments in 4 ways, or keep them on without the spam: CommentCamp, $0 for site owners, has spam filtering built in. The 4 ways are Settings > Discussion, Bulk Edit, the Disable Comments plugin (1+ million installs) and a PHP snippet. None of them delete the comments you already have, so remove those on the Comments screen, where trashed comments are deleted for good after 30 days.
- Main methods
- 4
- Plugin active installs
- 1,000,000+
- Trashed comments deleted
- After 30 days
- Posts per screen
- 20 default, 999 max
Before you switch comments off
If spam is the real reason, you may not need to turn comments off at all. Keep the conversation and hand off the spam work: CommentCamp is our free comments and community platform, launching with an official WordPress plugin, automated spam filtering and a moderation queue, and site owners pay $0, with no ads. It's in private early access: join the waitlist to get an invite as rollout expands.
If you stay on WordPress's own comments, our comment spam guide covers the setup. WordPress already:
- holds comments with 2 or more links for moderation by default
- rejects a new comment from the same IP address or email within 15 seconds of the last one
- lets you require manual approval or a previously approved comment, add moderation keywords and close comments on old posts (14 days by default once switched on)
Then add a filter from our WordPress anti-spam plugins guide: Akismet Anti-spam (5+ million active installs; pay what you want for non-commercial sites, or $9.95 per month billed yearly on Pro) or the free Antispam Bee (700,000+ active installs).
Turn off comments on new posts
- Go to Settings > Discussion.
- Under "Default post settings", uncheck "Allow people to submit comments on new posts".
- Optionally uncheck "Allow link notifications from other blogs (pingbacks and trackbacks) on new posts" and "Attempt to notify any blogs linked to from the post".
- Click Save Changes.
All three boxes are on by default in a new install. WordPress notes right below them: "Individual posts may override these settings. Changes here will only be applied to new posts." New pages already start with comments closed. Every option on that screen is explained in WordPress comment settings.
Close comments on existing posts and pages
Older posts keep their own setting, so close them in bulk:
- Go to Posts > All Posts (or Pages > All Pages).
- Optional: in Screen Options, raise "Number of items per page" from the default 20 (the maximum is 999).
- Tick the checkbox at the top of the list to select every post on the page.
- Choose "Edit" from Bulk actions and click Apply.
- Set Comments to "Do not allow" (and Pings too, if you like), then click Update.
For a single post, open it in the block editor, go to the Discussion panel in the sidebar and choose "Closed". WordPress describes it as: "Visitors cannot add new comments or replies. Existing comments remain visible." In the post list, Quick Edit has an "Allow Comments" checkbox that does the same.
With WP-CLI, one command closes comments on all your posts:
wp post update $(wp post list --post_type=post --format=ids) --comment_status=closed
Turn off comments on media attachments
Attachments support comments, but the Media Library has no Bulk Edit. Since WordPress 6.4 (2023), new installs disable attachment pages: an attachment URL redirects to the file itself, so there's no page to comment on.
Sites upgraded from older versions keep attachment pages on. You can switch them off with WP-CLI, which sets the wp_attachment_pages_enabled option from 1 to 0:
wp option set wp_attachment_pages_enabled 0
The plugin and the snippet below also cover media.
Disable comments site-wide with a plugin
The free Disable Comments plugin by WPDeveloper has 1,000,000+ active installs and 4.7 stars from 281 ratings (version 2.9.1, updated October 25, 2026). It switches comments off everywhere, or only on the post types you pick: posts, pages or media.
With comments off, it also:
- hides "Comments" from the admin menu, the admin bar and the Dashboard
- hides the Discussion settings page and disables comment widgets
- disables comment RSS and Atom feeds and outgoing pingbacks, and removes the X-Pingback header
- can block comments sent through XML-RPC and the REST API
It supports WP-CLI (for example, wp disable-comments settings --types=post) and multisite networks, and it can exclude user roles. Deactivating it restores your previous comment behavior, because it filters comment status at runtime instead of rewriting your posts.
Note: The plugin says to delete existing comments before applying its settings, or some themes may keep showing them. It also says not to use it for closing comments on individual posts, since WordPress already does that.
Disable comments with a code snippet
Prefer no plugin? Add this to a child theme's functions.php file or a code snippets plugin. If you edit a parent theme's functions.php directly, the next theme update can wipe your change.
// Close comments and pings on every post type
add_filter( 'comments_open', '__return_false', 20 );
add_filter( 'pings_open', '__return_false', 20 );
// Hide existing comments in classic and block themes
add_filter( 'comments_array', '__return_empty_array', 20 );
add_filter( 'get_comments_number', '__return_zero', 20 );
// Remove comment support from every post type
add_action( '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' );
}
}
}, 100 );
// Remove the Comments menu and the admin bar icon
add_action( 'admin_menu', function () {
remove_menu_page( 'edit-comments.php' );
}, 100 );
add_action( 'admin_bar_menu', function ( $wp_admin_bar ) {
$wp_admin_bar->remove_node( 'comments' );
}, 100 );
The snippet closes comments and pingbacks everywhere, hides existing comments (block themes skip the Comments block when comments are closed and the count is 0), and removes the Comments menu and admin bar icon. It deletes nothing: remove it and your comments come back as they were.
If you use Notes in the block editor (WordPress 6.9 and later), test them afterward. Notes are a comment type, and the Disable Comments plugin explicitly keeps them working.
Delete the comments you already have
Closing comments doesn't remove old ones. To delete them in the dashboard:
- Go to Comments.
- Tick the checkbox at the top to select every comment on the page (raise the per-page number in Screen Options for big batches).
- Choose "Move to Trash" from Bulk actions and click Apply.
- Open the Trash view and click Empty Trash. The Spam view has an Empty Spam button.
If you leave them, WordPress permanently deletes trashed comments after 30 days. With WP-CLI, you can delete comments in one go; --force skips the Trash:
wp comment delete $(wp comment list --format=ids) --force
Tip: Back up your database first. Emptying the Trash, WP-CLI's --force and the plugin's Delete Comments tool can't be undone.
Which method should you use?
If spam is the only reason, CommentCamp lets you keep comments on, with free spam filtering and a moderation queue built in. To switch them off, match the method to the scope:
| Method | Scope | Needs plugin | Reversible |
|---|---|---|---|
| Settings > Discussion | New posts | No | Yes |
| Bulk Edit | Selected posts or pages | No | Yes |
| Discussion panel or Quick Edit | One post or page | No | Yes |
| Disable Comments plugin | Everything, or chosen post types | Yes | Yes, except its Delete Comments tool |
| Code snippet | Every post type | No | Yes, remove the snippet |
| WP-CLI | Posts, attachment pages or comments | No | Status changes yes; --force deletes no |
| Deleting comments | Existing comments | No | Only until the Trash is emptied |
A small blog that just wants the form gone needs Settings > Discussion plus Bulk Edit. If you want comments gone from the admin too, including media on an older site, use the plugin or the snippet.
Frequently asked questions
Why are comments still showing on my WordPress posts after I disabled them?
The Discussion setting only applies to posts you publish afterward, and closing comments never hides approved ones. Close older posts with Bulk Edit, then hide existing comments with a code snippet or delete them on the Comments screen.
How do I disable comments on pages in WordPress?
New pages start with comments closed. For existing pages with comments open, go to Pages, All Pages, select them, choose Edit from Bulk actions, click Apply, set Comments to Do not allow and click Update.
Does disabling comments in WordPress delete existing comments?
No. Closing comments in the Discussion settings or with Bulk Edit only stops new comments, and existing ones stay in your database. To remove them, move them to the Trash on the Comments screen and click Empty Trash, or use WP-CLI or the Disable Comments plugin's Delete Comments tool.
How do I turn off comments on a single WordPress post?
Open the post in the block editor, open the Discussion panel in the sidebar and choose Closed. Or go to Posts, All Posts, hover over the post, click Quick Edit, uncheck Allow Comments and click Update.
Will deactivating the Disable Comments plugin delete my comments?
No. The plugin filters comment status while it runs instead of rewriting your posts, so deactivating it restores your previous comment settings. Only comments removed with its Delete Comments tool are gone for good, and that tool warns it cannot be undone.
Sources
- wordpress.org/documentation/article/settings-discussion-screen
- wordpress.org/documentation/article/comment-moderation
- wordpress.org/documentation/article/posts-screen
- wordpress.org/documentation/article/page-post-settings-sidebar
- wordpress.org/documentation/article/comments-in-wordpress
- make.wordpress.org/core/2023/10/16/changes-to-attachment-pages
- wordpress.org/plugins/disable-comments
- github.com/WordPress/wordpress-develop/blob/trunk/src/wp-incl...
- developer.wordpress.org/cli/commands/comment/delete
- developer.wordpress.org/cli/commands/post/update
- wordpress.org/plugins/akismet
- wordpress.org/plugins/antispam-bee
Prices and plan limits checked on October 30, 2026.