How to remove page comment boxes from WordPress.org themes
This is a technical post specifically for WordPress.org bloggers. Recently I wrote a post showing how to remove a page’s comment box in a WordPress.com blog, as this kind of blog does not provide the option to go into the code to change it, and my research revealed the process in the ‘Quick Edit’ menu.
But going through my analytics I noted I had a lot of hits for the keyphrase relating to removing comment boxes from pages, but they all seemed to bounce without being read. Why was this? Then I realised it was because I wasn’t explaining how to do this in a WordPress.org blog. So here’s how:
Go to page.php and check it refers to comments.
Look for this code: <?php comments_template( “, true ); ?>
You can either delete this, or block its action by inserting // immediately after ?php:
<?php// comments_template( ” , true ); ?>
If you want to reactive it again, merely remove the //
Remember to activate comments in the Settings > Discussion menu.
There you go… hope it works and you have pages that are comment box free on your blog.
Latest posts by Alice Elliott (see all)
- 12 reasons why spammers are rubbish at proper blog commenting - 13 March 2017
- 10 ways to bring blogging back to the top of your to do list - 10 March 2017
- How to Build a Strong Online Presence: Tips and Tools - 6 March 2017
- 4 reasons why readers are prevented from commenting on blogs - 21 February 2017