How to disable comments in WordPress

Al, there are many things to consider. One of them is how users interact with your content. WordPress gives you the option to allow comments on pages and blog posts, which is a great way to spice up your site, but it does come with its pros and cons.

By default, any user can comment on new posts in WordPress. If your blog posts or pages are flooded with random, irrelevant comments and spam links, this can affect your search engine rankings.

If you are looking to disable comments on your WordPress site, you have come to the right place. In this article, we are going to explain multiple step-by-step methods to disable comments in WordPress.

How to disable comments on your website

There are several methods to disable WordPress comments. In this article, we are going to cover seven different options.

Method 1: Disable WordPress Comments on All Posts and Published Pages

If you want to disable all comments on a website, this is the method for you.

After applying the following changes, you will remove comments on all existing pages and blog posts.

First, you’ll want to remove all existing comments on each post and page.

  1. Go to the WordPress admin area.
  2. go to Comments. You’ll see a list detailing all the feedback you’ve received on your site.
  3. Select all comments by checking the box in the upper left corner of the table.
  4. Choose Move to Trash in the drop down box batch actions.
  5. click on Apply.

At this point, all existing comments on your website will be deleted. But the feedback form will still be present. This allows people to post comments below your posts and pages.

To fix this in future posts, we’re going to disable the comment form below every post and page. There are two ways to do this.

The first option is to use batch actions.

  1. Go to the section Posts > All Postsselect all existing entries and bulk edit them.
  1. Enter the dropdown list near the section Comments and choose the option Do not allow.
  1. Save the changes by clicking the button To update and the option to add new comments to existing posts will be disabled.

To remove comment forms from all pages, go to Pages > All Pages and follow the same steps.

Note that every page created in WordPress has the comments section disabled by default. If comments are present on your pages, you’ve probably changed the settings at some point. To fix this, follow these same steps for your pages.

See also  What is it and How to Solve the 502 Bad Gateway Error

The second option is to use the setting Automatically close comments on posts older than … days.

  1. Anger Settings > Comments.
  2. In Feedback Settings > Other Feedback Settings find the setting Automatically close comments on posts older than … days. Fill in the field with 0 to disable comments for all posts.

This configuration is a bit faster than the first option (batch editing). Unfortunately, you can’t apply this technique to pages. If you have comments on your pages and want to disable them in bulk, follow the first option.

Method 2: Disable WordPress Comments on Future Posts

While the first method may disable comments on your past posts and pages, it won’t prevent people from posting comments on new articles. Fortunately, you can solve this problem by applying specific settings.

  1. Access the WordPress panel and go to the section Settings > Comments.
  2. In Input default settingsuncheck the box Allows comments to be posted on new articles.
  3. Save your changes and all future posts will no longer have the option to add comments.

Method 3: Disable WordPress Comments on Specific Posts and Pages

If you want to have some comment sections active, you may want to know how to disable comments only on certain posts or pages.

The steps are very similar to the bulk edit section of Method 1. The difference is that you only have to select multiple posts and pages instead of all of them.

  1. Go to your WordPress dashboard and navigate to Posts > All Posts.
  2. Identify the posts you want to have comments disabled and check their respective boxes.
  3. Choose Edit in the dropdown box and click Apply.
  4. Make sure you have selected the correct entries in batch editing.
  5. Choose Do not allow in the dropdown box and click To update.

Method 4: Disable WordPress Comments on an Individual Post or Page

The first three methods are to disable comments globally or in bulk. But it is possible to disable and enable comments on individual posts or pages one by one.

Note that this method may override any global settings you have. It gives you more flexibility over comment sections and is useful when you want to change the comment settings for a single post.

There are two ways to do this.

The first option is to do it from the WordPress post or page editor. The steps should be similar whether you use the or the classic.

  1. In the panel on the right, scroll down until you find the checkbox Comments.
  2. Uncheck the option allow comments.
  3. Save the changes by clicking Post either To update.
See also  The 13 Best Image Formats and When to Use Them

If you use the Gutenberg editor and cannot find the checkbox Comments, click the three-dot button in the top right corner. go to Preferences > Document Settings. Brand Comments and the option should appear.

If you’re using the classic editor, you can open the discussion box by selecting display options at the top right of the post and checking the box Comments.

The second option is to use the function Quick Edit which you can find in the administration menu of Tickets either pages.

  1. go to Posts > All Posts either Pages > All Pages if you want to make changes to a page.
  2. Hover over the title of the item whose comments you want to disable, and click quick edit.
  3. Uncheck the option allow comments.
  4. click on To update.

Method 5: Disable Media Comments

When you upload media files to your website, WordPress automatically creates individual pages for them. These pages can receive comments just like a regular post or page. Most of the time, websites don’t need comment sections in their media files.

There are two ways to disable comments on media files.

You can disable them individually, similar to how you would for posts and pages in the fourth method.

  1. From your WordPress dashboard, go to Media > Library.
  2. Click on a media file and choose Edit more details.
  3. In Commentsuncheck allow comments.
  4. click on To update.

Unfortunately, unlike custom posts, pages, and post types, there is no way to apply these settings to media files using batch actions. Therefore, this option is less viable for sites with an extensive media library.

The second option allows you to quickly disable comments on all media files on your site. To do this, you will need to copy and paste a custom code into the file functions.php of your theme.

Before proceeding, keep in mind that incorrectly adding code snippets to themes can break sites. To be safe, make sure of your site so you can restore it to the previous version in case something goes wrong. Also, consider creating one that doesn’t alter the settings of the parent theme.

  1. To find the functions.php file, go to Appearance > Theme Editor.
  2. Choose functions.php on the right.
  3. Next, copy and paste the following code snippet into the 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 );
  4. click on update file to save the changes.
See also  How to unzip or create archives via SSH connection

Method 6: Disable WordPress Comments with a Plugin

If you prefer a quick and easy way to disable comments in WordPress, the plugin may be a good option.

Although manual methods offer more flexibility, they are certainly more time consuming, especially if your website has a lot of content and a lot of spam to deal with.

This plugin allows the user to disable all comments with one click. You can also choose to disable only comments on your posts, pages, or media.

If you have a network of multiple sites, you can also disable comments on multiple websites. The Disable Comments plugin also gives you the ability to remove the “Comments” links from the WordPress admin menu and admin bar altogether.

Once you have Disable Comments, go to Settings > Disable comments in your WordPress admin area.

Settings are categorized into two tabs, disable comments Y delete comments. The first removes the comment form and the second removes the comments you have received on your WordPress site.

In Disable Commentsyou can choose if you want to disable comments in WordPress Everywhere either On specific types of content.

Unlike manual methods, the settings applied by this plugin cannot be overridden by the settings of individual inputs. Therefore, method 4 will no longer work.

If you still want some comments on your site, make sure you select the correct post type or opt for manual methods instead.

in the tab delete comments, you have three options. Choose Everywhere if you want to remove all comments from your site.

If you want to keep some comments, select On certain types of content what type of post you want comments removed on.

or you can choose Delete certain types of comments if you want specific comments to be removed, for example the ones under WooCommerce products.

Method 7: Disable comments using custom code

You can disable all comments in WordPress by copying and pasting a couple of code snippets into the files page.php Y single.php of your theme.

This option is only recommended if you have applied best practices related to editing WordPress theme source code, including editing your site and creating a .

First, try substituting a line of code in your file page.php

Loading Facebook Comments ...
Loading Disqus Comments ...