Setup & site building · Guide
How to Add Captcha to WordPress (Step by Step)

Short answer
Choose a CAPTCHA service such as Cloudflare Turnstile, Google reCAPTCHA or hCaptcha and register your domain to get a site key and secret key. Paste the keys into your form plugin's CAPTCHA settings or a CAPTCHA plugin, enable it on each form, then test while logged out.
Key takeaways
- WordPress has no built-in CAPTCHA, so you add one with a plugin.
- Every service gives a public site key and a private secret key.
- Turnstile and reCAPTCHA v3 are invisible to most visitors.
- Form plugins like Contact Form 7 and WPForms have CAPTCHA settings.
- Protect login, registration, comments and checkout too.
- Mention CAPTCHA services in your privacy policy.
How do you add a CAPTCHA to WordPress?
Pick a CAPTCHA service such as Cloudflare Turnstile, Google reCAPTCHA or hCaptcha, create site and secret keys, then paste them into your form plugin or a CAPTCHA plugin.
A CAPTCHA is a small test that tells people and bots apart. On WordPress, it protects contact forms, login pages, registration forms, comments and checkout pages from spam and automated attacks.
WordPress does not include a CAPTCHA on its own. You add one through your form plugin's settings or a dedicated CAPTCHA plugin.
The process is the same for every service. You register your domain with the provider, get two keys, and enter them in WordPress.
This guide walks through choosing a service, getting keys and adding the CAPTCHA to the places that need it.
Which CAPTCHA service should you use?
Cloudflare Turnstile and reCAPTCHA v3 are the least annoying for visitors, while reCAPTCHA v2 and hCaptcha show a checkbox or puzzle that blocks more bots but adds friction.
Here is a quick comparison of the main choices.
| Service | Visitor experience | Cost | Notes |
|---|---|---|---|
| Cloudflare Turnstile | Usually invisible or a single click | Free | No Cloudflare DNS needed |
| Google reCAPTCHA v3 | Invisible, gives a score | Free tier | Needs a score threshold |
| Google reCAPTCHA v2 | Checkbox, sometimes image puzzles | Free tier | Familiar to most users |
| hCaptcha | Checkbox or image puzzles | Free tier | Privacy-focused alternative |
| Simple math or honeypot | Question or hidden field | Free | Lighter, catches basic bots only |
For most small sites, Turnstile is a good default. It is free, light and rarely asks visitors to solve puzzles. Cloudflare's Turnstile documentation explains how it works.
If your form plugin only supports reCAPTCHA, use that instead. Google's reCAPTCHA developer guide covers v2 and v3.
How do you get CAPTCHA keys?
Sign in to the provider's dashboard, add a new site with your domain, choose the widget type, and copy the site key and secret key it gives you.
Every service gives you two keys. The site key goes in your page so the widget can load. The secret key stays on your server so WordPress can check the answer.
For Cloudflare Turnstile:
- Log in to your Cloudflare account. A free account is enough.
- Open the Turnstile section.
- Add a widget, enter your domain and choose a widget mode.
- Copy the site key and secret key.
For Google reCAPTCHA:
- Open the reCAPTCHA admin console with your Google account.
- Register a new site and choose v2 or v3.
- Add your domain, without https or www paths.
- Copy the site key and secret key.
Keys are tied to the version you choose. v2 keys do not work with v3 settings, and the reverse is also true.
How do you add a CAPTCHA to Contact Form 7?
In Contact Form 7, open Contact, then Integration, set up the reCAPTCHA or Turnstile service with your keys, and the protection applies to your forms.
Contact Form 7 has a built-in integration screen.
- Go to Contact, then Integration.
- Find the CAPTCHA service you want and click Setup Integration.
- Paste the site key and secret key.
- Save the changes.
The Contact Form 7 reCAPTCHA integration page explains how its reCAPTCHA v3 support works. With v3 there is no visible box, so the form looks the same to visitors.
Which services appear on the Integration screen depends on your Contact Form 7 version. If the one you want is missing, a separate plugin can add it.
If you are new to the plugin, see our guide on how to use Contact Form 7.
How do you add a CAPTCHA to WPForms or Gravity Forms?
WPForms has a CAPTCHA settings screen where you add keys once and enable the CAPTCHA per form, and Gravity Forms uses a reCAPTCHA field you add to each form.
WPForms:
- Go to WPForms, then Settings, then CAPTCHA.
- Choose the service, such as reCAPTCHA, hCaptcha or Turnstile.
- Paste your keys and save.
- Edit each form, open its spam protection settings and turn the CAPTCHA on.
Our guide to WPForms spam protection settings explains the other anti-spam options on that screen.
Gravity Forms:
- Go to Forms, then Settings, then reCAPTCHA, and add your keys.
- Edit a form and add the CAPTCHA field from the advanced fields.
- Save the form.
If the field shows an error after setup, our article on Gravity Forms reCAPTCHA not working covers key and domain mistakes.
How do you add a CAPTCHA to the login and registration pages?
Use a CAPTCHA or security plugin that hooks into wp-login.php, add your keys, and tick the login, registration and lost password forms you want to protect.
Bots attack login pages constantly. A CAPTCHA there blocks many automated attempts before they reach the password check.
A popular free option is Simple CAPTCHA Alternative with Cloudflare Turnstile. After you add your keys, it lets you choose which forms to protect.
Typical steps with any such plugin:
- Install and activate the plugin.
- Open its settings and paste your site and secret keys.
- Tick Login, Registration and Lost password.
- Save, then test the login page in a private window.
Some security plugins also include a login CAPTCHA. If you already use one, check its settings before adding another plugin.
Keep a second browser logged in while you test. If the CAPTCHA breaks, you can still reach the dashboard to switch it off.
How do you add a CAPTCHA to comments and WooCommerce?
Most CAPTCHA plugins also offer checkboxes for the comment form and WooCommerce login, registration and checkout, so enable the ones your site uses.
Comment spam is one of the oldest WordPress problems. A CAPTCHA on the comment form stops most automated submissions.
For stores, protect the WooCommerce account login, registration and checkout forms. Card testing bots often target checkout pages.
Test checkout carefully after adding a CAPTCHA. Some payment gateways and one-click checkout buttons do not show the widget, so run a real test order.
For other comment defences, see our guide on stopping comment spam in WordPress.
How do you test that the CAPTCHA works?
Log out, open each protected form in a private window, check that the widget loads, and send a real submission to confirm it goes through.
Run through this checklist:
- The widget appears, or for invisible types, the form submits normally.
- A test submission arrives in your inbox or entries list.
- The login page still lets you log in.
- No errors appear in the browser console.
- Mobile visitors can complete the form.
If the widget does not load, the usual causes are wrong keys, the wrong domain in the provider dashboard, or a caching or script optimisation plugin delaying the CAPTCHA script.
Exclude the CAPTCHA script from delay and combine features, then clear caches and test again.
What about privacy and accessibility?
CAPTCHA services process visitor data, so mention them in your privacy policy, and pick options that work with keyboards and screen readers. This is general information, not legal advice.
Google reCAPTCHA sends visitor data to Google. Depending on where you and your visitors are, privacy laws such as the GDPR may require you to disclose it or ask for consent. Check with a qualified adviser if you are unsure.
Image puzzles can be hard for people with visual or motor impairments. Invisible options such as Turnstile and reCAPTCHA v3 avoid most of that friction.
The W3C note on CAPTCHA accessibility explains the problems puzzle-based tests create.
Is a CAPTCHA enough to stop spam?
A CAPTCHA blocks most bots but not all spam, so combine it with a honeypot, an anti-spam filter and sensible form settings.
Human spammers and smarter bots can still get through. Layered protection works better than any single tool.
Good companions include honeypot fields, which many form plugins add automatically, spam filters such as Akismet, and email confirmation for new registrations.
For a full plan, read our guide on stopping contact form spam in WordPress. It covers CAPTCHA alongside the other defences.
Frequently asked questions
Is there a free CAPTCHA for WordPress?
Yes. Cloudflare Turnstile is free, and Google reCAPTCHA and hCaptcha both have free tiers that cover most small and medium sites. Free plugins connect these services to WordPress forms, login pages and comments.
Should I use reCAPTCHA v2 or v3?
Version 3 is invisible and scores each visitor, so it adds no friction but needs a sensible score threshold. Version 2 shows a checkbox and sometimes image puzzles, which blocks more bots but annoys some users. Use whichever your form plugin supports well.
Why is my CAPTCHA not showing on the form?
The usual causes are wrong keys, a domain that does not match the one registered with the provider, or a caching or optimisation plugin delaying the CAPTCHA script. Check the keys, exclude the script from delay features and clear caches.
Does a CAPTCHA slow down WordPress?
It adds a small script to pages with protected forms. Turnstile and reCAPTCHA v3 are light, and many plugins load the script only on pages that contain a form. The impact on page speed is usually minor.
Can I add a CAPTCHA to the WordPress login page?
Yes. Use a CAPTCHA plugin or a security plugin that protects wp-login.php, add your keys and enable it for login, registration and lost password forms. Keep another session logged in while testing so you are not locked out.
Sources
- Cloudflare Turnstile Cloudflare Docs
- reCAPTCHA Google for Developers
- reCAPTCHA (v3) Contact Form 7
- Simple CAPTCHA Alternative with Cloudflare Turnstile WordPress.org
- Inaccessibility of CAPTCHA W3C
Is your product missing, or something out of date?
Tell us what to add or correct. We read every note and reply when we need a source. A message does not buy a ranking.
Thanks — we review requests within 3 business days.
Related guides
About the editors
Researched from the primary sources listed above and checked against our editorial rules before publishing.


