21+ years in hosting · Jaipur, India · INR billing with 18% GST · 24/7 email support
Blog · WebJi® India

How to Disable Comments in WordPress

Quick answer

WordPress comments are switched off in four places: Settings, Discussion, for new posts; bulk edit for published posts; the per-page Discussion panel for pages and products; and wp-comments-post.php for bots. The Discussion checkbox only affects future posts — old posts keep their status until you bulk-edit them closed.

A full shut-off in the working order, plus the moderation-list middle path for sites that want comments.

✓ In business since 2005
✓ INR + GST billing
✓ 24/7 Email Support — avg reply < 60 min
GuideWebJi®
knowledge
Read time
5 min
Sections
7
Updated
14 Nov 2026
Written by
WebJi® team

Where are WordPress comments switched off?

WordPress holds the comment switch in four separate places, and a full shut-off closes all four — the common surprise being that the Settings checkbox only governs posts you have not published yet.

Four comment switches: what each one closes and leaves open
SwitchClosesLeaves open
Settings › Discussion defaultPosts published after the saveEverything already live
Bulk edit, “Do not allow”The posts or pages selected on that screenOther screens, products, the POST file
Per-item Discussion panelThat page, post or productEvery other item
Deny wp-comments-post.phpBrowser and bot submissions to the handlerStored comments and API clients

You are done when a private window on an old post shows no form, and posting directly to /wp-comments-post.php saves nothing. The shut-off lives entirely inside WordPress — no hosting panel needed on WordPress hosting.

How do you turn off comments on new posts?

Clear “Allow people to submit comments on new posts” under Settings › Discussion — that changes the default for future posts only, never posts already published.

  1. Open the dashboard, then Settings › Discussion.
  2. Under Default post settings, clear Allow people to submit comments on new posts.
  3. Clear Allow link notifications from other blogs too, if pingbacks and trackbacks should also stop.
  4. Click Save Changes, then verify: a fresh draft shows Discussion closed, an old post shows its status unchanged.

How do you close comments on posts that are already published?

Bulk edit is the only built-in way to close live posts: select them on Posts › All Posts, set Comments to “Do not allow”, and repeat screen by screen. The Discussion default never touches them.

  1. Go to Posts › All Posts and tick the rows on this screen; the list is paged, so one pass never covers the whole site — filter by date or category on long lists.
  2. Choose Edit under Bulk actions and click Apply.
  3. Set the Comments control to Do not allow and click Update.
  4. Open one of those posts in a private window: the form should be gone. Older comments can still sit on the page until removed.

The same clicks work under Pages — the full bulk-edit walkthrough, including the traps, is in bulk editing WordPress posts.

What about pages, WooCommerce products and attachments?

Pages and products keep their own per-item comment switch, and WooCommerce reviews are simply comments on the product post type — so closing posts closes neither.

  • Pages: open the page, show the settings sidebar, open the Discussion panel (enable it via the three-dot menu › Preferences › Panels if missing), set Closed, Update. WordPress keeps comments off on pages by default unless someone turned them on.
  • Products: open the product, set its Discussion to Closed — that is what “disable reviews” means per item; bulk-edit the Products list when many are open.
  • Attachments: media files are a post type too and never appear on the Posts screen; the code route below covers them in one move.

Reviews and page comments already stored stay until you delete them — closing the switch stops new ones only.

How do three lines in functions.php close every post type?

Three filters in a child theme's functions.php force comments closed and threads hidden across every post type — posts, pages, products and attachments — without touching stored rows.

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 everywhere, pings_open stops pingbacks, and comments_array hands the template an empty list so old threads stop rendering (the rows stay in the database). Two cautions: put the code in a child theme or a small custom plugin — a parent theme update overwrites its functions.php — and copy the file before editing, because a syntax error blanks the site until you restore it. If the theme still prints “Comments are closed”, that sentence lives in the theme template; remove it in the child theme, as these filters do not touch it.

Why do bot comments still arrive after the form is gone?

Bots POST straight to wp-comments-post.php without ever loading the page, so a missing form stops nothing — deny that file once you want comments fully off.

Back up the .htaccess file in the WordPress root, then add this block above the WordPress rewrite rules:

<Files "wp-comments-post.php">
Require all denied
</Files>

Opening /wp-comments-post.php should now be forbidden, not a saved comment. A 500 after the change means the server rejected the block — delete it and the site returns. The Discussion screen also does not govern the REST API or XML-RPC routes; the Disable Comments plugin (published by WPDeveloper, not by WebJi®) adds switches for both plus a delete-by-post-type tool — export the database first, because that delete is permanent.

Prefer keeping comments? The moderation lists and blocklist

If the goal is less spam rather than no comments, the same Settings › Discussion screen carries two word lists that filter submissions before they ever publish.

  • Comment Moderation: a comment containing any listed word (in content, name, URL, email or IP) is held for your approval instead of appearing at once.
  • Disallowed comment keys (labelled Comment Blocklist on older WordPress versions): any listed word sends the comment straight to trash.
  • Comment author must fill out name and email plus Comment must be manually approved — the checkboxes just above the lists — cover most manual spam without any plugin.

One word per line, and remember the lists match substrings: listing “spam” also bins “spammer”. The fuller anti-spam toolkit — moderation queues, anti-spam plugins and rate limits — is in stopping WordPress comment spam; this guide remains the full shut-off path.

FAQ

Frequently asked questions

Does the Discussion setting disable comments on old posts?

No. Clearing “Allow people to submit comments on new posts” changes only the default for posts published after the save. Posts already live keep their status — close them with the bulk edit under Posts › All Posts, one screen at a time, and the same under Pages.

Does closing comments delete the comments already on the site?

No. “Do not allow” stops new submissions only; the stored thread can still render. Hide old threads with the comments_array filter, or move rows to trash under Comments in the admin and empty the trash when certain — trashed comments are recoverable until then.

How do I turn off WooCommerce product reviews?

Reviews are comments on the product post type. Open the product, set its Discussion panel to Closed, and Update; bulk-edit the Products list when many are open. Stored reviews remain until deleted, and the product page shows the review form only where the switch is still open.

Can I disable comments without a plugin?

Yes — the four-switch path in this guide is plugin-free: the Discussion default, bulk edit, per-item panels, and the .htaccess deny for wp-comments-post.php, plus optionally the three functions.php filters. A plugin earns its place only when you also want the REST API and XML-RPC routes switched off in one screen.

How do I turn comments back on later?

Undo each switch in reverse: remove the filters and the .htaccess block, tick the Discussion default, and bulk-edit the posts you want open back to Allow. Any block left in place keeps the form hidden. Then post a test comment from a second browser to confirm it lands under Comments.

Last editorial update: 15 November 2026.

WebJi® since 2005

Ready to get started with WebJi®?

Join 12,000+ businesses across India and overseas. INR pricing, 18% GST shown before payment and 24/7 email support in Hindi and English — average first reply under 60 minutes.