While getting WordPress comments can be a great way to engage with your audience, they can become a headache. Approximately 45% of all comments received on WordPress sites are classified as spam.
For WordPress agencies managing multiple sites, disabling comments can be essential for reducing spam or streamlining site maintenance. In this detailed guide, we’ll walk you through the various methods to disable comments in WordPress completely or selectively. Whether you’re managing future posts, pages, or media, we’ve got you covered.
Table of Contents
Why Disable Comments in WordPress?
Disabling comments on your WordPress site can significantly enhance your site’s performance and user experience. Here are several compelling reasons to consider this approach:
Reduce Spam: WordPress Spam comments can overwhelm your moderation efforts, leading to a disorganized comment section filled with irrelevant content.
By disabling comments, you eliminate the risk of spam comments, allowing you to focus on creating valuable content that resonates with your audience. This proactive measure not only saves time but also enhances the overall quality of user interactions on your site.
Improve Security: WordPress comment sections can be breeding grounds for hackers and spammers who exploit vulnerabilities to insert harmful links or phishing attempts.
By disabling WordPress comments, you reduce the attack surface of your website, thereby enhancing its security. This is particularly important for maintaining user trust and protecting sensitive information from potential breaches.
Streamline Site Management: Managing comments on WordPress can be a time-consuming site management task, especially for sites with high traffic. As you disable WordPress comments, you free up valuable resources that can be redirected towards content creation and site improvement.
Enhance User Experience: A cluttered WordPress comment section can detract from the main content and lead to a fragmented user experience. By disabling comments, you create a cleaner, more focused environment for your readers, allowing them to engage deeply with your content without the distractions of irrelevant discussions.
By considering these factors, you can make an informed decision about whether disabling comments is the right choice for your WordPress site, ultimately improving its performance and user satisfaction.
How To Disable Comments in WordPress
Now that you know why to bother about disabling comments in WordPress, let’s start learning the process. We will cover different aspects of it.
Disable WordPress Comments Completely
To completely disable comments on your WordPress site, you have two methods to try.
Method 1: Using the Plugin
You can use the WordPress anti-spam plugin to stop the comments completely. This is an automated way to stop WordPress comments and avoid the hassles involved in spam comments.
For the sake of this guide, we’re using the WPCode plugin. You can use the WordPress anti-spam comment of your choice.
Log in to your WordPress dashboard.
Navigate to Plugins > Add New.
Search for WPCode in the plugin repository.
Install and activate the plugin.
After activation, go to Code Snippets > Library in your WordPress admin panel.
In the library, search for “Completely Disable Comments.“
Select the option and click on “Apply”.
Doing so will remove all traces of comments from your site, including disabling new comments and hiding existing ones.
Method 2: Manual Code Editing
If you prefer to disable comments on WordPress manually, you can add a code snippet to your theme’s functions.php file. Here is how you can do it.
Go to your WordPress dashboard.
Navigate to Appearance > Theme Editor.
In the right sidebar, find and select functions.php.
Add the following code snippet at the end of the file:
add_action('admin_init', function () {
global $pagenow;
if ($pagenow === 'edit-comments.php') {
wp_safe_redirect(admin_url());
exit;
}
remove_meta_box('dashboard_recent_comments', 'dashboard', 'normal');
foreach (get_post_types() as $post_type) {
if (post_type_supports($post_type, 'comments')) {
remove_post_type_support($post_type, 'comments');
remove_post_type_support($post_type, 'trackbacks');
}
}
});
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);
add_action('admin_menu', function () {
remove_menu_page('edit-comments.php');
});
add_action('init', function () {
if (is_admin_bar_showing()) {
remove_action('admin_bar_menu', 'wp_admin_bar_comments_menu', 60);
}
});
Click on Update File to save your changes.
By following either of these methods, you can effectively disable comments across your entire WordPress site. Using the WordPress spam comment plugin is a user-friendly approach that requires no coding skills, while manually editing functions.php provides more control for advanced users.
Disable WordPress Comments on Future Posts
Disabling comments on future posts in WordPress can be an essential step for many site owners, especially those looking to reduce spam or streamline site management. By preventing comments on new content, you can maintain a focused and distraction-free environment for your audience.
Here are the steps to disable WordPress comments on future posts
Log in to your WordPress admin area using your username and password.
Go to Settings in the left sidebar and then click on Discussion. This section contains various options related to comment management.
By default, WordPress allows people to submit comments. Hence, you have to uncheck the box “Allow people to submit comments on new posts.” This action will ensure that comments are not allowed on any posts published after this setting is applied.
Scroll down to the bottom of the page and click on the Save Changes button to apply your new settings.
Disable WordPress Comments on a Specific Page or Post
Disabling comments on specific pages or posts in WordPress allows you to maintain control over user engagement and manage discussions effectively. This can be particularly useful for content that may not require feedback or where you want to prevent spam.
Here’s a step-by-step guide on how to disable WordPress comments on individual pages or posts:
Use your credentials to access the admin area of your WordPress site.
If you want to disable comments on a post, go to Posts > All Posts.
If it’s a page, go to Pages >All Pages.
Find the specific post or page for which you want to disable comments and click on the Edit link that appears.
In the post or page editor, look for the Discussion settings panel on the right side of the screen.
In the Discussion settings, click on ‘Closed’ to disable WordPress comments on a specific post/page.
Delete All WordPress Comments
To remove existing comments:
Go to Comments in the WordPress dashboard.
Use the checkbox at the top to select all comments.
From the Bulk Actions dropdown, choose Move to Trash and click Apply.
How to Delete Spam Comments on Multiple Sites
Managing multiple sites can be a challenge, especially when it comes to disabling comments across numerous pages or posts. Save time and effort by using the WP-CLI command through a reliable site management service.
This method allows you to quickly disable comments in bulk, streamlining your workflow and maintaining control over your WordPress sites efficiently.
Login to the site management tool dashboard.
Select the number of sites on which you want to disable WordPress comments.
Go to ‘Bulk Actions‘ and select the Run Command option.
Run the ‘Delete Spam Comments’ command and you can get rid of WordPress spam comments on multiple sites in a fraction of the time.
More Bonus Tips: Spam Protection Techniques
To effectively manage or stop WordPress spam comments, implementing robust spam protection techniques is essential. Here are some effective strategies to combat spam effectively:
- Use an Anti-Spam Plugin: Installing WordPress anti-spam plugins can significantly reduce spam comments.
- Enable Comment Moderation: To maintain control over what appears on your site, navigate to Settings > Discussion in your WordPress dashboard and enable the option that requires comments to be manually approved. This ensures that every comment is reviewed before it becomes visible to other users.
- Block Specific Keywords: Adding spammy words to the Comment Blacklist in the Discussion Settings can help filter out unwanted comments automatically. Any comment containing a blacklisted keyword will be marked as spam and held for review or deleted outright.
- Use CAPTCHA: Implementing a CAPTCHA system, such as Google reCAPTCHA, can deter automated bots from submitting spam comments. CAPTCHAs require users to complete a challenge that proves they are human, such as selecting images or typing distorted text.
- Disable Trackbacks and Pings: Trackbacks and pings are notifications sent from other blogs when they link to your content. While they can foster connections, they are often exploited by spammers. You can disable them in your WordPress settings under Settings > Discussion.
- Regularly Update Your Site: Keeping your WordPress installation and all plugins up to date is crucial for security. Updates often include patches for vulnerabilities that spammers could exploit. By regularly updating your site, you not only enhance its performance but also fortify it against potential security threats.
- Use a Firewall: Implementing a firewall can provide an additional layer of protection against spam bots and malicious attacks. A reliable firewall distinguishes between legitimate users and harmful bots, blocking the latter before they reach your site. Plugins like MalCare offer comprehensive security features, including automatic malware scanning and login protection.
By employing these techniques, you can create a robust defense against spam on your WordPress site, ensuring a cleaner and more engaging experience for your visitors while safeguarding your content from unwanted disruptions.
Conclusion
Disabling comments in WordPress can significantly enhance your website’s security, performance, and user experience. Whether you choose to disable them entirely or selectively, WordPress provides flexible options to manage comments effectively. For agencies, streamlining comment management can save valuable time and reduce maintenance overhead.
FAQs
1. What is the easiest way to disable comments in WordPress?
The easiest way is to use a plugin like Disable Comments to turn off comments globally or selectively.
2. How do I disable comments on a specific WordPress page?
Edit the page, scroll to the Discussion section, and uncheck Allow comments. Save the changes.
3. Can I bulk disable comments on WordPress posts?
Yes, go to Posts > All Posts, select multiple posts, choose Edit from the Bulk Actions dropdown, and set comments to Do not allow.
4. How do I disable comments on WordPress media pages?
You can add a custom PHP code snippet or use a plugin to disable comments on media pages.
5. Why does my site still show “Comments are closed” after disabling comments?
This message can be removed using custom CSS or by editing your theme’s template files.