Wordpress - Hide Comments

Posted on 2011-03-15
Last Modified: 2012-05-11
On a Wordpress site that I'm creating, I would like visitors to have the ability to submit comments for individual articles but don't want the comments to be visible on the page (so they would only be viewable once logged in to the admin).

Does anyone know how this can be done? It seems like a relatively simple request but I can't seem to find a solution for it. Thanks.
Question by:Adam

Expert Comment

ID: 35137677
If you set your comments to be moderated then they will only appear  after you / an admin approves them.

Did I understand your question properly?
LVL 39

Expert Comment

by:Aaron Tomosky
ID: 35137682
Just set comments need approval. That way nothing shows up on the page but admins can view all from the control panel

Expert Comment

ID: 35137699
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.


Accepted Solution

meb_santoso earned 500 total points
ID: 35137758
if you want the following:
-. everybody (general visitors, registered visitors, admins) can post comments (AND)
-. comments cannot be seen by non-admins (AND)
-. comments are only available for admins (AND)

then you can do the following:
-. edit page.php, single.php (and or other pages in your active theme)
-. look for where the comments are being displayed. Mostly using this function:
<?php wp_list_comments('reply_text=&nbsp;'); ?>

Open in new window

-. put the following line:
<?php if ( current_user_can('manage_options') )
	<?php wp_list_comments('reply_text=&nbsp;'); ?>
     } else  {

Open in new window

Good luck, and please do correct me if I'm wrong :-)

Author Closing Comment

ID: 35138735
Thanks for the replies everyone - they were greatly appreciated.

But special thanks to meb_santoso as I think his solution worked best for what I was looking for.

Expert Comment

ID: 35138872
good that it works out for you :-) and thanks for the points

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
PHP Warning:  mysqli_real_escape_string() expects exactly 2 parameters 4 25
PHP Mail error 3 26
Undefined variable problem 5 22
AJAX Wordpress Not Reading Variable 2 27
Introduction This article is intended for those who are new to PHP error handling (  It addresses one of the most common problems that plague beginning PHP develop…
Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question