CAPTCHA
A CAPTCHA asks visitors to complete a challenge that is easy for people and hard for bots, which helps keep automated spam registrations and posts off your site. XenForo supports several third-party CAPTCHA providers, as well as its own question and answer CAPTCHA.
Only guests see CAPTCHAs, apart from the cases in Where CAPTCHAs are shown.
Selecting a CAPTCHA type
In the admin control panel, go to Setup > Options > Basic options and find Enable CAPTCHA for guests. Select a provider, enter its keys if it needs them, and select Save. The same option also appears in the Spam management and User registration option groups.
Enable CAPTCHA for guests is an advanced option. If you don't see it, select Enable advanced mode. at the bottom of the options page.
| Provider | Configuration |
|---|---|
| None | Turns CAPTCHAs off. |
| Use hCaptcha | The default. Works without keys, using keys shared by all XenForo sites. To get difficulty settings and analytics, enter your own Site key and Secret key from hCaptcha. Select Use invisible hCaptcha to hide the widget, so the check runs when the visitor submits the form. |
| Use Cloudflare Turnstile | Requires a Site key and Secret key from Cloudflare Turnstile. |
| Use reCAPTCHA v2 | Requires a Site key and Secret key from Google reCAPTCHA. Choose reCAPTCHA v2 as the type when you create the keys. If you want Use invisible reCAPTCHA, also select Invisible reCAPTCHA badge when you create them. |
| Use question & answer CAPTCHA | Uses questions you write yourself. See Question and answer CAPTCHA. |
| Use textCAPTCHA | Requires an API key from textCAPTCHA. |
| Use KeyCAPTCHA | Requires a User ID and Private key from KeyCAPTCHA. |
If you select Cloudflare Turnstile, reCAPTCHA, or KeyCAPTCHA without entering its keys, XenForo shows no CAPTCHA and accepts every submission. XenForo also lets visitors through when it can't reach the provider, and records the failure in the server error log at Logs > Errors > Server error log. Check there if spam starts getting through.
If you use hCaptcha or reCAPTCHA, XenForo adds the provider's privacy policy to your site's built-in privacy policy page. If your policy already covers CAPTCHA use, clear Include CAPTCHA privacy policy at Setup > Options > Spam management.
Question and answer CAPTCHA
The question and answer CAPTCHA asks visitors a question that you write, such as one about your site's topic that a bot is unlikely to answer. Each time a CAPTCHA is shown, XenForo picks one of your active questions at random.
If you select Use question & answer CAPTCHA without any active questions, nobody can pass the CAPTCHA. Guests can't register, post, or use the contact or lost password forms. If Login limit method is set to CAPTCHA, members who reach the login limit can't log in either. Create at least one question first.
Creating custom questions and answers
Go to Setup > Q&A CAPTCHA and select Add question. Enter the Question, then enter each accepted answer under Correct answer(s). A new answer field appears each time you fill one in. Select Save.
A visitor's answer must match one of your answers, ignoring case for the letters A to Z only: blue matches Blue, but é doesn't match É. Add each capitalization of answers with accented or non-Latin letters, and every other reasonable variation, as separate answers.
XenForo shows the question as HTML. You can format it with tags, and you must write < for a literal <.
To stop using a question without deleting it, turn it off with the toggle in the question list, or clear Question is active when you edit it. Inactive questions are never shown.
Don't publish the answers anywhere. If spammers learn a question, they can program bots to answer it, so replace your questions from time to time.
Where CAPTCHAs are shown
When a CAPTCHA is enabled, guests must complete it to:
- Register an account.
- Post a thread or reply, if guests have permission to post.
- Send a message through the contact form.
XenForo also shows it in these cases:
- Contact form: to logged-in members whose account isn't in a valid state, such as one awaiting email confirmation.
- Resending a confirmation email: to members who ask to resend their account confirmation email within an hour of the previous request.
- Lost password form: when Use CAPTCHA for lost password form is selected at Setup > Options > User options. It's on by default.
- Login: after too many failed login attempts, when Login limit method at Setup > Options > User options is set to CAPTCHA. The default is Lock out. See User security.
Use CAPTCHA for lost password form and Login limit method are advanced options. If you set Login limit method to CAPTCHA, make sure a working provider is enabled, because without one failed logins aren't limited at all.