Visit Eventchamp WordPress theme to create a new events & conference website. Eventchamp WordPress Events Theme

5 Steps to Disable Comments in WordPress

Table of Contents

There are a number of reasons why you might want to disable comments in your WordPress site. Maybe you don’t want to deal with the hassle of moderating comments, or perhaps you’re running a one-person show and don’t want to be inundated with notifications every time someone leaves a comment.

Whatever the reason, disabling comments in WordPress is a relatively simple process that can be accomplished in just a few steps. In this article, we’ll go over the various methods for disabling comments in WordPress and provide step-by-step instructions for each method.

How to Disable Comments in WordPress Globally

Disable Comments Settings

The easiest way to disable comments in WordPress is to do it globally, which means that comments will be disabled on all posts and pages on your site. To disable comments globally, follow these steps:

  1. Log in to your WordPress dashboard.
  2. Go to Settings > Discussion.
  3. Under the “Default article settings” section, uncheck the box next to “Allow people to post comments on new articles.”
  4. Scroll down and click the “Save Changes” button.

That’s it! Now comments will be disabled on all new posts and pages on your site. If you want to disable comments on existing posts and pages, you’ll need to follow the instructions in the next section.

How to Disable Comments on Individual Posts and Pages

Disable Comments on Posts and Pages

If you only want to disable comments on certain posts and pages, you can do so by editing the individual post or page. Here’s how:

  1. Log in to your WordPress dashboard.
  2. Go to the post or page you want to edit.
  3. Scroll down to the “Discussion” section.
  4. Uncheck the box next to “Allow comments.”
  5. Update or publish the post or page.

Now comments will be disabled on that specific post or page. If you want to disable comments on multiple posts or pages at once, you can do so by using the Bulk Edit feature.

How to Disable Comments Using the Bulk Edit Feature

Disable Comments

The Bulk Edit feature in WordPress allows you to make changes to multiple posts or pages at once. To use it to disable comments, follow these steps:

  1. Log in to your WordPress dashboard.
  2. Go to Posts or Pages, depending on which type of content you want to edit.
  3. Check the boxes next to the posts or pages you want to edit.
  4. From the “Bulk Actions” dropdown menu, select “Edit.”
  5. Click the “Apply” button.
  6. In the “Comments” section, select “Do not allow” from the dropdown menu.
  7. Click the “Update” button.

Now comments will be disabled on all of the selected posts or pages.

How to Disable Comments Using a Plugin

Disable Comments Plugin

If you don’t want to mess with the code or settings in your WordPress site, you can use a plugin to disable comments. There are several plugins available that can do this, but one of the most popular is the Disable Comments plugin. To use it, follow these steps:

  1. Log in to your WordPress dashboard.
  2. Go to Plugins > Add New.
  3. In the search bar, type “Disable Comments” and press Enter.
  4. Click the “Install Now” button for the Disable Comments plugin.
  5. Click the “Activate” button.

Using the Disable Comments plugin is easy and straightforward. After installation and activation, the plugin will automatically disable comments on all posts, pages, and custom post types. If you want to re-enable comments on specific post types or individual posts or pages, you can do so by going to the plugin’s settings page.

To access the settings page, go to Settings > Disable Comments. From here, you can choose which post types to enable or disable comments on, as well as override the settings for individual posts or pages.

If you don’t want to use the Disable Comments plugin, there are other options available as well. Some other popular plugins for disabling comments in WordPress include:

  • No Page Comment Plugin: This plugin allows you to disable comments on individual pages or all pages on your site.
  • Disable Comments Plugin: This plugin allows you to disable comments on individual posts or pages, as well as globally on your site.

No matter which plugin you choose, be sure to read the reviews and instructions carefully to ensure that it meets your needs and is compatible with your WordPress site.

How to Disable Comments in the WordPress Code

If you’re comfortable working with code and don’t want to use a plugin, you can disable comments in WordPress by modifying your theme’s functions.php file. To do this, follow these steps:

  1. Log in to your WordPress dashboard.
  2. Go to Appearance > Editor.
  3. On the right-hand side, select the functions.php file from the list of theme files.
  4. Scroll to the bottom of the file and add the following code:
// Disable comments on all 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('edit-comments.php');
}
add_action('admin_menu', 'df_disable_comments_admin_menu');

// Redirect any user trying to access comments page
function df_disable_comments_admin_menu_redirect() {
	global $pagenow;
	if ($pagenow === 'edit-comments.php') {
		wp_redirect(admin_url()); exit;
	}
}
add_action('admin_init', 'df_disable_comments_admin_menu_redirect');
  1. Click the “Update File” button to save your changes.

This code will disable comments on all post types, close comments on the front-end of your site, hide existing comments, remove the comments page from the WordPress menu, and redirect any users trying to access the comments page.

It’s important to note that modifying the functions.php file can have unintended consequences if you’re not careful. Be sure to create a backup of your site before making any changes, and consider hiring a professional if you’re not comfortable working with code.

How to Disable Comments Using a Theme

Some WordPress themes come with built-in options for disabling comments on specific post types or individual posts or pages. The specific steps for doing so will vary depending on the theme you’re using, but here are some general guidelines:

  1. Log in to your WordPress dashboard.
  2. Go to Appearance > Themes.
  3. Click on the theme you’re using to access its options page.
  4. Look for a section related to comments, such as “Discussion” or “Post Settings.”
  5. Follow the instructions provided by the theme to disable comments on specific post types or individual posts or pages.

Keep in mind that not all themes will have this feature, so you may need to use one of the other methods outlined in this article if you can’t find an option to disable comments through your theme.

Conclusion

In this article, we’ve gone over five different methods for disabling comments in WordPress. Whether you want to disable comments globally, on individual posts or pages, or by using a plugin or code, there’s a method that will work for you.

Remember to consider your specific needs and comfort level when choosing the best method for disabling comments on your WordPress site. And as always, be sure to create a backup of your site before making any major changes.

Katerina Valeria
Katerina Valeria
Hi there! My name is Catherine and I am a professional content creator with a focus on WordPress. I write blog articles for Gloria Themes, sharing my knowledge and expertise on all things related to this popular website platform.

Subscribe to Our Newsletter for Updates, Tips, and Offers

Facebook
Twitter
LinkedIn
Pinterest
WhatsApp

Hand-Picked Related Articles

If you’re looking for helpful tips and tricks on improve your WordPress website or improving your web design skills, be sure to check out our related articles for valuable insights and resources.

What Is a WordPress Slug?

Explore the depth of WordPress Slugs: potent SEO tools and navigational guides, crafting a seamless user journey while boosting visibility.