Title: re-captcha problems
Last modified: August 19, 2016

---

# re-captcha problems

 *  [wolkenunddreck](https://wordpress.org/support/users/wolkenunddreck/)
 * (@wolkenunddreck)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/re-captcha-problems/)
 * Hi,
 * I am trying to include the recaptcha plugin. Unfortunately the
    template I am
   using did not inculde the necessary code:
 * do_action(‘comment_form’, $post->ID);
 * I added this code in the file: comments.php and now the captcha is
    correctly
   display and it works!
 * The problem is now, that the comments can not longer be moderated. The
    commnents,
   if the right captcha code is entered, are simply appearing right from the start.
   Comment function is enabled.
 *     ```
       //here comes the code.
   
       <?php if ($comments) : ?>
        <h2 id="comments"><?php comments_number('No Responses','One Response','% Responses' );?></h2> 
   
        <ol class="commentlist">
   
        <?php foreach ($comments as $comment) : ?>
   
         <li class="<?=$oddcomment;?>" id="comment-<?php comment_ID() ?>">
   
       	<strong><?php comment_author_link() ?></strong><br/>
   
          <p class="commentmetadata"><a href="#comment-<?php comment_ID() ?>" title=""><?php comment_date('F jS, Y') ?> at <?php comment_time() ?></a><?php edit_comment_link('Edit comment',' ~ ',''); ?></p>
   
          <?php comment_text() ?>
   
         </li>
   
         <?php /* Changes every other comment to a different class */
          if("graybox" == $oddcomment) {$oddcomment="";}
          else { $oddcomment="graybox"; }
         ?>
   
        <?php endforeach; /* end for each comment */ ?>
   
        </ol>
   
        <?php else : // this is displayed if there are no comments so far ?>
   
         <?php if ('open' == $post-> comment_status) : ?>
         <!-- If comments are open, but there are no comments. -->
   
         <?php else : // comments are closed ?>
         <!-- If comments are closed. -->
         <br/>
         <p>(comments are closed).</p>
   
        <?php endif; ?>
       <?php endif; ?>
   
       <?php if ('open' == $post-> comment_status) : ?>
   
       <h3 id="respond">Leave a Comment</h3>
       <form action="<?php echo get_settings('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
   
       <p><input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" class="styled" />
       <input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
       <input type="hidden" name="redirect_to" value="<?php echo htmlspecialchars($_SERVER["REQUEST_URI"]); ?>" />
       <label for="author">Name</label></p>
   
       <p><input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" class="styled" />
       <label for="email">Mail (will not be published)</label></p>
   
       <p><input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" class="styled" />
       <label for="url">Website</label></p>
   
       <!--<p><strong>XHTML:</strong> You can use these tags: <?php echo allowed_tags(); ?></p>-->
   
       <p>
       <textarea name="comment" id="comment" cols="100%" rows="10" tabindex="4" class="styled"></textarea></p>
   
       <?php if ('none' != get_settings("comment_moderation")) { ?>
        <p><small><strong>Please note:</strong> Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.</small></p>
       <?php } ?>
   
       <p><input name="submit" type="submit" id="submit" tabindex="5" value="Submit Comment" /></p>
       <?php
       do_action('comment_form', $post->ID); ?>
       </form>
       ```
   
 * ///end of code
 * Are you able to find any problems within this code? I ‘ve tried hard, but I can’t.
   I am thankful for all hints!
 * Best greetings, mathias

The topic ‘re-captcha problems’ is closed to new replies.

## Tags

 * [Comments](https://wordpress.org/support/topic-tag/comments/)
 * [moderation](https://wordpress.org/support/topic-tag/moderation/)
 * [reCAPTCHA](https://wordpress.org/support/topic-tag/recaptcha/)

 * 0 replies
 * 1 participant
 * Last reply from: [wolkenunddreck](https://wordpress.org/support/users/wolkenunddreck/)
 * Last activity: [15 years, 9 months ago](https://wordpress.org/support/topic/re-captcha-problems/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
