Would you like to learn how to disable comments in WordPress?

Allowing commenting on your website can be a great way to engage with your audience, but some users may want to disable comments. comments in wordpress for valid reasons. Have a comments section can pose security risks, and some websites simply don't need such a section.

If you're looking for how to disable comments on your WordPress website, you've come to the right place. In this article, we will explain several methods of disabling comments in WordPress step by step.

Why Disable Comments in WordPress

Before we explain the ways to disable comments in WordPress, let's see why you would want to do it in the first place.

1. Spam

In general, spam refers to unwanted user-generated content. People often spam with malicious intent, which makes it potentially dangerous for those who receive it. Spam can also have a negative impact on a website's reputation on search engines.

2. Comments can be a security risk

Spam emails are notorious for their security risks. Many include dangerous links that can install viruses, collect personal information, and even steal money from those who click on them.

Even if your website visitors are technically savvy and don't interact with spammy links, the presence of this type of comment can negatively impact your credibility.

3. You own a store and don't need reviews

If you run an online store, you know that it is not necessary to have a comments section on your website. Some online stores prefer to disable all reviews, especially if the main purpose of their website is to list the items they sell.

Having a comments section on your product page can distract visitors who would otherwise be interested in buying.

4. You have a dedicated forum where your visitors can discuss

Disabling comments in WordPress does not mean that you are going to cut off all engagement between you and your visitors.

You may have already created a separate space for your visitors to communicate with you and others. You may prefer to use a website with member area or social media channels for your business.

In this case, you don't need comments on your WordPress website. By disabling them, your website will be able to focus on other purposes, such as providing information and promoting sales.

How to disable comments on your website?

There are several methods to disable comments in WordPress.

Method 1: Disable WordPress comments on all published pages and posts

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

Once you apply the following changes, it will remove comments from all existing pages and blog posts.

First, you need to remove all comments that already exist on each page and post.

  1. Access the WordPress admin area.
  2. Go to Comments. You will see a table detailing all the feedback you have received on your website.
  3. Select all comments when you check the box shown in the upper left corner of the dashboard.
  4. Select To trash in the bulk actions menu.
  5. Click on Apply.

At this point, you will delete all existing comments on your website. But the feedback form will still be there. It will allow people to post comments on your pages and posts.

To resolve this issue for future comments, we will disable the comment form under each post and page. There are two ways to do this.

The first option is to use bulk actions

1. Go to Articles > All Articles. You will see a table containing all the articles you have already published.

2. Select all items by checking the box in the upper left corner of the table. Click on Edit in the bulk action selection box.

3. Look for the Comments section and click on Don't not allow in the drop-down menu.

how to disable comments in wordpress

4. Finally, click on Update to apply the changes.

To remove forms of comments from all pages, go to Pages > All pages and proceed as follows.

how to disable comments in wordpress

Note that every page created in WordPress has a comments section disabled by default. If there are comments on your pages, you've probably changed the settings at some point. To resolve this issue, follow the same steps we suggest for articles.

The second option is to use the parameter Automatically close comments for posts older than……. days. Fill in the field with 0 to disable comments for all posts.

1. Go to Settings > Comments.

how to disable comments in wordpress

2. In the section, Other comment settings, search  Automatically close comments for posts older than……. days. Fill in the field with 0 to disable comments for all posts.

This setting is a bit faster than the first option (bulk edit). Unfortunately, you cannot 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 Comments on Future WordPress Posts

Although the first method can disable WordPress comments on your old posts and pages, it won't stop anyone from wanting to post comments on new posts. Fortunately, you can solve this problem by applying a specific configuration.

1. In your WordPress admin area, navigate to Settings > Comments, uncheck the box Allow comments on new posts

how to disable comments in wordpress

By applying this setting, your WordPress website will no longer allow people to post comments on future posts.

Method 3: Disable WordPress Comments on Specific Posts and Pages

If you still appreciate having an active comments section, it can be useful to disable comments on specific pages or posts.

The steps are very similar to the bulk edit section in Method 1. The difference is that you just need to select the posts and pages you want, rather than all of them.

Method 4: Disable WordPress Comments on a Specific Post or Page

The first three methods deal with disabling comments globally or in bulk. But you can disable and enable comments on individual posts or pages one by one.

Keep in mind that this method can cycle through any global parameter you set. This provides more flexibility on comment sections and is useful when you want to change comment settings on a single post.

There are only two ways to do this.

The first option is to do it in a WordPress post or in the page editor. The steps should be similar whether you use the Gutenberg editor or the Classic editor.

  1. In the panel on the right side, scroll down until you find the Chat area.
  2. Uncheck the Allow Comments.
  3. Save the changes by clicking on Publish or Update profile.

If you are using the classic editor, click Screen options and check the option Discussion to be able to modify these parameters. Then go to the Comments section who will appear on the right side of the screen and select Allow Comments.

The second option is to use the edit function quick that you can find in the administration menu in the sections Posts or Pages.

1. Go to Articles > All Articles  ou Pages > All Pages if you want to promote changes on a page.

2. Hover over the title of the item for which you want to disable comments and click Quick modification.

3. Uncheck Allow comments.

4. Click on Update profile.

Method 5: Disable comments on media files

When you upload media files to your website, WordPress automatically creates individual pages for them. These pages can receive comments like any regular post or page. The thing is, websites usually don't need comment sections in their media files.

There are two ways to disable comments on media files.

You can disable them individually, the same way you would with posts and pages in our fourth method.

1. In the WordPress admin area, navigate to Media > Media library

2. Browse for a media file and choose the option Edit.

3. In the comment area, uncheck the box Allow Comments.

4. Click on Update profile.

Unfortunately, unlike posts and pages, there is no way to apply this setting to media files using bulk actions. This option is therefore less feasible for websites with a huge media library.

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

Before you continue, keep in mind that adding incorrect snippets to your theme can damage your website. To stay safe, try to create a backup of your website, which you can use to restore the previous version in case something goes wrong. Also consider creating a Child theme which will not mess up the parent theme settings.

1. To find the file functions.php file, go to Tools > Theme file editor

2. Select functions.php bottom right.

how to disable comments in wordpress

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 for finalize the changes.

Method 6: Disable Comments Using a WordPress Plugin

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

Although manual methods offer more flexibility, they certainly require a lot more of your time, especially if your website has too much content and too many spam comments to support.

This plugin allows users to mute all comments with a single click. You can also choose to disable comments only on posts, pages, or media files.

If you have a network with multiple websites, you can disable comments on each of them. The Disable Comments plugin also gives you the option to completely remove the “Comments” links from the admin menu and main admin bar of your WordPress.

Once you have installed and activated this plugin go to Settings > Disable comments in your WordPress admin area.

how to disable comments in wordpress

The settings are organized in two tabs, Disable Comments and Delete Comments. The former removes the feedback form, while the latter removes comments you have already received on your WordPress website.

In the  part Disable comments, you can choose to disable WordPress comments All over (In all locations) or on specific post types (in specific post types).

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

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

In the  part Delete comments, you have three options. Choose All over if you want to remove all comments on your website.

If you want to keep some comments, select On certain post types to choose the comments under which post type you want them to disappear.

Or you can choose to delete certain types of comments if you want to delete specific comments, such as product reviews WooCommerce.

Method 7: Disable comments via custom code

You can disable all comments on your website by copying and pasting code snippets into the files page.php et unique.php of your WordPress theme.

This option is only recommended if you have already practiced best practices related to editing the source code of a WordPress theme.

First, try replacing a line of code on your page.php to disable comments on all pages.

1. From the dashboard, navigate to Appearance > Theme Editor.

wordpress theme editor

2. Choose page.php on the right side.

3. Next, find the following code in the file:


And replace it with this:

End Comment →

Click Update File to save the changes.

4. Next, replace the line of code in your file unique.php to disable comments on all your posts.

Look for the following code:


And replace it with the following code:

End Comment →

Finally, select Update file. Comments on all your pages and posts should now be disabled.

Other recommended resources

We also invite you to consult the resources below to go further in the grip and control of your website and blog.

Conclusion

In this article, we cover several different methods for disabling comments in WordPress.

Whichever method you decide to use, we hope this article will help you gain more control over your website.

However, you will also be able to consult our resources, if you need more elements to carry out your projects of creation of Internet sites, by consulting our guide on the WordPress blog creation.

If you have suggestions or remarks, leave them in our section Comments. Do not hesitate to share with your friends on your favorite social networks

...