Where WordPress comments are switched off
WordPress comments are switched in four places. A full shut-off means you close all four. The Discussion default only changes posts you have not published yet.
- Future posts. Settings → Discussion. Clear Allow people to submit comments on new posts. Click Save Changes.
- Posts already live. Posts → All Posts. Select that screen, Bulk actions → Edit → Apply, set Comments to Do not allow, then Update. Repeat every screen.
- Pages and products. Open the item, set Discussion to Closed or clear Allow comments, and click Update.
- The POST file. If a private window still accepts a comment, deny wp-comments-post.php. Bots post to that file without loading the page.
| Switch | What it closes | What stays open |
|---|---|---|
| Discussion default | Comments on posts published after the save | Posts, pages, and products already open |
| Bulk edit, Do not allow | The posts or pages selected on that screen | Other screens, products, media, and the POST file |
| Discussion on one item | That post, page, or product | Every other item |
| comments_open and comments_array | The form and the visible thread | Database rows, the REST API, and XML-RPC |
| Deny wp-comments-post.php | Browser and bot posts to that file | Comments already stored, and API clients |
You are done with this map when a private window on an old post shows no form, and opening /wp-comments-post.php does not save a comment.
Turn off comments on new WordPress posts
The Discussion screen stops comments on future posts only. It does not change posts that are already published.
- Open the dashboard, then Settings, then Discussion.
- Under Default post settings, clear Allow people to submit comments on new posts.
- Clear Allow link notifications from other blogs if you also want pingbacks and trackbacks off.
- Click Save Changes at the bottom of the screen.
- Open a new draft and check Discussion. It should be closed. Open an old post. Its status should be unchanged.
On WordPress hosting this screen is inside WordPress. You do not need the hosting panel to change it.

Close comments on existing WordPress posts
Bulk edit closes comments on posts that are already published. The Discussion checkbox never does that job.
- Go to Posts, then All Posts.
- Tick the rows on this screen. The list is paged, so one pass does not cover the whole site. Filter by date or category when the list is long. The same clicks are in the bulk edit posts guide.
- Choose Edit under Bulk actions and click Apply.
- Set the Comments menu to Do not allow.
- Click Update.
- Open one of those posts in a private window. The form should be gone. Older comments can still sit on the page until you delete them.
Run the same bulk edit under Pages. Products are a separate list, covered in the next section.
Remove comment forms on pages and products
Pages and products keep their own comment switch. Closing posts does not close them.
WordPress leaves comments off on pages until someone turns them on. If a page still shows a form, open that page.
- Go to Pages, then All Pages, and open the page.
- Open the settings sidebar. If it is hidden, use the settings icon at the top right.
- Open Discussion. If that panel is missing, open the three-dot menu, choose Preferences, then Panels, and turn Discussion on.
- Choose Closed, or clear Allow comments. Click Update.
- On a product, reviews are comments on the product post type. Set that product's Discussion to Closed the same way. Bulk-edit Products when many are open.
Media attachments are a post type too. The Posts screen does not list them. The filters below close attachments with everything else. Reviews and page comments already stored stay until you delete them.
Block wp-comments-post.php after the form is gone
A missing form does not stop a bot. The comment still arrives when something POSTs to wp-comments-post.php.
That file is the front-end comment handler. It does not check whether the theme drew a form. Back up .htaccess in the WordPress root, then add this block above the WordPress rewrite rules.
<Files "wp-comments-post.php">
Require all denied
</Files>
Reload a post. A 500 means that server rejected the block: delete it and the site should come back. Opening /wp-comments-post.php should be forbidden, not a saved comment. Use this only when you want comments fully off.
The Discussion screen does not switch off comments sent through the REST API or XML-RPC. The Disable Comments plugin, published by WPDeveloper and not by WebJi®, adds settings for those two routes and a tool that deletes stored comments by type. Export the database first. That delete is permanent.
If you still want real comments and only want the spam gone, use Stopping WordPress comment spam. This guide is the full shut-off.
Close comments with functions.php filters
Three filters in a child theme close the form on every post type, including products and attachments. They do not delete stored comments.
Put the code in the child theme's functions.php, or in a small custom plugin. A parent theme update overwrites its own functions.php.
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 );
comments_open forces Closed. pings_open closes pingbacks. comments_array gives the template an empty list, so the old thread stops rendering. The rows stay in the database.
Check an old post in a private window. You should see no form and no thread. If the theme still prints Comments are closed, that line is in the theme template. Remove it in the child theme. These filters do not edit that sentence, and they do not remove the Comments item in the admin menu.
Copy functions.php before you edit it. A syntax error blanks the site. Restore the copy from the file manager if that happens.
Turn WordPress comments back on
Turn comments back on by undoing the same four places, in reverse. One block left in place keeps the form hidden.
- Delete the three filters, and delete the Files block in .htaccess.
- Open Settings, then Discussion. Tick Allow people to submit comments on new posts. Click Save Changes.
- Bulk-edit the posts you want open and set Comments to Allow. Click Update.
- Open one post, set Discussion to Open, and click Update.
- If Disable Comments is still set to everywhere, deactivate it or change that setting. Otherwise the form stays off.
- In a second browser, post a test comment. It should land under Comments. Rows you moved to trash can be restored until the trash is emptied.
Questions about disabling WordPress comments
Does the Discussion setting disable comments on old posts?
No. Clearing Allow people to submit comments on new posts changes the default for posts you publish after you save. Posts already published keep the status they had. Close those with bulk edit, one screen at a time.
How do I bulk close comments in WordPress?
Open Posts, then All Posts. Select the rows on that screen, choose Edit under Bulk actions, and click Apply. Set Comments to Do not allow, then Update. Repeat for the next screen, and do the same under Pages.
Does closing comments delete existing comments?
No. Closed only stops new comments. The old thread can still show. Hide it with a comments_array filter, or move the rows to trash under Comments and empty the trash when you are sure.
How do I turn off WooCommerce product reviews?
Reviews are comments on the product post type. Open the product, set Discussion to Closed, and click Update. Use bulk edit on Products when many are open. Reviews already stored stay until you delete them.
Why do comments still arrive after the form is gone?
Bots post straight to wp-comments-post.php and never load the page. Deny that file, or the request can still create a comment. A client can also send a comment through the REST API or XML-RPC, which the Discussion screen does not switch off.
Can I enable comments again later?
Yes. Remove the filters and the .htaccess block, tick the Discussion default, and set the posts you want back to Allow. Comments you have emptied from trash are gone.

