Why Disable WordPress Comments
Comment spam is a persistent problem for WordPress sites, especially those with significant traffic. Thousands of automated bots daily attempt to post spam links, malware, or misleading advertisements on vulnerable WordPress installations. Even with a robust moderation queue, hundreds of spam comments can slip through daily, consuming administrative time and resources.
Beyond the spam problem, comments sections present security risks ranging from XSS vulnerabilities to SQL injection vectors. For many websites—especially news sites, blogs, and marketing content—comments aren't necessary. Readers consume content, but don't need to provide feedback through a comments form.
Benefits of disabling comments: Eliminate 99% of comment spam, reduce admin moderation workload to zero, improve website security, reduce database size, zero impact on SEO ranking, reduce JavaScript and performance overhead from comment systems.
This guide covers nine complete methods to disable WordPress comments—from global site-wide disabling to advanced spam filtering, Akismet setup, and database cleanup strategies.
Disable Comments Site-Wide — Method 1: Settings > Discussion
The simplest approach is to disable comments across your entire site from the WordPress Admin Dashboard in just 2-3 clicks.
Steps to Disable All Comments
- Log into WordPress Admin Dashboard → go to Settings > Discussion
- Find the "Default article settings" section
- Uncheck the checkbox for
Allow people to post comments on new posts - To also disable pingbacks/trackbacks, uncheck
Allow link notifications from other blogs (pingbacks and trackbacks) - Scroll down and click Save Changes
Important: This setting applies only to new posts. Existing posts may still have comment forms enabled. To close comments on legacy posts, follow Method 4 below.
Disable Comments Per Post Type — Method 2: functions.php
If you want fine-grained control—for instance, disable comments on Pages but keep them on Posts—use custom code in your theme's functions.php file.
Code to Disable Comments on Pages Only
Go to Appearance > Theme File Editor > functions.php and add this code at the end of the file:
add_filter( 'comments_open', function( $open, $post_id ) { return ( get_post_type( $post_id ) === 'page' ) ? false : $open; }, 10, 2 );
This code disables comments only on pages while preserving comment functionality for regular posts.
Hide Comment Count Display — Method 3: Remove Comment Indicators
Beyond closing the comment form, you should also remove comment count links from blog post listings, since displaying "0 comments" still signals that the comment feature exists.
Remove Comment Count Badge
Add this code to functions.php to hide comment count displays:
add_filter( 'comments_number', '__return_empty_string' );
This ensures no comment count appears in post archives or single post views.
Disable Pingbacks and Trackbacks — Method 4: Legacy Notifications
Pingbacks and trackbacks are automated notifications sent when external sites link to your posts. These features are outdated and attract massive spam volumes. Disable both.
Steps to Disable Pingback/Trackback
- Settings > Discussion
- Uncheck
Allow link notifications from other blogs (pingbacks and trackbacks) - Click Save Changes
Akismet Anti-Spam Setup — Method 5: If Comments Are Enabled
If your site requires a comment section, Akismet is the industry-standard anti-spam plugin that filters out 99% of comment spam automatically.
Install and Activate Akismet
- Go to Plugins > Add New and search for "Akismet Anti-Spam"
- Click Install Now → Activate
- Go to Settings > Akismet and click "Set up your Akismet account"
- Sign up at akismet.com—choose Personal (free) for personal blogs, or Business plan ($4-5/month) for commercial sites
- Copy your API key from akismet.com and paste it into WordPress
Licensing note: The free Akismet Personal plan is strictly for non-commercial personal blogs. Commercial websites must upgrade to the Business plan to comply with terms of service.
Configure Comment Moderation Queue — Method 6: Manual Approval
If you want comments visible but reviewed first, enable moderation so every comment requires admin approval before publication.
Enable Moderation Workflow
- Settings > Discussion
- Under "Before a comment appears," check
Comment must be manually approved - Click Save Changes
This setting ensures all new comments enter a queue pending admin review, adding a security layer against malicious content.
Add Honeypot Field — Method 7: Bot Spam Prevention
A honeypot is an invisible form field that looks like a normal input to bots but is hidden from humans via CSS. If the field gets filled, the submission is rejected as bot activity.
Implement Honeypot Protection
Add this code to functions.php to create a honeypot field:
add_action('comment_form_logged_in_after', 'add_honeypot_field');add_action('comment_form_after_fields', 'add_honeypot_field');
Alternatively, use a plugin like "Honeypot for Comments" which handles the implementation without custom coding.
Bulk Close Comments on Existing Posts — Method 8: Quick Batch Action
If you need to close comments on all existing posts without visiting each one individually, use bulk edit.
Bulk Edit Comment Status
- Go to Posts > All Posts and select all posts (check "Select All")
- In the Bulk Actions dropdown, select Edit
- In Comment Status, choose "Closed"
- Click Apply
Delete Spam Comments via WP-CLI — Method 9: Command Line Cleanup
For sites with thousands of accumulated spam comments, WP-CLI allows bulk deletion from the command line in seconds.
Delete All Spam Comments
wp comment delete --status=spam --force
This command permanently removes all comments marked as spam without requiring admin panel access, saving hours of manual deletion.
Comparison Table — Disable vs. Moderate vs. Filter
| Aspect | Disabled | With Moderation | With Akismet |
|---|---|---|---|
| Spam reaching site | 0 | Low (reviewed) | 99% filtered |
| Admin workload | None | High (approve each) | Low (auto-filtered) |
| User engagement | None | Possible | Enabled |
| Database bloat | No growth | Accumulates | Accumulates |
| SEO impact | None | None | None |
| Security level | High | Medium | High |
| Cost | Free | Free | $4-5/month |
Conclusion: If comments aren't essential, disable them entirely. If engagement is critical, use Akismet—moderation by hand is time-intensive and impractical at scale.
Complete Comment Disabling Workflow
To fully disable comments with zero remnants, follow these steps in order:
- Settings > Discussion → disable comments and pingbacks site-wide
- Posts > All Posts → bulk edit to close comments on legacy posts
- Comments admin page → delete old comments (optional)
- Add code to functions.php to hide comment count displays
- Update theme templates to remove comment section markup from single post views
Result: After completing these steps, your site will have zero comment functionality. Spam comments will stop arriving, your database will remain lean, and site performance will improve.
Start with AsiaGB WordPress Hosting — DirectAdmin, One-Click WordPress Install
WordPress hosting fully compatible with comment moderation, Akismet integration, DirectAdmin management, 99% uptime guarantee, and SSD storage for maximum performance.
View Hosting Plans