How to display a moderation-message with a comment after posting a comment.

The workflow should be:

  • post a comment

  • wp thinks this one has to be moderated

  • user sees his comment with a messe like "thx but you cannot see it since its in moderation"

  • stretchgoal: this message should be visible every time the users visits (cookie?)

  • the messages disapears when the comment gets deleted or approved

Is there a way to do this? Thanks

ps: this is a crosspost from http://getsatisfaction.com/wordpress_snippets/topics/show_if_comment_is_in_moderation

1 Answer 1


use the follow var: $comment->comment_approved and check for the value

<?php if (0 == $comment->comment_approved) { ?>
       <em><?php _e('Your comment must approved.', FB_BASIS_TEXTDOMAIN) ?></em>
<?php } ?>

code example: http://code.google.com/p/wp-basis-theme/source/browse/trunk/basis/comments.php

  • How can you custom tailor this message to only the person who created the comment? I have a problem right now where the cookie is not being set when a comment is being created and I am not sure why.
    – Radmation
    Jun 14, 2018 at 20:39
  • You should create a new question to get a solid answer. Also the hint, is the user logged in or not, then you have only his cookie to identifier.
    – bueltge
    Jun 15, 2018 at 8:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.