There are several ways to disable comments in WordPress:
From the WordPress administration panel
- Go to the “Settings > Discussion” page.
- Uncheck the “Allow people to post comments on new posts” option.
- Click the “Save Changes” button.

This will disable comments on all new posts and pages. If you want to disable comments on existing posts and pages, you can do so by editing each post or page and unchecking the “Allow comments” option.

Using a plugin
There are several plugins available that allow you to disable comments in WordPress. One popular plugin is “Disable Comments”.
To use this plugin:
- Install and activate the plugin.
- Go to the “Settings > Disable Comments” page.
- Check the options to disable comments on posts, pages, attachments, and other post types.
- Click the “Save Changes” button.
Using custom code
You can also disable comments in WordPress by adding the following code to your theme’s functions.php
file:
// Disable support for comments and trackbacks in post types
function df_disable_comments_post_types_support() {
$post_types = get_post_types();
foreach ($post_types as $post_type) {
if(post_type_supports($post_type, 'comments')) {
remove_post_type_support($post_type, 'comments');
remove_post_type_support($post_type, 'trackbacks');
}
}
}
add_action('admin_init', 'df_disable_comments_post_types_support');
// Close comments on the front-end
function df_disable_comments_status() {
return false;
}
add_filter('comments_open', 'df_disable_comments_status', 20, 2);
add_filter('pings_open', 'df_disable_comments_status', 20, 2);
// Hide existing comments
function df_disable_comments_hide_existing_comments($comments) {
$comments = array();
return $comments;
}
add_filter('comments_array', 'df_disable_comments_hide_existing_comments', 10, 2);
// Remove comments page in menu
function df_disable_comments_admin_menu() {
remove_menu_page('
Was this post helpful?
Let me know if you liked the post. That’s the only way I can improve. 🙂