WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to display comment form validation errors (as well as captcha error) on the comment form itself and not on a different page. How can I do that?

share|improve this question
up vote 1 down vote accepted

This question have answered again, here

Also you can do the same with JQuery and Validation plugin

share|improve this answer
Used the jquery with some extra configuration and captcha adjustments – hannit cohen Jan 27 '11 at 2:40

I was facing same problem and was searching for solution i found the solution

Open your function.php file and past below code:

    function comment_validation_init() {
    if(is_single() && comments_open() ) { ?>        
    <script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.9/jquery.validate.min.js"></script>
    <script type="text/javascript">
    jQuery(document).ready(function($) {

    rules: {
      author: {
        required: true,
        minlength: 2

      email: {
        required: true,
        email: true

      comment: {
        required: true,
        minlength: 20

    messages: {
      author: "Please fill the required field",
      email: "Please enter a valid email address.",
      comment: "Please fill the required field"

    errorElement: "div",
    errorPlacement: function(error, element) {

    add_action('wp_footer', 'comment_validation_init');

For giving style:

.error  { padding: 10px 0 20px 0; color: #FF0000; }
input.error, textarea.error { color:#000000; }
share|improve this answer
Please add an explanation. What does your code exactly? And never use the wrong jQuery version, always enqueue the built-in jQuery. – toscho Jan 31 '14 at 7:35

protected by Community Mar 31 '15 at 13:28

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.