Completely Disable Comments on Your WordPress Site

Unchecking 'Allow comments' barely does anything. Here's how to fully remove WordPress comments—front end, admin, existing posts, XML-RPC and REST—in one place.

WordPress turns comments on everywhere by default—every post, every page, every custom post type. For a blog built on discussion, great. For a business site, a portfolio, or a landing page, comments are pure liability: a spam magnet, an attack surface, and a steady trickle of admin work for zero benefit. The catch is that the obvious fix—unchecking “Allow comments”—barely does anything. Here’s how to actually remove them, completely and reversibly.

The essentials

  • Unchecking “Allow comments” only affects new posts—existing posts, the admin menu, the database and pingbacks all stay.
  • Full removal means: disable on post types, close existing, hide from admin, and block XML-RPC + REST comment endpoints.
  • The module works site-wide or per post type, so you can kill comments everywhere or only on pages while keeping them on the blog.
  • It strips the X-Pingback header, unregisters the Recent Comments widget, and redirects edit-comments.php—closing the whole spam and DDoS-amplification surface.
  • It’s reversible: turn it off and everything comes back, with no leftover code or settings. Only “delete all comments” is permanent.

Why is unchecking “Allow comments” not enough?

Because Settings → Discussion is far weaker than it looks. Unchecking “Allow comments” changes the default for future posts only. Everything already on your site keeps its comment_status = 'open', so old posts still accept comments at the database level. The Comments menu stays in your admin, the wp_comments and wp_commentmeta tables remain, and—crucially—pingbacks keep working through XML-RPC.

That last part matters beyond tidiness. Comment forms are a well-worn target for spam, XSS and injection attempts, and the XML-RPC pingback endpoint can be abused for DDoS amplification, using your site to attack others. “Disabling comments” halfway leaves all of that live.

Here’s where comments keep coming back—and what closes each gap:

Where comments lingerThe native settingWhat the module does
Existing postsDiscussion only affects new posts; old ones keep comment_status openCloses comments and pings on every existing post
Admin UIComments menu, columns and metabox stayHides the menu, columns, metabox and dashboard widget
Databasewp_comments and wp_commentmeta remainCan delete all comments and reset each post’s count
XML-RPC pingbacksKeep workingFilters out the XML-RPC comment methods
REST APIComment endpoint stays openBlocks REST comment creation
HTML head / headersComment feed link and X-Pingback still emittedStrips the feed link and the X-Pingback header

What does completely removing comments actually require?

Seven distinct things, which is exactly why doing it by hand in functions.php is so error-prone:

  1. Close comments and pingbacks on all existing posts.
  2. Remove comment support from every (or selected) post type.
  3. Hide the Comments menu, dashboard widget, columns and metabox from the admin.
  4. Strip the comment feed link from your HTML head.
  5. Remove the X-Pingback header from responses.
  6. Unregister the Recent Comments widget.
  7. Block comment creation via XML-RPC and the REST API.

Miss any one and you’ve left a gap—an open endpoint, a lingering menu, a database still filling with spam. A dedicated module closes all seven at once.

How do you disable comments with Blaminhor Essentials?

To remove comments completely, switch off comment support across your post types, close comments on existing posts, hide the comment UI in the admin, and block the XML-RPC and REST endpoints. In Blaminhor Essentials, turning on the Disable Comments module does all of that at once—site-wide or per post type—and can optionally delete every existing comment.

The moment it’s on, comments are blocked site-wide: comments_open and pings_open return false, comment support is pulled from your post types, the feed link and X-Pingback header are stripped, and the Recent Comments widget is deregistered.

The Disable Comments module: a site-wide vs per-post-type choice, a hide-from-admin toggle, and buttons to close or delete existing comments. One screen: choose the scope, hide the UI, and clean up existing comments—no code, no functions.php surgery.

Site-wide or just some post types

You’re not stuck with all-or-nothing. Leave it in everywhere mode to disable comments across the whole site, or switch to per-post-type mode and pick exactly which types lose comments—kill them on pages and products while keeping them on blog posts, for instance.

Clean up the admin

With “Hide from Admin” (on by default), every trace of comments leaves your dashboard: the Comments menu disappears, comment columns vanish from post lists, the metabox is removed from the editor, the dashboard widget is gone, and visiting edit-comments.php bounces back to the dashboard.

Block the back doors

Two toggles—both on by default—close the endpoints the front end can’t see: XML-RPC comment methods are filtered out (killing pingback abuse) and REST API comment creation is blocked. In per-post-type mode, REST stays available for the types you left alone and only blocks the disabled ones.

Close, or delete, existing comments

  • Close existing comments runs a single database update setting comment_status and ping_status to closed on every post, and tells you how many it changed.
  • Delete all comments permanently clears wp_comments and wp_commentmeta and resets every post’s comment_count to zero.

Can you turn comments back on later?

Yes—everything except deletion is reversible. Deactivate the module and WordPress returns to its stock behaviour: comments reopen, menus and widgets reappear, endpoints come back. Because the module works entirely through WordPress’s own hooks, it leaves no residual code or orphaned settings in your database when it’s off. If you’d only closed existing comments, those stay closed, but you can reopen any of them from the bulk-edit screen.

Lighter, cleaner, safer

Disabling comments isn’t cosmetic. It shrinks your database, trims your attack surface, drops needless queries, and deletes a recurring chore. For any site that doesn’t live on reader interaction, it’s one of the highest-value five-minute jobs you can do.

Disable Comments is one of the 20+ tools in Blaminhor Essentials—free and open-source on WordPress.org.

Download Blaminhor Essentials

– blaminhor

FAQ

Is disabling comments good for security and performance?

Yes. Comment forms are a classic spam and injection target, and the XML-RPC/pingback endpoints can be abused for DDoS amplification. Removing comments cuts that attack surface, stops spam from bloating wp_comments and wp_commentmeta, and removes comment queries and admin clutter you never use.

How do I disable comments without a plugin?

You can, but it takes seven separate edits in functions.php: closing comments on existing posts, removing comment support per post type, hiding the admin UI, stripping the feed link and X-Pingback header, unregistering the widget, and blocking XML-RPC and REST. Miss one and a gap stays open, which is why a dedicated module is safer.

How do I stop comment spam without disabling comments?

If you genuinely want discussion, keep comments on but add moderation: require approval before anything publishes, enable Akismet or a comparable anti-spam filter, add a honeypot or CAPTCHA, and close comments automatically on posts older than a set number of days. Disabling is only the right call when you never wanted comments at all.

Does disabling comments hurt SEO?

No. Comments can add fresh keyword-rich text, but spam-filled or empty comment sections do the opposite—thin content, spammy outbound links and slower pages. On a business site, portfolio or landing page that never hosts real discussion, removing comments is neutral to positive for SEO and trims your crawl surface.

How do I remove the « Comments are closed » message?

Closing comments often leaves themes printing « Comments are closed » where the form used to be. Removing comment support from the post type entirely—not just closing the thread—stops the comment template from rendering, so that line disappears. The Disable Comments module does exactly this, so no leftover message shows.

Will disabling comments delete my existing comments?

No, not unless you ask it to. Closing comments only stops new ones and hides the threads; your existing comments stay in the database untouched and reappear if you re-enable. Deleting them is a separate, deliberate action that asks for confirmation—because unlike everything else, wiping wp_comments is permanent.

blaminhor Building what's missing.

Comments