Comments can be a great way to build community and engagement on a WordPress website. However, managing and moderating comments can be time-consuming, and excessive or irrelevant comments can detract from your content. In some cases, disabling comments entirely may be the best approach. Here’s a comprehensive guide on how to disable comments in WordPress.

What are Comments in WordPress?

The comments feature allows visitors to your WordPress site to comment on your posts and pages. This enables discussions and conversations centred around your content.

When a user leaves a comment, it enters a moderation queue for review before appearing publicly on your site. You can approve, edit, delete, or report comments as the site owner.

The comment section is vital to building community, developing relationships with readers, and getting feedback on your content. However, not all websites need or benefit from comments.

What are Comments in WordPress?

Why You Might Want to Disable Comments

There are a few common reasons you may want to turn off comments on your WordPress site:

  • Reduce spam: The comment section can attract a lot of spam despite available protections. Disabling comments helps keep spam under control.
  • Improve security: Spam comments can be used for phishing scams, malware injection, and other security threats. Disabling comments enhance security.
  • Save time: Checking, moderating, and replying to comments is hugely time-consuming. Eliminating them frees up time for content creation.
  • Avoid harassment: Comments can sometimes become a forum for harassment and abuse. Disabling them removes this liability.
  • Stay focused: Excessive comments can distract from your core content. Disabling them keeps the focus on your posts and pages.

The decision depends on your goals, audience, and capacity to manage discussions. For some sites, the benefits outweigh the drawbacks.

How to Globally Disable Comments in WordPress

If you wish to turn off comments across your entire WordPress site, you have a couple of options:

Using WordPress Settings

  1. Log in to your WordPress dashboard.
  2. Go to Settings > Discussion.
  3. Uncheck the box next to “Allow people to post comments on new articles”.
  4. Click Save Changes.

This will turn off comments on all posts and pages. Existing comments will remain visible.

How to Globally Disable Comments in WordPress

Using a Plugin

Plugins like Disable Comments offer more options for globally disabling comments.

  1. Install and activate the Disable Comments plugin.
  2. Go to Settings > Disable Comments.
  3. Check the “Everywhere” option to disable comments everywhere.
  4. Click Save Changes.

Plugins add flexibility, like disabling certain comment types or preserving existing comments when disabled.

How to Selectively Disable Comments

Sometimes, you may wish to turn off comments only on specific posts, pages, or categories rather than site-wide. Here are a couple of ways to do so:

From the Editor

On individual posts or pages:

  1. Edit the post or page where you want to disable comments.
  2. Locate the “Discussion” box. Check “Screen Options” to add it if needed.
  3. Uncheck “Allow Comments”.
  4. Update the post or page.

Comments will now be disabled on only that piece of content.

From Settings

To turn off comments for specific post types, taxonomies, or content:

  1. Go to Settings > Discussion.
  2. Scroll down to “Other comment settings”.
  3. Under advanced settings, choose “Add an exception” and select the post types, categories, tags, etc., you want to disable comments.
  4. Save your changes.

This allows you to selectively turn off comments on certain content without affecting the rest of your site.

How to Remove the Comment Section from Your Theme

If you want the comments section removed entirely rather than just disabled, you will need to edit your theme files. There are a few ways to do this:

How to Remove the Comment Section from Your Theme

With Custom CSS

  1. Go to Appearance > Customize > Additional CSS.
  2. Add the following snippet:
.comments-area {
  display: none; 
}
  1. Publish changes.

This will hide the comment section but not remove it from the code.

Via Functions.php

  1. Open your theme’s functions.php file, usually in /wp-content/themes/your-theme/.
  2. Add this code:
function remove_comments() {
  remove_action('wp_head', 'feed_links_extra', 3);
  remove_action('wp_head', 'feed_links', 2); 
  remove_action('wp_head', 'rsd_link');
  remove_action('wp_head', 'wlwmanifest_link');
  remove_action('wp_head', 'index_rel_link');
  remove_action('wp_head', 'parent_post_rel_link', 10, 0);
  remove_action('wp_head', 'start_post_rel_link', 10, 0);
  remove_action('wp_head', 'adjacent_posts_rel_link', 10, 0);
  remove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0);
  remove_action('wp_head', 'wp_generator');
  remove_action('wp_head', 'wp_shortlink_wp_head', 10, 0);

  remove_action('template_redirect', 'wp_shortlink_header', 11, 0);

  remove_action('template_redirect', 'rest_output_link_header', 11, 0);

  remove_action('wp_print_styles', 'print_emoji_styles');

  remove_action('admin_print_scripts', 'print_emoji_detection_script');

  remove_action('wp_print_styles', 'print_emoji_styles');

  remove_action('admin_print_scripts', 'print_emoji_detection_script');

  remove_filter('the_content_feed', 'wp_staticize_emoji');

  remove_filter('comment_text_rss', 'wp_staticize_emoji'); 

  remove_filter('wp_mail', 'wp_staticize_emoji_for_email');

  add_filter('wp_resource_hints', 'disable_emojis_remove_dns_prefetch', 10, 2);
}

function disable_emojis_remove_dns_prefetch($urls, $relation_type) {
  if ('dns-prefetch' === $relation_type) {
      return array_diff( $urls, array('https://s.w.org') );
  }

  return $urls;
}

add_action('init', 'remove_comments');
  1. Save changes and upload the updated file to your server.

This will fully remove all comment-related code from your WordPress front and back end.

How to Disable Comments on Media

By default, WordPress allows comments on attachments and media library items. To disable:

  1. Go to Settings > Discussion.
  2. Uncheck “Allow comments on media files uploaded to posts and pages”.
  3. Save Changes.

Alternatively, comments can be disabled for individual files:

  1. In the media library, open the file you wish to disable comments.
  2. Expand the file details and uncheck “Allow Comments”.
  3. Update the media file.

Like posts and pages, this will turn off comments for that file without affecting others.

The Pros of Disabling Comments

While comments can have benefits, there are advantages to disabling them as well:

  • Increased security – Fewer points of entry for spam, scams and attacks.
  • Spam reduction – Say goodbye to annoying, irrelevant spam messages.
  • Faster moderation – No need to manually approve and manage comments.
  • Improved user experience – Content remains clean and focused without distracting words.
  • More control over discussions – Choose where and how meetings occur, like social media.

Evaluate your needs and goals to determine if your site’s pros outweigh the cons.

The Cons of Disabling Comments

However, it’s also important to consider potential drawbacks:

  • Decreased engagement – Visitors have fewer ways to interact with your content.
  • Loss of feedback – Valuable comments with insights and opinions will be eliminated.
  • Negative SEO impact – Less keyword-rich content from comments.
  • Less social proof – Comments are social proof that content provides value.
  • Fewer leads and sales – Comments can lead to conversions.
  • Less community – There is nowhere for regular visitors to connect and converse.

For some sites, the sense of community and feedback comments are integral. Assess whether removing them will do more harm than good for your goals.

Pros and Cons of Disabling Comments

When to Disable Comments

Rather than taking an all-or-nothing approach, you may choose to disable comments selectively:

Controversial Posts

Some topics tend to attract excessive negativity. Disabling comments on controversial or sensitive posts can create a more positive environment.

Very Old Content

Older, evergreen content may still rank well but have outdated information. Disabling comments helps keep the focus on more recent and relevant posts.

Repurposed Content

If you repurpose content from other sources, disabling comments keeps the discussion focused on the source article.

Evaluate each post to determine whether open comments provide value or not. You can disable it on a case-by-case basis rather than completely.

Alternatives to Disabling Comments

If completely removing comments seems too drastic, consider alternatives like:

  • Using a third-party commenting system – Services like Disqus allow for better moderation and integration.
  • Selectively disabling comments – Turn off commenting for only problematic posts rather than completely.
  • Using comment moderation – Manually or automatically hold comments for review before publication.
  • Requiring login to comment – Reduces spam by requiring an account to comment.
  • Limiting comment date range – Automatically close commenting on posts after a certain number of days.
  • Encouraging social sharing – Allow users to share feedback via social media instead of your site.

Look for middle-ground solutions that balance your goals, community, and site management capabilities.

Conclusion

The comments section can be a double-edged sword. While comments allow for community engagement, they also require heavy moderation, risk security issues, and distraction.

Fortunately, WordPress provides options to fully disable comments site-wide or selectively by post, category, user role, and more. You can also use CSS or code snippets to hide or remove comment sections without losing the content.

Evaluate your audience, goals, and site management capacity. For some sites, the sense of community comments provide outweighs the headaches. For others, comments aren’t worth the risks and maintenance required.

By understanding the options available, you can determine the correct comments strategy for your unique WordPress site. The choice ultimately comes down to which options provide the most benefits with the fewest drawbacks.

This post covered standard techniques for disabling WordPress comments at a global or selective level. To recap, you can disable comments by:

  • Toggling discussion settings in the dashboard
  • Using plugins like Disable Comments
  • Modifying theme files and WordPress hooks
  • Changing settings for individual posts, pages and taxonomies
  • Using custom CSS to hide comment sections
  • Removing related theme code in functions.php

This comprehensive guide gives you all the background and step-by-step instructions needed to control WordPress comments. Now, it’s simply a matter of deciding what strategy works best for your site and goals.

Posted by

Leave a Reply

Your email address will not be published. Required fields are marked *