Deleting that pesky comment field from your WordPress pages

How about a little WordPress tip for today? If you’re using a WordPress to run your site like I am and want to remove the comment field from the pages other than your blog, just do the following.

On your WordPress admin page, click on “Appearance,” then “Editor”. In the Editor page, click on the “Page Template” from among the templates listed on the right-hand side. You are now editing the basic template used to make the pages on your WordPress site. Find the code that reads:

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


and change it to this:

<?php// comments_template( ”, true ); ?>

Do you see the difference? You just add two forward slashes after “<?php”. That’s the line of code that adds comment fields to your pages. Putting those two slashes in turns that code into a comment (not the comment field we were just talking about; a comment in the code instead of the actual code itself), which WordPress then doesn’t use when building the page, effectively turning comment fields “off” for regular pages. Comments on your blog posts, however, will still remain. After you add those two slashes, make sure to click the “Update File” button below the Editor window. If you ever want those comment fields back (though I don’t know why you’d want to enable people to comment on your welcome page, etc.), just go back to the Page Template in the Editor and delete those two slashes.