Table of Contents
Comments on WordPress websites can be incredibly useful. They provide a space for readers to share feedback, ask questions, and engage in discussions, creating a sense of community around your content. For bloggers and businesses, comments can offer valuable insights, help build trust, and even boost SEO by keeping pages active and engaging.
However, not all comments are constructive. Many sites face spam, promotional links, and irrelevant remarks that clutter the comment section. Worse, some comments can harm your brand’s credibility or even pose security risks through malicious links. Moderating this flood of unwanted input becomes a drain on time and resources. For many site owners, disabling comments is a practical solution to these challenges.
In this guide, we will discuss how WordPress development experts go about disabling comments on a WordPress site.
Top Reasons to Consider Disabling Comments in WordPress
While comments can boost interaction and engagement, there are several scenarios where disabling them may better serve your website. Here are the top reasons why you might consider turning off comments in WordPress:
- They May Not Align With Your Brand or Website Purpose: For professional services, eCommerce stores, or portfolio websites, a comment section may clash with the desired brand image or site purpose. Disabling comments can help maintain a polished and professional appearance while keeping the focus on the content or services.
- Combating Spam and Self-Promotion: Comment sections are often targeted by spammers and self-promoters who flood them with irrelevant or harmful links. This not only disrupts user experience but also damages your site’s credibility. Disabling comments can safeguard your site’s reputation and free you from the hassle of constant moderation.
- Reducing Moderation Overhead: If your content doesn’t require direct feedback or interaction, managing comments can become an unnecessary burden. By disabling them, you can streamline your site’s maintenance and allocate resources more efficiently.
- Enhancing Site Performance: Comment-heavy pages can slow down loading times, particularly on high-traffic websites. Disabling comments can improve your site’s speed and performance, offering a better experience for visitors.
- Security Concerns: Spam comments often contain malicious links that can compromise user data or harm your visitors’ devices. Leaving these unchecked may lead to distrust in your brand. Disabling comments eliminates this security risk entirely.
- Dedicated Forums or Social Media Discussions: If you’ve already established engagement spaces like forums, social media channels, or membership platforms, enabling comments on your WordPress site may feel redundant. Disabling them allows your site to focus on delivering content or fulfilling its primary purpose.
- Unnecessary for eCommerce Websites: Online stores rarely benefit from comments scattered across product pages. Instead, they may distract potential buyers and make the site appear cluttered or unprofessional. Many store owners opt to disable comments entirely to maintain a streamlined shopping experience.
Whether you want to prevent spam comments, improve site speed, or focus engagement elsewhere, disabling comments in WordPress could be the right choice.
Need help with managing your WordPress site? Let us help!
How to Disable Comments in WordPress: 7 Different Methods
WordPress offers several ways to disable comments, catering to different needs. Whether you want to turn off WordPress comments completely, manage specific posts or remove them from media files, here’s how to do it:
1. Disable Comments on All Published Posts and Pages
If your site no longer requires comments, this method is the best choice for completely removing them.
1. Delete Existing Comments:
- Navigate to the WordPress admin dashboard and go to Comments.
- Here, you’ll see a list of all comments on your site, including approved, pending, and spam comments.
- Check the box in the top-left corner to select all comments.
- From the Bulk Actions drop-down menu, select Move to Trash and click Apply.
- This step ensures that all existing comments are deleted, but it doesn’t disable the comment form under posts or pages.
2. Disable Comment Form for Existing Posts:
- Go to Posts > All Posts in the dashboard.
- Check the top-left box to select all posts, then choose Edit from the Bulk Actions menu.
- Click Apply, locate the Comments drop-down menu, and select Do not allow.
- Finally, click Update to save the changes for all posts.
3. Repeat for Pages:
- Go to Pages > All Pages and follow the same steps to disable comments on all pages.
- This step is crucial, as WordPress pages also support comments if enabled.
Alternative Option (Close Comments Globally):
- Navigate to Settings > Discussion.
- Check the box for Automatically close comments on posts older than … days and set the value to 0.
- This method quickly disables comments across all posts, though it doesn’t apply to pages.
By following these steps, you can ensure that the site remains clean and free of unwanted comment activity.
2. Disable Comments on Future Posts
While disabling comments on existing posts is helpful, it’s equally important to prevent comments on new posts.
- From the WordPress admin dashboard, navigate to Settings > Discussion.
- Under Default post settings, locate the option Allow people to submit comments on new posts.
- Uncheck this box to disable comments for all future posts.
This method ensures no comment forms will appear on posts published after this setting is applied. However, it won’t affect posts created before this change, so consider combining it with the first method for a complete solution.
3. Disable Comments on Specific Posts or Pages
Sometimes, you might want to keep comments enabled on certain posts while disabling them for others. This selective approach allows you to maintain active discussions where necessary.
- Navigate to Posts > All Posts or Pages > All Pages in your WordPress dashboard.
- Check the boxes next to the specific posts or pages where you want to disable comments.
- From the Bulk Actions menu, select Edit and click Apply.
- Under the Comments drop-down, select Do not allow and click Update.
This method gives you granular control over which posts or pages allow comments, making it ideal for managing diverse content needs.
4. Disable Comments on Individual Posts or Pages
For even finer control, you can disable comments on individual posts or pages one by one.
Option 1: Use the Post/Page Editor
- Open the post or page in the WordPress editor (Gutenberg or Classic).
- In the Discussion box on the right-hand panel, uncheck Allow comments.
- In Gutenberg, enable the Discussion box under Preferences > Document settings if it’s hidden.
- In the Classic editor, use Screen Options to activate the Discussion box.
- Save the changes by clicking Publish or Update.
Option 2: Use Quick Edit
- Navigate to Posts > All Posts or Pages > All Pages.
- Hover over the post or page title and click Quick Edit.
- Uncheck Allow Comments and click Update.
This approach is perfect for managing comments on individual content without affecting global settings.
5. Disable Comments on Media Files
Media files, like images or videos, don’t typically require comment sections, but WordPress creates pages for them by default.
1. Disable Comments on Individual Media Files:
- Go to Media > Library in your dashboard.
- Click on a media file to open its editor, locate the Discussion box, and uncheck Allow comments.
- Click Update to save the changes.
2. Disable Comments for All Media Files (Code):
To disable comments across all media files, add the following code to your functions.php file:
function disable_media_comment( $open, $post_id ) {
$post = get_post( $post_id );
if ( $post->post_type == 'attachment' ) {
return false;
}
return $open;
}
add_filter( 'comments_open', 'disable_media_comment', 10, 2 );
Adding this code ensures all media pages are automatically free of comment sections.
6. Use a Plugin to Disable Comments
If manual methods feel too tedious, a plugin like Disable Comments offers a quick and efficient solution.
- Install and activate the Disable Comments plugin from the WordPress plugin repository.
- Go to Settings > Disable Comments in your dashboard.
- Choose whether to disable comments everywhere or for specific post types like posts, pages, or media.
- Use the Delete Comments tab to remove existing comments if necessary.
This plugin is particularly useful for large sites where managing comments manually isn’t feasible.
7. Disable Comments Using Custom Code
For advanced users comfortable with coding, you can disable comments by editing theme files.
- Go to Appearance > Theme Editor and open the page.php file.
- Locate the following line:
<?php comments_template( '', true ); ?>
Replace it with:
<!-- Begin Comment
<?php comments_template( '', true ); ?>
End Comment -->
- Repeat the process for the single.php file by replacing:
<?php comments_template(); ?>
With:
<!-- Begin Comment
<?php comments_template(); ?>
End Comment -->
- Save the changes to disable comments site-wide.
Partner with us to take your WordPress site to the next level!
FAQs on Disabling Comments in WordPress
Final Thoughts
Disabling comments in WordPress can streamline your site management, protect it from spam, and ensure a cleaner, more professional presentation. Whether you turn off comments globally, selectively, or for specific content types like media, WordPress offers flexible options to suit your needs. For those looking for efficiency, plugins provide quick and easy solutions, while manual methods allow greater customization.
By managing your comments strategically, you can focus on delivering value through your content without distractions. Choose the method that works best for your website’s purpose and audience, and maintain a secure, optimized, and user-friendly online presence.
Need expert help managing your WordPress site or optimizing it for better performance? Our WordPress development services can assist you with everything from customization to security enhancements.