Add email validation to Wix forms
In Wix, add the widget in Settings, Custom Code, set to load in the body end on all pages. Wix form fields have no custom attribute, so the snippet turns the widget on for each email field it finds.
Before you start
Custom Code in Wix needs a Premium plan and a connected domain.
Setup
- In your Wix dashboard open Settings, then Custom Code (under Advanced).
- Choose Add Custom Code, paste the snippet below, and name it SimpleVerifier.
- Set Add Code to Pages to All pages and Place Code in to Body - end, then apply.
- Publish the site.
- 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.
<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 Wix
- Custom Code is not available on the free Wix plan or without a connected domain.
- It does not run in the editor, only on the published site.
- If a Wix form does not show the hint, the field may be rendered in a way the snippet cannot reach. The check through the API from your backend, Zapier or Make does not depend on this and still works.
- 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: Wix contacts to email list, Zapier.
Common questions
- Do I need Velo or code to use it?
- No. Settings, Custom Code accepts a script tag and a short script without turning on Velo.
- Is there a Wix app?
- No. SimpleVerifier does not have a Wix app. The widget is a script you paste into Custom Code.
- I only need to clean contacts I already have. Is there something for that?
- Yes. Export contacts from Wix and use the Wix contacts to email list tool, then verify the file.
- 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.