Removing Comments from Pages WordPress

Comments are an essential part of any blog. Comments on pages, however, are not necessary and often times intrusive to the overall design. It may seem at first that their is no easy way to turn off comments on pages. That may be the case, but before you turn to a plugin to solve this problem, let’s dig into the code instead.

To navigate to your WordPress website’s code, make sure that you are an admin and hover over “Appearance” in the side menu. From the drop down list, choose “Editor.” Inside this editor lives the core files of your website. Look through the list on the left hand side of the screen and find the link titled “page.php” and click on it.

Inside this file is the PHP which acts dynamically to fill each page of your website with the relevant content. The overall makeup of this page is very simple and straight forward. Their is a header, a loop (content call), sidebar call, comment call and finally footer call. We want to locate the comment call and eliminate it.

Removing Comments in WordPress

Scroll down through the code and find the piece of code that looks like this <?php comments_template(); ?> and cut it to your clipboard. Hit the big blue “Update File” button at the bottom of the page. Now go back to your pages and see if the comments are still showing through. If there are any errors as you navigate through the site, go back to where you copied out the code and paste it back in and save. This should fix back the error.

If your comments are gone, however, then congratulations!

BONUS: Don’t throw away that handy little piece of PHP code: <?php comments_template(); ?>

It can be used anywhere inside of your other PHP files to add a comments area. Try a comments field in your index.php or footer.php file. These may not be that attractive of options either, but it can be fun to experiment.

Have you had success adding or removing comments on your site? Tell us about it in the comments!

Avatar photo

Written by: Jophiel Silvestrone

Jophiel Silvestrone has written 325 posts in the Tech Blog.

Jophiel grew up on a ranch in Paradise Valley, Montana near Chico Hot Springs. Working on the ranch instilled work ethic and self motivation. Filled with this drive, Jophiel started mowing the local school's yards twice a month throughout the summers, at the age of 12. He moved to Billings in 2004, where he has been deeply involved in the local business community ever since. A serial entrepreneur, Jophiel has ran multiple businesses in our local community. The first business, a janitorial and carpet cleaning company, founded in 2005, has employed over 50 locals. Moving on to the media industry, Jophiel and several partners founded Green Directory Montana in the spring of 2007. Green Directory's sustainability ranking software awarded points based on sustainable or "green" actions. These points counted towards a business's total "Green Score," which in turn ranked them against other businesses in their category and throughout the entire site. It also featured a limited edition print version distributed annually. A business acquisition allowed Jophiel to focus on new projects, and a few close business colleagues and Jophiel started Rocky Mountain Mr. & Ms. Magazine, a lifestyle publication for men and women in the Magic City. After a year and a half at the helm of RM3 Magazine, the business was purchased. He now runs a web development company SkyPoint Studios and fathers his son Jaoquin, who plays football, basketball, soccer, and is learning snowboarding from his dad. Recently, has expanded to locations in Havasu, Arizona & Vegas. SkyPoint Studios is a market leader in both Billings & Havasu and Jophiel is working on building that same level of market dominance in Vegas. Specialties: Extensive experience in online and offline business. Especially savvy at WordPress, and operate several sites, one example is the blog: skypointwebdesignbillingsmontana.com/tech-blog. Check out skypointwebdesignbillingsmontana.com for the latest projects from SkyPoint Studios.

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.