How to Disable Comments in WordPress
Turning off comments for new posts does nothing to existing ones. Close them site-wide, close them in bulk on published content, and hide what remains — three separate steps.
Three things have to happen for comments to disappear completely: stop new posts from allowing them, close them on posts already published, and stop the theme from rendering leftover comment sections. Doing only the first is why "I disabled comments and they are still there" is such a common complaint.
Step 1: turn them off for new content
Go to Settings → Discussion and untick Allow people to submit comments on new posts.
Also worth setting on the same screen:
- untick Allow link notifications from other blogs to stop pingbacks and trackbacks, which are almost entirely spam;
- require registration if you want to keep comments but cut abuse;
- set moderation so nothing appears without approval.
This affects future posts only.
Step 2: close comments on existing posts
- Go to Posts → All Posts and set Screen Options to show a high number per page.
- Tick the box in the header to select everything on the page.
- Choose Edit in the Bulk Actions dropdown and click Apply.
- Set Comments to Do not allow.
- Click Update.
Repeat for Pages, and for Media if attachment pages are reachable on your site — media attachments have their own comment setting and are frequently missed.
With WP-CLI the whole job is one command:
wp post list --post_type=post,page,attachment --format=ids \
| xargs -d ' ' -I % wp post update % --comment_status=closed --ping_status=closed
Step 3: deal with comments already published
Closing comments hides the form, not the existing thread. Choose what should happen to them:
- Keep them if the discussion has value. Nothing more to do.
- Hide them by unapproving in bulk under Comments.
- Delete them permanently — take a backup first, since this cannot be undone.
# Preview the count before deleting anything.
wp comment list --format=count
# Delete all comments, permanently.
wp comment delete $(wp comment list --format=ids) --force
Step 4: remove the leftovers in the interface
Even with everything closed, WordPress keeps a Comments menu, a dashboard widget and a discussion column. A comment-control plugin removes all of it in one click, which is the sensible choice for most sites.
To do it in code, put this in a small custom plugin rather than the theme, so it survives a theme change:
<?php
// Hide the admin menu item.
add_action('admin_menu', function () {
remove_menu_page('edit-comments.php');
});
// Remove the dashboard widget.
add_action('wp_dashboard_setup', function () {
remove_meta_box('dashboard_recent_comments', 'dashboard', 'normal');
});
// Remove the admin bar entry.
add_action('wp_before_admin_bar_render', function () {
global $wp_admin_bar;
$wp_admin_bar->remove_menu('comments');
});
// Refuse comments everywhere, as a belt-and-braces measure.
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);
Removing the admin bar entirely is a different job — see how to remove the WordPress admin bar.
Step 5: check the theme
Some themes render a comments area regardless of the setting, particularly page builders and older themes with hard-coded template calls.
If a comment section still appears:
- Confirm the post's own setting is closed by opening it in the editor and checking the Discussion panel.
- Look for a theme option under Appearance → Customize controlling comment display.
- In a block theme, remove the Comments block from the single-post template under Appearance → Editor.
- As a last resort, hide it with CSS — this is cosmetic only and does not stop submissions, so use it alongside the steps above, not instead of them.
Spam that arrives with comments closed
Closed comments do not stop bots from POSTing directly to wp-comments-post.php. If your logs show that traffic:
- block the endpoint at the server or firewall once you are sure no comments are wanted;
- disable XML-RPC pingbacks if nothing depends on XML-RPC;
- keep an anti-spam plugin active if you intend to reopen comments later.
If bot traffic is heavy enough to affect performance, the wider picture is in how to speed up a WordPress site.
Turning comments back on
Reverse the same three steps: enable the Discussion setting, bulk-edit existing content to allow comments, and remove the code snippets or plugin. Comments deleted in step three are gone permanently — another reason to unapprove rather than delete when you are unsure.
Frequently asked
- The Discussion setting only applies to newly created posts. Existing posts keep their own per-post setting until you change it in bulk.
- No. Closing comments hides the form; the stored comments remain in the database and may still display unless you also remove or hide them.
- Genuine discussion can add relevant content and engagement. Spam comments do the opposite, which is the usual reason sites turn them off rather than moderate them.