WordPress: How to Disable Comments on Pages CodeUnit 28 DEC 2011

Some WordPress themes come packed with an option to turn on or off comments on pages. However, a lot don’t, and more often than not, you don’t actually want a long comment list on a page, as that is usually intended to be a pretty much static snapshot of information.

So how do you turn off (disable) comments on pages then if your theme doesn’t allow it?

Well the short answer is that you are going to have to edit your theme’s files, namely either the page.php or loop-page.php file if it exists. Somewhere in the file you will see a line that includes the template function call:

<?php comments_template(); ?> 

To remove comments from your pages, simple delete this line. This will stop the page from loading the comments template and thus your problem will be solved.


Related Posts:

About Craig Lotter

South African software architect and developer at Touchwork. Husband to a cupcake baker and father to two little girls. I don't have time for myself any more.