How can you disable WordPress comment?

You can disable the WordPress comment on the dashboard. On the panel, unde

To disable comments in WordPress, you can follow these steps:

  1. Disable Comments Globally:
    • Go to your WordPress dashboard.
    • Navigate to Settings > Discussion.
    • Uncheck the option “Allow people to post comments on new articles”.
    • Save changes.
  2. Disable Comments on Specific Posts or Pages:
    • While editing a post or page, scroll down to the Discussion meta box.
    • Uncheck the option “Allow comments”.
    • Update the post or page.
  3. Bulk Disable Comments:
    • Go to your WordPress dashboard.
    • Navigate to Posts or Pages (depending on where you want to disable comments).
    • Select multiple posts or pages.
    • From the Bulk Actions dropdown, choose “Edit”.
    • Click Apply.
    • In the Comments dropdown, choose “Do not allow”.
    • Update.
  4. Disable Comments via Code (Advanced):
    • If you’re comfortable with editing theme files or using custom plugins, you can disable comments programmatically. For example, you can add the following code to your theme’s functions.php file:
      php
      function 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', 'disable_comments_post_types_support');

      // Close comments on the front-end
      function disable_comments_status() {
      return false;
      }
      add_filter('comments_open', 'disable_comments_status', 20, 2);
      add_filter('pings_open', 'disable_comments_status', 20, 2);

Remember to always backup your site before making changes, especially if you’re editing theme files or using code snippets.

r the options- discussion you find “Allow people to post the comment.” Uncheck this to disable comment.