AIOS And WooCommerce Captcha Settings shows you how to set up AIOS captcha with WooCommerce plugin and more.
Last Updated: September 27, 2024
Latest News: Updated the document.
It is important to add good security to your WooCommerce online store. Adding captcha to the login, registration and password reset forms will increase your security and prevent fake logins from hackers.
The following documentation shows you how to enable captcha security for WooCommerce login, registration and password reset forms. There is also an option in AIOS that allows you enable captcha for comments in your site. This is another effective way to add “Brute Force” prevention techniques to your site.
When you enable Cloudflare Turnstile, Google reCAPTCHA V2 or Simple math CAPTCHA a widget will be displayed for you to enable the different captcha settings for WooCommerce plugin as illustrated in the instructions below.
Note: Currently you have the option of using Cloudflare Turnstile, Google reCAPTCHA V2 or plain maths captcha.
What you need:
AIOWPS And WooCommerce Captcha Settings
Step 1 ) Go to WP Security -> Brute Force admin sidebar as illustrated in the image below.
===============================
Step 2 ) Go to WP Security -> Brute Force -> CAPTCHA Settings tab to set up the login captcha as illustrated in the following image.
CAPTCHA Settings Options
- No CAPTCHA
- Cloudflare Turnstile
- Google reCAPTCHA V2
- Simple math CAPTCHA
===============================
Cloudflare Tunstile Settings
Step 3 ) The following image shows you the settings that apply to Cloudflare Turnstile.
Cloudflare Turnstile Settings
- Select Cloudflare Turnstile or Google reCAPTCHA V2 as default:
- Site Key:
- Secret Key:
- Theme:
- Auto
- Light
- Dark
Google reCAPTCHA V2 Settings
Step 3-a ) The following image shows you the settings that apply to Google reCAPTCHA V2.
Google reCAPTCHA V2 Settings
- Site key:
- Secret key:
Simple math CAPTCHA
Step 3-b ) Simple math CAPTCHA has no settings to setup. Only the options below.
===============================
WooCommerce Forms Captcha Settings
Step 4 ) The following image shows you the WooCommerce settings that apply to Cloudflare Turnstile, Google reCAPTCHA V2 and Simple math CAPTCHA. When any of these features are enabled and you have WooCommerce plugin setup in your site, the following options will be displayed under the CAPTCHA Settings tab.
This will add another 40 points score towards your security meter if the four options are enabled. (Basic Security Level)
WooCommerce CAPTCHA Options
- Enable CAPTCHA on WooCommerce login form: = Note: Check Step 5 ) below.
- Enable CAPTCHA on WooCommerce lost password form: = Note: Check Step 6 ) below.
- Enable CAPTCHA on WooCommerce registration form: = Note: Check Step 7 ) below.
- Enable CAPTCHA on WooCommerce the checkout page:
- Click on Save settings button once you have completed your settings.
Added CAPTCHA to the login form
The following images display the captcha math field using WooCommerce default Storefront theme. If you use a different theme, make sure you carry out some testing before enabling AIOWPS captcha above.
Step 5 ) The following image shows you the WooCommerce login form with the simple math captcha field added.
Added CAPTCHA to the lost your password form
Step 6 ) The following image shows you the WooCommerce lost password reset form with the simple math captcha field added.
Added CAPTCHA to the registration form
Step 7 ) The following image shows you the WooCommerce registration form with the simple math captcha field added.
Troubleshooting Captcha
====================
Q1 How do I change captcha background and letters colours?
Solution One: The following is an example:
.aiowps-captcha-equation{
background-color:white;
color: black;
}
Insert the above code using either a custom css plugin or put it in your theme’s css file. (Change the colours to suit your needs) (Solution provided by wpsolutions.)
====================
Q2 The database is full of transient data entries when the Captcha feature is enabled in the login page. How do I clear all transient data accumulated in the database?
Solution One: AIOWPS plugin has a code which will automatically clean up the old transient entries created by captcha feature. The code is triggered once daily via a wp cron event. You can try a simple test if you wish to confirm whether cleanup code is working. The cron job name is aiowps_hourly_cron_event.
- First log into you DB via phpMyAdmin in an Apache server and observe how many transient entries you have in the wp options table with the following “aiowps_captcha” in the option name.
- Next, from your wp admin panel deactivate and reactivate the AIOWPS plugin. (this will trigger the daily cron job which will run the transient cleanup code) Note: The following plugin WP Control allows you to run and manage cron jobs in your site. This is useful if you don’t have access to your server.
- Then check your DB again to see if the old captcha transients were deleted. (If they are then you now that the cron job is working correctly in your site.)
- I recommend that you hide your login page via one of the brute force features. This should limit the amount of transient entries produced by the captcha feature.
====================
Q3 The captcha answer is always incorrect. So when you deactivate the plugin by renaming the folder and then logging into the WP admin panel, you get logged out of the WP admin panel immediately after re-activating the AIOWPS plugin again?
Solution One: PLEASE follow the instructions below carefully.
- login to your DB using PHPMyAdmin
- Go to the wp_options table
- Look for the entry which has option_name equal to “aio_wp_security_configs”
- Copy the option_value and paste it in a text document in case you need to restore this if something goes wrong.
- Then inside the option_value search for the following string: s:27:”aiowps_enable_login_captcha”;s:1:”1?
- Change the above to look like this: s:27:”aiowps_enable_login_captcha”;s:0:””, Note: s:1 was changed to s:0 and “1” was changed to “”.
- Save your table row.
The above will deactivate the login captcha. If you run into issues simply paste the string you saved before you made any changes and save the DB row and then you will at least restore the aiowps settings back to the original state
Note: If you enable the other captcha options and run into similar issues, you can use the above steps for troubleshooting.
Does your host provider do automatic page caching on the server side?
If they do, then this may be the reason why you are having captcha issues for your login forms. You will need to ask your host support guys to NOT cache the login page. (Solution provided by wpsolutions in the forum)
====================
Q4 Someone reported an issue they were having when enabling captcha in the comments form. Just remember that in most cases it will be a conflict with your theme. You should test one of WordPress default themes like Twenty Sixteen or Seventeen. This test will let you know if it is your theme causing this issue. Click on the following URL add-captcha-to-comments-form-is-not-working to read the reply by one of the developers.
===============================
That is how simple it is to set up and add captcha security to your login form, registration form, comment form in your WooCommerce store.
If you have any questions please let me know.
Enjoy.
All In One Security (AIOS) Plugin Tutorial List