Remove Comments from pages in WordPress

No Comments

Just found the perfect opportunity to post a mini-tutorial! Setting up this new site is proving productive. Anyway..

Firstly, you should know which theme is the current active theme. To do this, log into the admin dashboard, and go to “Appearance” -> “Themes”. It should be listed at the top of the page. Once you know this, you can move on.

There are a couple of options from here to access the file we need to change. One is FTP (which I hate) and the other is SSH (which I love). However you access the file, it doesn’t matter. Navigate to {wordpress root}/wp-content/themes/ on the server. Pick the theme which is currently active on your blog (it should be obvious, and named similar to what you found before).

Now, if you’re using FTP, download the page.php file. (Did I mention I hate FTP?) Edit the file as below and re-upload.

If you’re using SSH, use this command:

nano page.php

and edit the file as below. After editing save with Ctrl+O and Ctrl+X.

What to edit:

Find this in the file:

<?php comments_template(); ?>

Or at least, something similar to it. Now, change it to this:

<?php // comments_template(); ?>

Basically, “//” ‘comments’ out the comments and prevents it from loading.

And that’s all! Everything should be fine now, and you won’t have comments on pages.

Leave a Reply