How to disable comments in WordPress?

Hello friends, In this article, we have to learn how to disable comments in WordPress. There are many ways to do this, and I will share my personal opinion about the best way to disable comments in WordPress.

You must log in to your WordPress dashboard to disable the comment form. 

Let’s start

WordPress login page

Once you have logged in to your WordPress dashboard, you’ll want to navigate to Settings, then click on the Discussion option.

Under the Default Post Settings, uncheck the option “Allow people to submit comments on new posts.

wordpress discussion setting page

To deactivate comments across the website, you’ll need to uncheck the box next to Other Comment Settings that says, “Automatically turn off comments on posts older than 0 days.”

Automatically close comments on posts

The checkbox should be selected, and the number of days should be entered as 0 After making these changes and clicking Save button at the bottom of your page, comments on all your website posts, whether old or new, will be blocked.

How do I disable comments on a specific post or page in WordPress?

First, click on the posts menu of your WordPress dashboard, which is located on the dashboard sidebar, then find the specific post for which you want to disable comments.

wordpress dashboard post page
wordpress dashboard single post page

Then uncheck the “Allow Comments” checkbox option. then click on the “update” or “publish” button. bingo You have successfully disabled comments for that specific post. You can do the same with pages.

How To Disable Comments If You’re Using the WordPress Classic Editor?

disable the comment form for specific posts and pages. If you’re using the classic editor, simply open the post that you want to disable comments for. Then, scroll to the section discussion.

If you can’t find the discussion section, you have to enable a checkbox for it. Look at the top right corner of your screen for a button labelled “screen option,” then check the discussion checkbox.

classic editor discussion option

You now have additional options for configuring your post or page comments, which are listed on the bottom side of your page.

discussion option for post

How to Bulk Edit and disable Comments on Specific Posts and Pages?

Go back to your WordPress dashboard and click on posts or pages to bulk change whether you want to disallow comments on a particular post or page.

Then look for and choose the specific posts which you want to bulk edit. Once you checked each checkbox, click Bulk Actions > Edit > Apply.

You can now disable comments for specific posts by using the “Comments” dropdown menu. Choose “Do not allow” from the drop-down menu, then click the “update” button. You can do the same process for the pages under the Pages section.

How to remove Comments form in WordPress using custom code?

#01 How to remove Comments form in WordPress using CSS only?

We can use the CSS below to remove the Comments form from WordPress. 

section#comments {
    display: none;
}

#02 How to remove Comments form using function file in WordPress?

We can remove comment forms from posts by using the code below; to remove comment forms from pages or media, simply change the post type to the code below.

function disable_comment_form( $open, $post_id ) {
 $post = get_post( $post_id );
 // for different post type change 'post' to which you want to change
 if( $post->post_type == 'post' ) {
 	return false;
 } 
}
add_filter( 'comments_open', 'disable_comment_form', 10 , 2 );

How to remove comment menu from WordPress dashboard?

// Removes from admin menu
add_action( 'admin_menu', 'my_remove_admin_menus' );
function my_remove_admin_menus() {
    remove_menu_page( 'edit-comments.php' );
}

Conclusion

Disabling the comment form in WordPress is a simple process. I hope that this blog helps you learn how to remove or disable the comment form in WordPress.

More WordPress Articles

Leave a Comment