How to Disable Comments in WordPress?

While comments sections can be a valuable tool for fostering engagement and cultivating a community on your WordPress site, they can also serve as a hotbed for spam, harmful links, and even offensive or self-promoting content. Additionally, there may be instances where comments sections are unnecessary on certain WordPress websites.

Thankfully, WordPress provides users holding the Administrator role with a straightforward means of overseeing comment sections on their website, and if necessary, deactivating them across some or all of their web pages.

This article will explore the reasons why an Administrator might opt to deactivate comments, either on certain web pages or throughout the entire website. Subsequently, I will outline the steps for disabling comments on:

Why Disable Comments in WordPress?

There are various reasons why an Administrator may choose to disable comments in WordPress. Here are a few common ones:

  1. Spam: Comments sections can attract spam comments that can be time-consuming and difficult to moderate. Disabling comments can help prevent spam.
  2. Negative or harmful comments: Some comments may be offensive, inappropriate, or harmful to other users. Disabling comments can help maintain a positive and safe online environment.
  3. Lack of engagement: In some cases, comments sections may not be generating the level of engagement that an Administrator had hoped for. Disabling comments can help eliminate clutter and streamline the website.
  4. Focus on other engagement methods: An Administrator may choose to focus on other forms of engagement, such as social media or email newsletters, instead of comments sections.

By disabling comments, Administrators can exert more control over the content on their website and improve the user experience for visitors.

How to Disable Comments in WordPress?

In WordPress, you have the flexibility to modify the default comment settings on a per-page or per-post basis, for multiple pages or posts simultaneously, or across the entire site. Additionally, you can customize other settings related to comments, such as comment moderation and notification preferences, through the WordPress discussion settings.

WordPress has a default setting that disables comments on pages and enables comments on posts. This is because typically you wouldn’t want visitors to leave comments on your primary pages, such as your homepage, but may want to encourage comments on content like blog posts.

How to Disable Comments on a Single Post or Page in WordPress?

There may be instances where you want to keep comments enabled throughout your website but wish to disable them for particular posts.

To disable comments on an individual post or page:

  1. Select Posts > All Posts or Page > All Pages in the left side panel of the dashboard.
  2. Hover over the specific post and select Edit.
  3. Under the Discussion section in the right panel, uncheck the box next to Allow comments.
  4. Click Update.

When you deactivate comments on a page or post, any pre-existing comments will not be deleted.

To delete an existing comment:

  1. Select Pages > All Pages or Posts > All Posts from the dashboard.
  2. Check the boxes of all posts you want to edit.
  3. In the Bulk Actions dropdown menu, select Edit, then Apply.
  4. In the Comments dropdown menu, select Do not allow.
  5. Click Update.

How to Disable Comments Globally in WordPress?

To disable commenting on an entire WordPress site, you will need to complete a three-step process: Firstly, turn off comments on new posts, secondly, disable comments on old posts, and finally, if desired, delete some or all of the existing comments.

To disable all comments on future posts:

  1. Select Settings > Discussion from the dashboard.
  2. Uncheck the box next to Allow people to post comments on new articles.

Click Save Changes at the bottom of the page.

To disable comments on existing posts:

  1. Select Settings > Discussion from the dashboard.
  2. Check the box next to Automatically close comments on articles older than _ days and set the number of days to zero.
  3. Click Save Changes at the bottom of the page.

To delete existing comments on your site: 

  1. Select Comments from the dashboard.
  2. Check the boxes of all comments you want to delete.
  3. Select Bulk Actions > Move to Trash.
  4. Click Apply.

How to Disable Comments on Media Files in WordPress?

After disabling comments on your posts and pages, comments may still be enabled for your media files. However, you can deactivate comments on individual media attachments by accessing the Media Library, or alternatively, disable comments for multiple media files at once by making adjustments to the source code.

To disable comments on a single media attachment:

  1. Select Media > Library from the dashboard.
  2. Click the media item you want to edit.
  3. Select Edit more details in the right panel.
  4. Under the Discussion section, uncheck the box next to Allow comments. This region might be hidden. If so, display it by selecting Discussion in Screen Options.
  5. In the Save section, click Update.
If you have a substantial number of media attachments on your site, disabling comments individually can be time-consuming. In this case, you may want to consider using a code snippet to deactivate comments on all media files at once.

To disable comments for all media attachments on your site:

  1. Open the “functions.php” file of your WordPress theme.
  2. Paste the following code at the bottom of the file, then save the file:
FUNCTION FILTER_MEDIA_COMMENT_STATUS( $OPEN, $POST_ID ) {


    $POST = GET_POST( $POST_ID );


    IF( $POST->POST_TYPE == 'ATTACHMENT' ) {


        RETURN FALSE;


    }


    RETURN $OPEN;


}


ADD_FILTER( 'COMMENTS_OPEN', 'FILTER_MEDIA_COMMENT_STATUS', 10 , 2 );

How to Disable Comments With a WordPress Plugin?

While WordPress offers an interface for disabling comments and modifying other related settings, you may prefer to use a plugin to disable comments on your website instead. One such widely used and reliable plugin is Disable Comments, which can disable comments on your entire WordPress site with a single click.

To disable comments globally with the Disable Comments plugin:

  1. Install the plugin from the download page.
  2. After installation, select Settings > Disable Comments from your dashboard.
  3. From here you can disable comments on all pages, posts, and media. You can also disable comments only on certain post types.
  4. Click Save Changes.

How to Remove the ‘Comments Are Closed’ Message in WordPress?

After you disable comments, your pages might display a “comments are closed” message at the bottom. To get rid of this message:

  1. Connect to your WordPress site using an FTP client.
  2. Open the current theme folder, which is in the directory “/wp-content/themes/”.
  3. Find the file “comments.php” and rename it to “comments_old.php”.
  4. Create a new file and name it “comments.php”. Doing this should remove the message.

If your theme does not include a “comments.php” file, it is recommended that you contact the theme’s developer to determine the best course of action to address this issue.

It’s worth noting that comments may be suitable for some websites but not for others. Ultimately, it depends on your personal preference and whether you believe that comments will be beneficial to your website. It’s possible to offer high-quality content without comments and allow visitors to decide for themselves whether your website is worth revisiting.