1. Home
  2. Integrations
  3. Sign-up form widget
  4. Shopify

Add email validation to Shopify forms

In Shopify, paste the widget into theme.liquid just before the closing body tag. It then checks every email field on your theme pages, such as the footer newsletter and the account sign-up form. It cannot run on Shopify's checkout.

Before you start

You need access to edit your theme's code. No special plan is needed for theme pages.

Setup

  1. In Shopify admin open Online Store, then Themes. On your live theme choose the three dots, then Edit code.
  2. Open layout, then theme.liquid.
  3. Paste the snippet below just above the closing body tag and save.
  4. Visit your storefront and reload.
  5. Open the published page (not the editor preview) and type jane@gmial.com into the field. You should see a suggestion to use gmail.com under it. Try x@mailinator.com to see the disposable-address error.
footer code
<script src="https://simpleverifier.com/widget.js" defer></script>
<script>
  // Turns the widget on for every email field on the page, including fields the builder adds later.
  function svAttachAll() {
    if (!window.SimpleVerifier) return;
    document.querySelectorAll('input[type="email"]').forEach(function (input) {
      SimpleVerifier.attach(input);
    });
  }
  document.addEventListener("DOMContentLoaded", function () {
    svAttachAll();
    new MutationObserver(svAttachAll).observe(document.body, { childList: true, subtree: true });
  });
</script>

Limits on Shopify

  • Shopify's checkout pages do not load scripts from your theme (Shopify controls that page), so the widget cannot check the email at checkout.
  • Duplicate your theme before editing, and re-add the snippet if you switch to a new theme.
  • Some themes build the newsletter form with JavaScript after the page loads. The snippet watches for added fields, so it still picks them up.
  • Blocking a submit relies on the browser's own form validation. If a builder sends the form with its own script instead, the hint under the field still appears but the form may go through, so test on the published page.

Check that the mailbox exists

The widget checks format, typos, throwaway domains and role addresses in the browser. It cannot tell whether a mailbox exists, because that needs an API key and anything in a web page can be read by visitors. For that, call the API from the server that receives the form. See the API docs, the full form widget page with Node, PHP and Python examples, and pricing.

Related: Shopify customers to email list, Shopify email list checker.

Common questions

Does it check the email at Shopify checkout?
No. Theme code does not run on the checkout, so only forms on your theme pages are covered.
I want to clean the customers I already have.
Export your customers from Shopify and use the Shopify customers to email list tool, then verify the file.
Is it a Shopify app?
No. It is a script you paste into your theme. There is no listing in the Shopify App Store.
Is the form widget free?
Yes. The widget runs in the visitor's browser, needs no account or API key and has no usage limit. Checks that confirm the mailbox exists use the SimpleVerifier API from a server, which comes with Pro, Business and Agency, from $39/month.

All form platforms · All integrations

Clean your next list before it bounces

100 free email checks when you sign in with Google, no card. Then monthly plans from $9, or one flat price with fair use, never cut off.

100 free checks, no card Cancel anytime Secure payment by Stripe