Captcha on the Lost Password Form
Learn how to add CAPTCHA protection to WordPress lost password forms using User Registration plugin's code filter to prevent spam and automated bot attacks.
Last updated on Jul 14, 2026
Would you like to add CAPTCHA protection to your lost password form to prevent spam and bot attacks? User Registration & Membership allows you to enable CAPTCHA on the lost password form using a simple code filter. This tutorial will show you how to add CAPTCHA protection to your password reset page.
Before getting started, make sure you've installed and activated the User Registration plugin and have already configured CAPTCHA (Google reCaptcha or hCaptcha) in your User Registration forms.
Adding the CAPTCHA Filter Code
To enable CAPTCHA on the lost password form, you'll need to add a code snippet to your theme's functions.php file or use a code snippets plugin.
Navigate to Appearance > Theme File Editor in your WordPress dashboard. Locate and open your theme's functions.php file. Add the following code snippet at the end of the file:
add_filter("user_registration_lost_password_options_enable_recaptcha", function(){
return 'yes';
});Click Update File to save your changes.
How It Works
Once you've added the code snippet, CAPTCHA will automatically appear on your lost password form. The CAPTCHA uses the same configuration you've already set up for your User Registration forms—whether that's Google reCaptcha or hCaptcha.
When users visit your lost password page and attempt to reset their password, they'll need to complete the CAPTCHA verification before the password reset email is sent. This blocks automated bots from submitting the form and helps prevent spam attacks on your password reset functionality.
That's it! Now you know how to add CAPTCHA protection to your lost password form. Next, want to learn more about securing your registration forms? Be sure to check out our guide on configuring CAPTCHA settings for all your User Registration forms.