Breaking News
Home / Webmaster / How to disable comments in all WordPress pages?

How to disable comments in all WordPress pages?

Wordpress Logo

By default the comments are enabled on the WordPress pages. Let’s say you want to disable the comments box on all the pages because you don’t any discussion on these pages or you are getting SPAM comments. Out of the box, WordPress does not offer a toggle or checkbox gui interface where you can go in and disable the comments for pages. The same exists if you want to disable comments on all Posts but not for Pages.

In order to disable the comments from all pages, you would have to modify a file in your theme. So go into the theme editor and open the file named page.php

Locate the following line, it would be some where near the bottom and remove it from the file, save the file.

<?php comments_template( '', true ); ?>

The following screenshot shows how to display in via the WordPress theme editor.

Disable Pages Comment in Wordrpress

Now go back and check you should see the  comment box has been disabled on all the pages.[pb_builder]

Check Also

How to increase the file upload limit in Drupal?

By default the file upload limit is set to 2MB and these days any time …

Leave a Reply