GuidesHow To

How to Disable Comments In WordPress In 2024

Are you looking for ways to fully or partially disable comments in WordPress? Here is all you need to know!

WordPress is a popular and flexible content management system (CMS) that allows users to create and manage websites with ease. One of the features that come with WordPress is the ability to add comments to posts and pages.

Comments allow users to engage with the content and share their thoughts and opinions. However, there may be situations where you want to disable comments on your WordPress site.

In this article, we will discuss how to disable comments in WordPress step-by-step.

Why To Disable Comments In WordPress?

There are several reasons why you may want to disable comments on your WordPress site. Here are a few:

1. Spam:

Spam comments can be a nuisance and take up valuable resources in terms of time and effort to moderate them. If your website receives a large number of spam comments, it may be more efficient to remove the comment section altogether.

2. Trolls:

Some users may leave negative or inflammatory comments that can derail the conversation and create a negative atmosphere on your website. Removing comments can help prevent this type of behavior.

3. Liability:

As the website owner, you are legally responsible for any defamatory or illegal content posted in the comment section. By removing comments, you can mitigate this risk and avoid potential legal issues.

4. Low Engagement:

If your website does not receive many comments or if the comments are not adding value to the conversation, removing the comment section may be a good idea. This can help streamline the user experience and focus attention on other areas of the website.

Now that you know why you may want to disable comments, let’s discuss how to do it.

How To Disable Comments In WordPress (3 Easy Methods):

There are several ways to disable comments on WordPress. Here are some of the most common methods:

Method 1. Using WordPress Dashboard’s Settings:

i. Disable Comments On Individual Posts Or Pages:

If you only want to disable comments on specific posts or pages, you can do so by following these steps:

1: Go to the post or page where you want to disable comments.

2: Click on the “Screen Options” button in the top right corner of the screen.

3: Check the “Discussion” box.

4: Scroll down to the “Discussion” section and uncheck the “Allow Comments” box.

5: Save the changes by clicking on the Update button.

ii. Disable Comments For New Posts And Pages:

If you want to disable comments for all new posts and pages, you can do so by changing your WordPress settings. Here’s how:

1: Go to your WordPress dashboard.

2: Go to “Settings” and then “Discussion“.

3: Under “Default article settings“, uncheck the “Allow people to submit comments on new posts” box.

4: Under “Other comment settings“, uncheck the “Allow link notifications from other blogs (pingbacks and trackbacks)” box.

5: Save the changes.

Discussion settings

iii. Disable Comments On Multiple Pages Or Posts:

If you want to disable comments on multiple pages or posts on your WordPress website, you can use WordPress built-in options or any WordPress plugin. Follow these steps to do it using WordPress’s Dashboard settings:

  1. Go to the WordPress dashboard and navigate to the “Posts” or “Pages” section.
  2. Select the pages or posts you want to disable comments on by clicking on the checkbox next to each one.
  3. Click on the “Bulk Actions” dropdown menu and select “Edit“.
  4. Click the “Apply” button.
  5. In the “Bulk Edit” section, find the “Comments” dropdown and set it to “Do not allow“.
  6. Click the “Update” button to save the changes.

iv. Disable Comments Globally:

If you want to disable comments on your entire website, you can do so from the WordPress settings. Here’s how:

  1. Log in to your WordPress dashboard.
  2. Click on “Settings” from the left-hand menu and select “Discussion.”
  3. Uncheck the box that says “Allow people to submit comments on new posts.”
  4. Uncheck the box that says “Allow link notifications from other blogs (pingbacks and trackbacks) on new articles“.
  5. Click on “Save Changes” to apply your settings.

Once you have disabled comments globally, readers will no longer be able to leave comments on any post or page on your website.

v. Delete Existing Comments On Your Site:

If you have already enabled comments on your WordPress website and want to delete existing comments, there are a few ways to do so. Here are the steps:

Option 1 – Delete Comments Individually:

  1. Log in to your WordPress dashboard.
  2. Navigate to the post or page where the comment is located.
  3. Find the comment you want to delete and hover over it with your mouse.
  4. Click on the trash can icon that appears to delete the comment.
  5. If you want to permanently delete the comment, click on the “Trash” link at the top of the comments section.
  6. Check the box next to the comment you want to delete permanently, and click on “Delete Permanently.”

Option 2 – Delete Comments In Bulk:

If you have a large number of comments to delete, you may want to delete them in bulk. Here’s how:

  1. Log in to your WordPress dashboard.
  2. Click on “Comments” from the left-hand menu.
  3. Check the boxes next to the comments you want to delete.
  4. From the “Bulk Actions” drop-down menu, select “Move to Trash” and click on “Apply.”
  5. If you want to permanently delete the comments, click on the “Trash” link at the top of the comments section.
  6. Check the boxes next to the comments you want to delete permanently, and click on “Delete Permanently.”

Option 3 – Disable Comments And Delete All Existing Comments:

If you want to disable comments and delete all existing comments on your website, you can do so by following the steps mentioned earlier in this article to disable comments globally. Once you have disabled comments, you can delete all existing comments using the bulk delete method mentioned above.

However, before you delete all existing comments, it’s important to back up your website in case you accidentally delete any important comments. You can do so by using a backup plugin or by exporting your website’s content.

vi. Disable Comments On Media Files:

In addition to disabling comments on posts and pages, you may also want to disable comments on media files such as images and videos. This can be done using the following steps:

  1. Log in to your WordPress dashboard.
  2. Click on “Media” from the left-hand menu.
  3. Find the media file that you want to disable comments for and click on it.
  4. On the right-hand side of the screen, you will see the media file details. Click on the “Edit” button next to “Discussion.”
  5. Uncheck the “Allow comments” box and click on “Update.”
  6. Repeat these steps for any other media files that you want to disable comments.

By disabling comments on media files, you can prevent users from leaving unwanted comments on your images or videos, which can be especially important if you are using your website to showcase your work or products.

It’s important to note that if you have previously allowed comments on your media files, disabling comments will not delete any existing comments. You will need to follow the steps mentioned earlier in this article to delete existing comments if you no longer want them to appear on your website.

Method 2. Disable Comments In WordPress Using WordPress Plugins:

If you are not comfortable with editing your theme or code, or if you want more control over your comment settings, you can use a WordPress plugin to disable comments on your website.

Here are a few WordPress Plugins that can be used to disable WordPress comments globally:

i. Disable Comments:

Disable Comments

The Disable Comments plugin is a simple and lightweight plugin that allows you to disable comments on your entire site or individual post types. Here’s how to use it:

1: Install and activate the Disable Comments plugin.

2: Select “Settings” and then “Disable Comments“.

3: Choose the post types where you want to disable comments.

4: Click the “Save Changes” button to save your settings.

ii. WP Disable Comments:

The WP Disable Comments plugin is another option for disabling comments on your WordPress site. It allows you to disable comments on specific post types or globally. Here’s how to use it:

1: Install and activate the WP Disable Comments plugin.

2: Go to “Settings” and then “WP Disable Comments“.

3: Choose the post types where you want to disable comments.

4: Select the option to disable comments globally if you want to turn off comments on your entire site.

5: Save your changes.

That’s it! The WP Disable Comments plugin will now prevent comments from being displayed on the selected post types or your entire site.

Note that if you have already approved comments on your site, they will still be visible unless you manually delete them or disable them one by one.

Method 3. Disable Comments In WordPress Via Custom Code:

If you prefer to use custom code to disable comments on your WordPress website, you can do so by adding code to your theme’s functions.php file or by creating a custom plugin. Here’s how to do it:

  1. Log in to your WordPress dashboard.
  2. Click on “Appearance” from the left-hand menu.
  3. Click on “Theme Editor“.
  4. Click on “Functions.php” from the list of files on the right-hand side of the screen.
  5. Now look for the following line of code:

<?php comments_template( ”, true ); ?>

  1. Go ahead and replace it with this line of code:

<!– Begin Comment

<?php comments_template( ”, true ); ?>

End Comment –>

7. To do the same with your site’s posts, navigate to your single.php file and find the following code:

<?php comments_template(); ?>

8. Then replace it with this code:

<!– Begin Comment

<?php comments_template(); ?>

End Comment –>

Remove “Comments Are Closed” In WordPress:

By default, WordPress displays the text “Comments are closed” on posts and pages where comments have been disabled.

However, you may want to remove this message if you have disabled comments on your entire site or on specific posts or pages. Here’s how to remove the “Comments are closed” message in WordPress:

  1. Log in to your WordPress dashboard.
  2. Click on “Appearance” from the left-hand menu.
  3. Click on “Theme Editor.”
  4. Click on “Functions.php” from the list of files on the right-hand side of the screen.
  5. Add the following code to the end of the file:

add_filter(‘comments_open’, ‘__return_false’, 20, 2);

add_filter(‘pings_open’, ‘__return_false’, 20, 2);

  1. Save the changes.

By adding this code to your functions.php file, you will disable comments and pings on all post types on your website. This will remove the “Comments are closed” message from posts and pages where comments have been disabled.

If you only want to remove the “Comments are closed” message without disabling comments and pings, you can use CSS to hide the message. Here’s how to do it:

  • Log in to your WordPress dashboard.
  • Click on “Appearance” from the left-hand menu.
  • Click on “Theme Editor.”
  • Click on “Style.css” from the list of files on the right-hand side of the screen.
  • Add the following code to the end of the file:

.comments-closed {

    display: none;

}

  • Save the changes.

By adding this code to your style.css file, you will hide the “Comments are closed” message using CSS. This will not disable comments and pings on your website, but it will hide the message from posts and pages where comments have been disabled.

Mistakes To Be Avoided While Disabling Comments:

While disabling comments on WordPress, there are a few mistakes you should avoid to ensure that your website functions properly and provides a good user experience. Here are some common mistakes to avoid:

1. Not Disabling Comments On Existing Posts And Pages:

If you have already published posts and pages on your website and want to disable comments, it’s important to go back and disable comments on those pages as well. Otherwise, visitors may still be able to leave comments on those pages.

2. Forgetting To Disable Comments On Media Files:

If you want to disable comments on your WordPress site, don’t forget to disable comments on media files as well. This can be done by going to Settings > Discussion and unchecking the “Allow people to post comments on new articles” box.

3. Disabling Comments On Pages Where Feedback Is Important:

If you have a contact page or a page where you want visitors to provide feedback, you should not disable comments on that page. Instead, consider using a contact form or another method of communication.

4. Not Checking The Impact On Third-Party Plugins:

Disabling comments on WordPress can impact third-party plugins that rely on comments to function properly. Make sure to check the impact of disabling comments on any plugins you have installed.

5. Removing Comment-Related Functions From Your Theme’s Code:

If you’re using a custom theme, make sure to avoid removing any comment-related functions from your theme’s code. Doing so can break your website and prevent it from functioning properly.

By avoiding these common mistakes, you can successfully disable comments on your WordPress site without any negative impact on your website’s functionality or user experience.

Conclusion:

Disabling comments on your WordPress site can help you avoid spam, save time on moderation, and create a distraction-free experience for your visitors.

There are several methods you can use to disable comments, including disabling comments on individual posts or pages, disabling comments for new posts and pages, disabling comments on existing posts and pages using a plugin, and removing comment sections from theme files.

Choose the method that works best for you, and make sure to test your website to ensure that everything is working as intended.

Frequently Asked Questions (FAQs):

Why Should I Disable Comments On My WordPress Site?

Disabling comments on your WordPress site can help protect your site from spam, negative comments, and other unwanted content. It can also help to improve your site’s load times and user experience.

Can I Disable Comments On Specific Posts Or Pages?

Yes, you can disable comments on specific posts or pages in WordPress. To do this, simply edit the post or page and uncheck the “Allow Comments” box in the “Discussion” section of the editor.

Can I Disable Comments On My Entire Site?

Yes, you can disable comments on your entire site in WordPress. To do this, go to Settings > Discussion and uncheck the “Allow people to submit comments on new posts” and “Allow link notifications from other blogs (pingbacks and trackbacks)” boxes.

Can I Remove The “Comments Are Closed” Message In WordPress?

Yes, you can remove the “Comments are closed” message in WordPress. To do this, you can add custom code to your functions.php file or use CSS to hide the message.

Will Disabling Comments Affect My Site’s SEO?

Disabling comments on your WordPress site should not have a negative impact on your site’s SEO. Also, it may help to improve your site’s load times and user experience, which can have a positive impact on your SEO.

Related Articles

Leave a Reply

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

Back to top button