How to Disable Comments on WordPress: 5 Ways to Do

This “How to disable comments on WordPress” guide will outline the 5 ways to disable comments.

Reasons to disable comments

  1. You don’t want spam.
  2. You don’t want to start a discussion on a specific post or page.

How to Disable Comments on WordPress: Table of Contents

  1. Using a plugin
  2. By allowing/disallowing on a specific post or page
  3. Quick edit method
  4. Disable comments by default
  5. Code example

1. Using a Plugin

Download “Disable Comments” plugin from WordPress’ plugin repository, install and activate it. Now, go to Settings -> Disable Comments.

How to Disable Comments on WordPress

Everywhere: Select “Everywhere” radio box to disable comments from all over the WordPress’ website.

On certain post types: Select this radio box, and then check the checkboxes (Posts, Pages or Media) to disable the comments where you want.

Note: Pingbacks and trackbacks will also be disabled along comments.


2. By allowing/disallowing on a specific post or page

You can also disallow comments from a specific post or page. Just open the post or page from your admin section on which you don’t want any discussion.

Click on “Screen Options” on the top right section.

The arrow section will open up like below:

After checking the “Discussion” checkbox, the discussion section will appear on the bottom of the page. Uncheck the “Allow comments” and “Allow trackbacks and pingbacks on this page.”


3. Quick edit method

Go to “Posts -> All Posts” or “Pages -> All Pages“. Hover over a post or page and click on “Quick Edit” link.

A quick edit section will appear. Uncheck the “Allow Comments” and “Allow Pings” checkboxes and hit the “Update” button.


4. Disable comments by default

Go to “Settings -> Discussion” and uncheck the checkbox “Allow people to post comments on new articles.” This will disable comments on all your future posts or pages.


5. Code example

Paste the following code snippet inside your functions.php. The snippet will automatically uncheck the “Allow Comments” checkbox from all your future posts and pages. See the attachment below of creating a new post:

add_action('init', 'remove_comment_support', 100);
function remove_comment_support() {
 remove_post_type_support( 'post', 'comments' );
 remove_post_type_support( 'page', 'comments' );
}

In this article

Join the Conversation