Back to Top

BWP reCAPTCHA released!

Previous Post:

BWP reCAPTCHA released!

Support for this plugin has been moved to the BWP Community!

My very first plugin, BWP reCAPTCHA, has been released! This plugin utilizes the popular anti-spam library, reCAPTCHA, to help your blog stay clear of spams. This plugin provides better user experience by allowing you to integrate with Akismet. Fighting spam has never been so effective!

Features at a glance

  • Add reCAPTCHA to comment form or registration pages
  • Hide reCAPTCHA for qualified visitors
    • Registered Users (even with no capabilities needed)
    • Authorized Users (users who have some capabilities, you can extend the default list)
    • Visitors who have at least a required number of approved comments
  • Choose how the plugin reacts when an answer is wrong or empty
  • Choose between 4 default themes or create your own (sample CSS and images provided)
  • Choose a language you prefer, possibility to add more language if needed
  • Option to load media files (CSS, JS, etc.) only when needed
  • Possibility to integrate with Akismet, allowing better protection against spam and better end-users experience, i.e. “only force a CAPTCHA when a comment looks like spam”.
  • WordPress Multi-site compatible (not tested with WPMU)
  • As always, actively developed :D
  • And more…

The initial version is 1.0.0 and you can find detailed information as well as download links on this page: wordpress-plugins/bwp-recaptcha/

Please report any bugs by posting a comment below. Thank you!

Take Social Sharing to
the Next Level with Monarch!

Take Social Sharing to the Next Level with Monarch!
Print Article Trackback Trackback to this Article   Subscribe to Comments RSS Subscribe to Comments RSS

26 Opinions for BWP reCAPTCHA released!

  1. User's Gravatar
    bigfish April 18, 2011 at 2:16 pm – Permalink

    Good job~~
    How can I put the recaptcha into login form…

    • User's Gravatar
      OddOneOut April 18, 2011 at 3:17 pm – Permalink


      The current version of this plugin only adds recaptcha to comment form and registration form. Is your blog being spammed with brute force logins? I will make recaptcha available for login form in 1.1.0 I think.

  2. User's Gravatar
    leksa April 26, 2011 at 5:26 pm – Permalink

    Hi, nice plugin..

    I want to ask if the plugin could be work as sitewide captcha control , using multisite.
    Superadmin just need one time setting for pubkey and privatekey.

    I test it, but its not enable sitewide. It just activate for each blog (subdomain) to have admin option.

    I dont know maybe i;m wrong in setting. Maybe you can explain more in doc.

    Thanks, nice plugin by the way, easy to use.:)

    • User's Gravatar
      OddOneOut April 27, 2011 at 8:33 pm – Permalink

      Hi leksa,

      That is not currently possible, although I did think about implementing that before releasing this plugin. There should be an option in the next major version, just wait =).

  3. User's Gravatar
    Megan April 28, 2011 at 8:51 am – Permalink

    Just wish to tell those decoration suggestions are great!

  4. User's Gravatar
    IBuzzyou May 11, 2011 at 7:24 am – Permalink

    I will try this plugin but when will you add buddypress compatibility into ?

    • User's Gravatar
      OddOneOut May 12, 2011 at 1:56 pm – Permalink

      I have no plan yet, but compatibility will be added, sooner or later.

  5. User's Gravatar
    IBuzzyou May 12, 2011 at 7:14 pm – Permalink

    Thank you for your answer. One advice for your site, you have some bug in loading with sharing button up the comments.

    • User's Gravatar
      OddOneOut May 12, 2011 at 8:52 pm – Permalink

      Thanks for the head up! But which browser did you use? I can’t seem to encounter any error. How did the error look anyway?

      • User's Gravatar
        IBuzzyou May 13, 2011 at 1:17 am – Permalink

        The share button wasn’t loading you might defer there loading to prevent that 🙂

        • User's Gravatar
          OddOneOut May 14, 2011 at 3:29 pm – Permalink

          Is it not loading all the time or just occasionally? And you haven’t answered my question, which browser did you use? 🙂

          • User's Gravatar
            IBuzzyou May 15, 2011 at 12:50 am – Permalink

            Just occasionally on Chrome last version for MAC

          • User's Gravatar
            Jailene June 23, 2011 at 5:11 pm – Permalink

            Your story was ralely informative, thanks!

  6. User's Gravatar
    J Bruni June 13, 2011 at 8:30 pm – Permalink

    The “Tabindex for captcha input field” option is not working for me (fresh install of WordPress 3.1.3, default theme)

    I want the reCAPTCHA below the comment field, but it appears always at the same place. It seems the configuration value is ignored.

    Can you tell me where in the code this config value is applied? I can take a look. Just point me the file / location, it will save me the time for searching…


    • User's Gravatar
      OddOneOut June 13, 2011 at 9:17 pm – Permalink

      The tabindex option does not have any effect on the position of the Captcha (it is rather affected by your Captcha’s position).

      Are you using the comment_form function to populate the form in your theme? If so, you can not have the Captcha below your comment field (please have a look here if you would like to know why.)

      Nevertheless, just browse to includes/class-bwp-recaptcha.php, line 182, 183, and remove the filter you don’t want (use remove_filter in your theme), or you can just use the bwp_recaptcha_add_markups filter to add the Captcha.

      • User's Gravatar
        J Bruni June 14, 2011 at 6:32 am – Permalink

        Thanks a lot! With your hints, I was able to put the Captcha below the comment field. To accomplish it, I did two small changes.

        1) At comment_form function (wp-includes/comment-template.php, line 1575), I added:

        <?php do_action( 'comment_form_recaptcha' ); ?>

        2) At BWP_RECAPTCHA::add_hooks method (wp-content/plugins/bwp-recaptch/includes, line 181) we have a comment saying:

        // action for themes using the comment_form() functions added in WordPress 3.0

        Below this line, I have commented the two “add_action” lines, and added the following line below them:

        add_action('comment_form_recaptcha', array($this, 'add_recaptcha'));

        I understand this is not a solution, because of the need to change WordPress code. But, as a quick-and-dirty workaround, it works just as I needed to.

        Without your advice, I would not have done anything, and the captcha would remain before the comment field. You gave the most important information for me: where this stuff was handled. With it, I was able to perform the necessary tweak.

        It seemed to me that a solution which do not require changes in WP code involves passing a “comment_notes_after” argument to comment_form, like this:

        <?php comment_form( array( 'comment_form' => $recaptcha_html ) ); ?>

        Before it, we must store the HTML results from do_action( ‘bwp_recaptcha_add_markups’ ) in the $recapctha_html variable. I am not sure of how to accomplish this, as I am a WordPress newbie. I don’t know if apply_filters would do it, or some output buffering…

        I am happy. Thank you.

        • User's Gravatar
          J Bruni June 14, 2011 at 6:36 am – Permalink

          Oops. Where I wrote:

          <?php comment_form( array( ‘comment_form’ => $recaptcha_html ) ); ?>

          I meant:

          <?php comment_form( array( ‘comment_notes_after’ => $recaptcha_html ) ); ?>

          • User's Gravatar
            OddOneOut June 14, 2011 at 10:00 am – Permalink

            You’re welcome!

            Why didn’t you just use the bwp_recaptcha_add_markups action hook and use remove_action instead? It will save you from editing my plugin’s core file.

            You can of course use the “comment_notes_after” argument to position your Captcha, but that will involve some stupid PHP string escaping, which is not my personal favourite thing.

            Do you use custom theme or a built-in one? We may have a less hackish solution if you use a built-in theme.

  7. User's Gravatar
    J Bruni June 14, 2011 at 5:09 pm – Permalink

    Being the first time I play with WordPress, it is all new to me. I have no knowledge about the whole thing. On the other hand, I have a few years of experience with PHP, so I may learn fast.

    As I said in my first post, I am using a “fresh install of WordPress 3.1.3, default theme” – it means the “Twenty Ten” built-in theme.

    A less hackish solution is better. Maybe something like the following in the theme?

    remove_action('comment_form_after_fields', array('BWP_RECAPTCHA', 'add_recaptcha'));
    remove_action('comment_form_logged_in_after', array('BWP_RECAPTCHA', 'add_recaptcha'));
    do_action( 'bwp_recaptcha_add_markups' );
    $recaptcha_html = ob_get_contents();
    comment_form( array( 'comment_notes_after' => $recaptcha_html ) );
    • User's Gravatar
      OddOneOut June 14, 2011 at 8:33 pm – Permalink

      I meant the Captcha theme (i.e. White, Clean, etc.), not your WordPress theme. Nevertheless, your workaround looks fine to me, have you tested it? The reCaptcha class is not a singleton so you might want to use the instance $bwp_capt instead of the class name.

      It’s great to see an experienced PHP developer around here, hope that you study WordPress fast and consider contributing things back to these kinds of plugins, especially mine ;).

  8. User's Gravatar
    J Bruni June 14, 2011 at 9:37 pm – Permalink

    Ah, sorry. I am using the “White” reCaptcha built-in theme.

    I have not tested the workaround before, but now I have just reverted both WP and BWP codes back to their original state, and replaced comment_form() by the code snippet from my comment above. And it worked!

    Next, I changed the class name to $bwp_capt, and it also worked.

    So, who wishes to put the Captcha BELOW the comment field in a theme using comment_form(), can do it by replacing the comment_form() call with this code:

    remove_action('comment_form_after_fields', array($bwp_capt, 'add_recaptcha'));
    remove_action('comment_form_logged_in_after', array($bwp_capt, 'add_recaptcha'));
    $recaptcha_html = ob_get_contents();
    comment_form(array('comment_notes_after' => $recaptcha_html));

    If not a contribution to the plugin, at least a contribution to its documentation! 🙂

    • User's Gravatar
      J Bruni June 14, 2011 at 9:38 pm – Permalink

      Can you correct “at lease” to “at least” in my latest comment? Thanks.

      • User's Gravatar
        OddOneOut June 14, 2011 at 10:57 pm – Permalink

        As you wish :).

        Btw, I’m not sure if using output buffering in the middle of your contents like that is a good idea. In my opinion, line 1 to 6 should be put inside your theme’s functions.php, and then put line 7 where you want to show the comment form, how about that?

        • User's Gravatar
          J Bruni June 15, 2011 at 7:07 pm – Permalink

          I just offered another idea as a Pull Request at GitHub… feel free to accept, deny, modify, tweak, adapt… anything you want, or don’t want. 🙂

          • User's Gravatar
            OddOneOut June 17, 2011 at 2:46 pm – Permalink

            Hey I’ve commented on your commit, have you checked that out? Thanks!

  9. User's Gravatar
    carebmaid2 August 23, 2011 at 7:53 pm – Permalink

    It’s great to see an experienced PHP developer around here i love wordpress

— Comments are closed.

Next Post: