reCAPTCHA
ShopWired's app automatically places Google's reCAPTCHA anti-spam protection system on your website to protect your website's forms against spam attacks.
Installation of the reCAPTCHA app is easy and requires no configuration:
- Navigate to Apps
- Locate the Google reCAPTCHA app
- Select
install this app
Once you've installed the app, reCAPTCHA will automatically be added to the following forms on your website:
- The contact us form
- The customer registration form
- The trade account customer application form
- The product review form
reCAPTCHA can also be added to any custom forms created by following the instructions below.
Installing the reCAPTCHA theme code
Installing the reCAPTCHA theme code
You only need to install the code for reCAPTCHA if you are using a Version 1 or Version 2 ShopWired theme. If you're using a later theme version, you don't need to install the code (except to add reCAPTCHA to a custom form).
To install the code, navigate to Website > Themes and select Edit the code for the theme you want to install reCAPTCHA on.
Contact us form
- Locate the
contact.twig
file - Add the code shown below before the closing
</form>
tag. Ideally, this will be placed before the<button>
code:
{% if recaptcha %}
<div class="g-recaptcha"></div>
{% endif %}
Customer registration form
- Locate the
account_form.twig
file - Add the code shown below before the closing
</form>
tag. Ideally, this will be placed before the<button>
code:
{% if recaptcha %}
<div class="g-recaptcha"></div>
{% endif %}
Product review form
- Locate the
product.twig
file - Add the code shown below before the closing
</form>
tag for the product reviews form. Ideally, this will be placed before the<button>
code:
{% if review_recaptcha %}
<div class="g-recaptcha"></div>
{% endif %}
Product Q&A
If you're using the product Q&A app, you'll need to use the code shown below in order to display reCAPTCHA:
{% if question_recaptcha %}
<div class="g-recaptcha" data-sitekey="{{ question_recaptcha.key }}" data-stoken="{{ question_recaptcha.token }}"></div>
{% endif %}
Custom forms and reCAPTCHA
Custom forms and reCAPTCHA
If you've added a custom contact form, reCAPTCHA must be added to forms when the app is activated within your ShopWired account.
The {{ recaptcha }}
variable will never return true on any pages other than the product, contact form, and account pages, therefore the reCAPTCHA container should be added without the usual accompanying if statement.
<div class="g-recaptcha"></div>
Adding reCAPTCHA to other pages on your website
Adding reCAPTCHA to other pages on your website
reCAPTCHA can only protect the following forms on your website:
- Contact us form
- Custom contact forms
- Customer account registration
- Trade account application
- Product reviews
- Product questions
reCAPTCHA cannot be added to your website's customer login form, newsletter subscriber form, or other pages like your website's shopping basket.
ShopWired has in place to protect your website against malicious bot attacks, and reCAPTCHA is only used to prevent spam attacks.