wyc
wyc

Reputation: 55283

How do I get rid of the "Your comment is awaiting moderation." message in Wordpress?

I coudn't find the php that generates that or do I have to deactivate it from the Site admin?

Upvotes: 0

Views: 3726

Answers (3)

user3808951
user3808951

Reputation: 11

Easiest way without cracking the code or bothering with a child theme is to hide it using css. In the theme I'm looking at now, that text is in a span tag assigned to the class "comment-await"

<span class="comment-await">Your comment is awaiting moderation.</span>

Most themes now offer a custom css option in the Customize section, so:

span.comment-await{display:none;}

You can play with changing the text by using css before or after selectors. Of course, you only want to do this for little changes, It it gets extensive the right way is to create a child theme and override the theme by editing comments.php (or other relevant file)

Upvotes: 1

TheDeadMedic
TheDeadMedic

Reputation: 9997

You'll need to use your own callback for wp_list_comments() - check out Twenty Ten's comment callback twentyten_comment() as an example.

You'll see a line something along the lines of;

<?php if ( $comment->comment_approved == '0' ) : ?>
    <em><?php _e( 'Your comment is awaiting moderation.', 'twentyten' ); ?></em>
    <br />
<?php endif; ?>

You could pretty much copy and paste twentyten_comment() into your own theme, removing the block of code above, and then using wp_list_comments('callback=my_comment_callback') in comments.php.

Upvotes: 2

Matt Mitchell
Matt Mitchell

Reputation: 41823

  1. Download and Install Notepad++.
  2. Open Notepad++
  3. Hit "Ctrl-F" to get a Find dialog.
  4. Change to the Find in Files tab ("Ctrl-Shift-F" might shortcut you here).
  5. Change the filter to *.php
  6. Change the location to your wordpress folder
  7. Ensure you have Search in Subdirectories enabled.
  8. Search for "Your comment is awaiting"

Upvotes: 0

Related Questions