CMS Platforms

Shopify Installation

Protect your Shopify contact and newsletter forms by adding the UCAPTCHA script to your theme.

Step 1 — Get your site key

Log in to your UCAPTCHA dashboard, go to My Sites, and copy the site key for your site.

Step 2 — Open the Theme Code Editor

  1. In your Shopify Admin, go to Online Store → Themes
  2. Next to your active theme, click ⋯ → Edit code

Step 3 — Add the script to theme.liquid

  1. In the file tree on the left, find and open Layout → theme.liquid
  2. Find the closing </head> tag (use Ctrl+F / Cmd+F to search)
  3. Paste the following snippet just before the </head> tag. Replace YOUR_SITE_KEY with your actual key.
<script
  src="https://www.ucaptcha.site/captcha-widget.js"
  data-site-key="YOUR_SITE_KEY"
  defer>
</script>
  1. Click Save

Step 4 — Verify it's working

Visit your Shopify store's Contact page (usually at yourstore.com/pages/contact). The UCAPTCHA checkbox should appear inside the contact form automatically.

💡 Shopify's built-in contact form and newsletter signup form are both supported. If you're using a third-party form app, check the app's documentation for how to add custom scripts to its form output.

Targeting specific pages only (optional)

If you only want UCAPTCHA on your contact page and not site-wide, you can use Liquid's template conditionals in theme.liquid:

{% if template == 'page.contact' %}
<script
  src="https://www.ucaptcha.site/captcha-widget.js"
  data-site-key="YOUR_SITE_KEY"
  defer>
</script>
{% endif %}

Replace page.contact with the template name of the page you want to protect. You can find the template name by looking at the page in the theme editor.

â„šī¸ Common Shopify template names: page.contact for the contact page, index for the home page, collection for collection pages.