WordPress - How to Disable Comments

WordPress - How to Disable Comments

In this article, we will explain how to disable comments on the whole website.

1. Navigate to the WordPress dashboard >> plugins >> Add new



2. Install and activate the file manager plugin 



3. Open file manager plugin from WordPress dashboard.



4. Navigate to the wp-content\themes\massive-dynamic

5. Open functions.php file into the "code editor" mode.



6. Add the below codes into the function.php file and save it.
  1. // Close comments on the front-end
  2. function df_disable_comments_status() {
  3.  return false;
  4. }
  5. add_filter('comments_open', 'df_disable_comments_status', 20, 2);
  6. add_filter('pings_open', 'df_disable_comments_status', 20, 2);

  7. // Hide existing comments
  8. function df_disable_comments_hide_existing_comments($comments) {
  9.  $comments = array();
  10.  return $comments;
  11. }
  12. add_filter('comments_array', 'df_disable_comments_hide_existing_comments', 10, 2);


    • Related Articles

    • Massive Dynamic - disable comments

      In this article, we will explain how to disable comments. 1. login to the WordPress dashboard 2. Form the left hand-sidebar choose posts or pages. 3. Open the page or the post which you want to disable comments from it, in edit mode 4. From the ...
    • WordPress - Revisions

      In this article, we will show how to use revisions on WordPress. Revision is a feature that allows you to undo changes and go back to an earlier version of a post or a page. For using this feature follow these steps: 1. Login to the Wordpress ...
    • WordPress - How to Reset my WordPress Website?

      We are going to use WordPress reset plugin for doing that. Before we start, you should know that: After reset, all website content including pages, posts and media and all settings will be deleted. Plugins and theme will not be deleted, but you ...
    • WordPress - Increasing WordPress memory limit

      If you want to increase the WordPress memory limit, you can use one of the following methods: 1. Increasing memory limit through "wp-config.php": Please go to the root directory of WordPress and open "wp-config.php". Then find the line that has ...
    • WordPress - How to disable revolution slider on mobile devices

      In this article, we will explain how to disable the revolution slider on mobile devices. 1. login to the WordPress dashboard 2. Choose revolution slider from the left-hand sidebar 3. Open the setting panel of the slider which you want 4. Open Layout ...