There are several valid reasons you might want to disable comments on your WordPress site:
- Reduce spam management: Even with anti-spam plugins, moderating comments can be time-consuming
- Improve site performance: Comment systems add extra code and database queries
- Create a cleaner user experience: Some content simply doesn’t benefit from comment sections
- Shift discussions elsewhere: You might prefer engagement on social media platforms instead
- Eliminate moderation workload: No comments means no need for constant monitoring
Whatever it is, for some reason it always ends up being a pain. So for future reference, mine and yours, I’ve put together a brief run-through of how to disable it and what to keep in mind.
The Standard Approach: Disable via Settings
WordPress does provide built-in options to disable comments for new posts. Here’s how:
- Go to Settings → Discussion in your WordPress dashboard
- Uncheck the box for “Allow people to submit comments on new posts”
- Save your changes
However, this method has a critical limitation: it only affects new content. All your existing posts will still have comments enabled, leaving you with an inconsistent user experience.
The Better Solution: Using a Code Snippet
While there are numerous plugins designed to disable comments, many are bloated with features you don’t need or haven’t been updated in years. Even custom code solutions found online often fail in practice. At Kahunam our approach is to never use plugins unless we really need to.
The most efficient approach is using a lightweight code snippet that completely disables comments across your entire site—both new and existing content.
Step 1: Install a Snippet Manager Plugin
Before adding any code, you should use a dedicated snippet manager. This makes managing custom code safer and easier than editing your theme’s functions.php file directly.
We recommend one of these options:
- Code Snippets – A user-friendly snippet manager with 1M+ active installations
- Fluent Snippets – Preferred option because it doesn’t rely on calling the database like Code Snippets does, resulting in better performance
Step 2: Add the Ultimate Comment-Disabling Snippet
Once you’ve installed and activated your snippet manager of choice, add the following code snippet:
/**
* Disable Comments on Front-End Only
*/
// Close comments on the front-end
add_filter('comments_open', '__return_false', 20, 2);
add_filter('pings_open', '__return_false', 20, 2);
// Hide existing comments on the front-end
add_filter('comments_array', '__return_empty_array', 10, 2);
// Return zero comment count (hide comment counts from display)
add_filter('get_comments_number', '__return_zero');
Step 3: Activate and Test
After adding the snippet:
- Save and activate it through your snippet manager
- Visit various pages on your site to confirm that comment forms no longer appear
- Check that comment counts are now hidden from your posts
That’s it! All comment functionality should now be completely disabled on the front-end of your WordPress site, regardless of whether posts were created before or after implementing this solution.
Why This Approach Works Better
This snippet is superior to other methods because it:
- Works universally: Disables comments on all content, new and existing
- Is focused on the front-end: Removes comments where visitors see them while preserving admin functionality
- Stays lightweight: Doesn’t add unnecessary bloat to your site
- Remains manageable: Can be easily toggled on/off through your snippet manager
No more piecemeal solutions or outdated plugins—just a clean, comment-free WordPress experience with minimal effort.
By using a dedicated snippet manager rather than editing your theme files directly, you also ensure that your customization remains even when updating themes and avoid potential conflicts that could break your site.