Skip to content
GPLWP Guides

How to add CAPTCHA to WordPress registration forms

Security Time About 20 minutes 6 steps Updated 23 Sep 2026

SECURITY
The short answer

WordPress does not include CAPTCHA for registration by default. You can add one manually with the registration form and validation hooks, but a plugin is faster and safer for most sites, especially when your form comes from UsersWP, WooCommerce, or another membership plugin.

The route
  1. 01Confirm which form needs protection
  2. 02Create your CAPTCHA keys
  3. 03Add it manually if you write code
  4. 04Install a CAPTCHA plugin
  5. 05Test the complete sign-up flow
  6. 06Use the fast route for UsersWP

What you need

  • Administrator access to WordPress
  • A registration form that visitors can reach
  • A reCAPTCHA or Cloudflare Turnstile account
  • The site key and secret key for your domain

Confirm which form needs protection

First identify the registration form that creates the accounts. WordPress's built-in form is normally available at /wp-login.php?action=register, but a membership plugin, WooCommerce, or a page builder may use a different form and submission process. A CAPTCHA added to the core WordPress form will not automatically protect every other registration form.

If registration is disabled, go to Settings and then General, enable user registration, and save the change. Check the form while logged out so you see the same flow as a new visitor.

Create your CAPTCHA keys

Choose a provider and create a site key and secret key for the exact domain where registration runs. The site key is used in the page integration; the secret key must stay on the server and is used to validate the visitor's response. Google reCAPTCHA supports v2 and v3, while Cloudflare Turnstile uses a sitekey and secret key pair.

Use the provider's test or staging domain separately if you have one. Do not paste the secret key into a public code snippet or expose it in browser JavaScript.

Add it manually if you write code

The manual route is possible, but it is a small integration rather than a setting. Use WordPress's register_form action to output the CAPTCHA field or widget, then use the registration_errors filter to read the submitted token and reject the registration when server-side verification fails. WordPress documents these hooks for extending and validating the built-in registration form.

Your code must send the token and secret key to the provider's verification endpoint before allowing the account to be created. For reCAPTCHA, tokens are single-use and expire after two minutes, so verify them during the registration request rather than storing them for later. This route is fine when you maintain a custom plugin, but it can break when the form is supplied by another plugin, the provider script is blocked, or caching and JavaScript optimisation alter the submission flow.

Install a CAPTCHA plugin

For most sites, install a plugin that explicitly supports the registration form you use. Activate it, enter the site key and secret key in its settings, choose the CAPTCHA version or provider, and enable protection for registration. Settings names vary, so match the option to the actual form rather than assuming that a general login setting also covers sign-up.

If the form comes from UsersWP, choose an integration that supports UsersWP registration rather than one that only targets the core WordPress form. The same rule applies to WooCommerce and membership plugins: check the integration list before relying on the CAPTCHA.

Test the complete sign-up flow

Open a private browser window, load the registration page, and submit one valid registration. Confirm that the CAPTCHA appears, the account is created, and the expected email or approval process still runs. Then submit the form without completing the CAPTCHA and confirm that registration is refused.

When the widget is missing or every submission fails, check the domain attached to the keys, the browser console, caching and script optimisation, and whether the plugin is attached to the correct registration form. Also test on a phone, because an invisible or interactive challenge can behave differently on smaller screens.

Use the fast route for UsersWP

The quickest route is to install and configure a registration CAPTCHA plugin instead of writing the integration yourself. For a site using UsersWP, UsersWP ReCaptcha is a suitable choice because it is built around UsersWP registration and login forms and supports reCAPTCHA v2 and v3.

Install it from the WordPress dashboard, activate it, enter the provider keys, enable protection for the UsersWP registration form, and test while logged out. If your site uses a different registration system, choose a plugin that names that system in its supported integrations.

The fast route

Let UsersWP ReCaptcha do it

UsersWP-focused CAPTCHA for registrations and logins, with v2/v3 support; choose it when securing a UsersWP site.

Get UsersWP ReCaptcha

Sources

  1. developer.wordpress.org /news/2024/02/how-do-log-in-and-registration-work-for-develo…
  2. developers.cloudflare.com /turnstile/get-started/?utm_source=openai
  3. developer.wordpress.org /reference/hooks/registration_errors/?utm_source=openai
  4. developers.google.com /recaptcha/docs/verify?utm_source=openai

Questions

Does WordPress include CAPTCHA for registration by default?
No, WordPress does not provide a built-in CAPTCHA setting for its registration form. You need a plugin or custom code that displays a provider's widget, collects its response token, verifies that token on the server, and adds a registration error when verification fails. A plugin is usually the practical choice because it also handles scripts, settings, and form-specific integrations.
Can I add CAPTCHA without a plugin?
Yes, but you need development work. Add the provider widget to the registration form with the <code>register_form</code> action, then validate its response with the <code>registration_errors</code> filter before the user is created. You must keep the secret key server-side and call the provider's verification service. This is reasonable for a maintained custom plugin, but not ideal for a quick admin-only change.
Why does CAPTCHA appear on login but not registration?
CAPTCHA is usually enabled separately for each form, and many plugins or themes use their own registration markup. A setting that protects login may not target the core registration page, UsersWP, WooCommerce, or a membership form. Confirm which component creates the account, then enable its specific integration and test the page while logged out.
What should I do if valid users cannot register after adding CAPTCHA?
Check the site and secret keys first, including the allowed domain and the selected CAPTCHA version. Then test with caching and JavaScript optimisation temporarily disabled, because delayed or altered provider scripts can prevent the token from reaching the server. Check the browser console and the plugin's error message, and make sure the CAPTCHA is attached to the form that actually processes registration.
Is reCAPTCHA v2 or v3 better for registration?
Neither is automatically better for every site. reCAPTCHA v2 gives visitors a visible checkbox or challenge, while v3 works in the background and relies on a score that your integration must interpret. Choose the version your CAPTCHA plugin and registration system support reliably. If v3 blocks genuine users, v2 is often easier to diagnose because the visitor can see the challenge result.