Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Email validation rejecting valid addresses: how to fix it

PRF-213Medium impactPartlyBy FunnelGuardPublished Updated
On this page

What this issue is

Email validation is the check a form runs on the address field before it lets someone submit. Many forms use an old pattern (a regular expression, or regex) written years ago. It assumes every address looks like name@site.com, with letters and numbers only and a domain ending of two or three letters.

Real addresses break those assumptions. Plus addressing (anna+shop@gmail.com) is a feature of Gmail and many other providers that lets people add a tag after a plus sign. Newer domain endings (TLDs) such as .photography, .agency or .museum are longer than four characters. Others have subdomains (sam@mail.company.co.uk), dots, hyphens, apostrophes or underscores in the name part.

Addresses that are valid but often rejected
AddressWhy it is validTypical faulty rule that blocks it
anna+shop@gmail.comPlus addressingName part allows only letters, digits, dot, dash
sam@brand.agencyLong new TLDTLD limited to 2-4 letters
j.o'neil@company.ieApostrophe is allowed in the name partApostrophe not in the allowed list
lee@mail.company.co.ukSubdomains and multi-part endingsOnly one dot allowed after @
first_last@my-company.ioUnderscore and hyphenUnderscore or hyphen not allowed

Why it costs you leads or sales

The person who hits this error has already decided to contact you or buy. When the form insists a correct address is wrong, most will not guess what is wrong. They retype the same address, then leave. You never see these attempts as leads, because the form never submits.

The people most affected are often your more tech-aware customers: those who use plus tags to track who sells their data, and business users on newer domains. Checkout forms are hit too, so you can lose a paid order at the last step.

Where a valid email gets stopped
  1. Ad or search clickVisitor lands on the page
  2. Fills the formTypes anna+shop@gmail.com
  3. Email checkRule says 'invalid email'
  4. Lead savedNever happens
  5. Conversion trackedNo event sent

The visitor does everything right, but the email rule blocks the submit.

Submissions lost to a strict email ruleExample numbers
Submissions lost to a strict email rule (example)Loose email check: 0 leads per 1,000 attempts; Strict old pattern: 20 leads per 1,000 attempts; Very strict pattern: 45 leads per 1,000 attempts0173402045Loose email checkStrict old patternVery strict patternleads per 1,000 attempts

Example: illustrative numbers only. Your loss depends on how many of your visitors use plus tags or newer domains.

How to check if your site has it

Test every form that collects an email: contact, quote, newsletter, booking, account sign-up and checkout. Use the real form on the live site, not a preview. Try each address below and note which ones show an error.

Test addresses (all are valid)
  • yourname+test@gmail.com (plus addressing)
  • yourname@company.agency (long new TLD)
  • yourname@mail.company.co.uk (subdomain and multi-part ending)
  • first.last@company.com (dot in the name)
  • first_last@my-company.io (underscore and hyphen)
  • o'neil@company.ie (apostrophe)
  • Also try the same address with capital letters, and with a trailing space, which should be trimmed, not rejected

Then look at the page source or the form plugin settings for a custom pattern. Search for pattern=, type="text" on the email field, or a regex in the page's JavaScript.

Typical faulty rule (do not use)javascript
// Rejects + and any TLD longer than 4 letters
const bad = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9-]+\.[a-zA-Z]{2,4}$/;

How to fix it

The safest rule is a loose one. Only check what you can be sure of: there is text, one @, and a dot in the domain. The real proof an address works is sending a message to it, for example a confirmation email.

Replace the strict rule
  1. Find where the rule lives

    It may be in the form builder's field settings, a plugin, your theme's JavaScript, a custom pattern attribute or your server code.

  2. Remove the custom pattern

    Delete the regex or pattern attribute, or switch the field to the standard email type.

  3. Use a loose check

    Allow any characters before the @, one @, and a domain with at least one dot. Do not limit TLD length or block the + character.

  4. Trim and lower-case on the server

    Strip spaces around the address before saving. Check it again on the server, because browser checks can be skipped.

  5. Verify by sending

    If you need a confirmed address, send a confirmation email rather than trying to prove validity with a pattern.

Simple, safe email fieldhtml
<input type="email" name="email" id="email" autocomplete="email" required>
Loose custom check, if you must have onejavascript
function looksLikeEmail(value) {
  const v = value.trim();
  return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(v);
}
Where to change it on common platforms
  1. Check your form plugin

    In Contact Form 7, make sure the field uses [email* your-email] and not a [text] tag with a custom pattern. In other form plugins, open the field settings and set the type to Email, removing any custom validation or regex.

  2. Check theme and plugin scripts

    If the error still shows, search your theme and optimisation or validation plugins for a custom email regex. Disable the plugin briefly on a staging copy to confirm.

How to confirm it's fixed

Confirm the fix
  1. Repeat the address tests

    Submit the form with each test address from the check list. None should show an email error.

  2. Check the lead arrives

    Confirm the submission reaches your inbox and CRM, and that the plus address is stored exactly as typed.

  3. Check a bad address still fails

    Try 'anna@', 'anna gmail.com' and an empty field. They should be rejected with a clear message.

  4. Check the conversion event

    Make sure your ad and analytics tags still fire after a successful submit.

Strict rule vs loose rule

Before

  • anna+shop@gmail.com shows 'invalid email'
  • sam@brand.agency is blocked
  • Visitors retry once, then leave
  • No lead, no conversion event

After

  • All valid addresses go through
  • Only clearly broken input is rejected, with a clear message
  • Confirmation email proves the address works
  • Lead and conversion event are recorded

How to prevent it happening again

Prevention habits
  • Never copy an email regex from an old blog post or snippet site
  • Use the standard email field type in every form tool
  • Add the plus-address and long-TLD tests to your form QA list
  • Retest after theme, plugin or form builder updates
  • Review any validation scripts added through tag managers or code injection
  • Use a confirmation email, not a pattern, to prove an address is real

How FunnelGuard handles this

FunnelGuard detects this issue only partly. It runs your lead form on a schedule with negative and positive journeys: a positive journey submits a valid test address and checks that the form accepts it and the test lead arrives, and a negative journey checks that clearly bad input is rejected. If your form starts refusing the address FunnelGuard uses, you get an alert with a screenshot and a likely cause.

What it does not do is try every kind of valid address. It will not tell you that plus addresses, long new TLDs, apostrophes or subdomain addresses are rejected unless the test journey uses one of those. To cover the rest, run the address list above by hand on each form after any change, and re-run it when you update plugins or themes.

The Free plan gives you 1 site and 2 journeys with daily checks and no card. Paid plans start at $39/month with a 3-day free trial.

Questions people ask

Why does my form say invalid email for a valid address?

The form is probably using a strict pattern that does not allow some valid characters or domain endings. Common culprits are the plus sign, apostrophes, underscores, subdomains and TLDs longer than four letters. Switch to type="email" or a loose check.

Is a plus sign allowed in an email address?

Yes. Plus addressing, such as name+tag@gmail.com, is valid and works with Gmail and many other providers. Messages go to the base inbox, and people use tags to filter mail or spot who shared their address. Your form should accept it.

Why are .agency, .io or other new domain endings rejected?

Older patterns often limit the ending after the last dot to two to four letters. Many newer TLDs are longer, such as .photography or .agency. Remove the length limit from your validation rule.

What is the best regex to validate an email address?

A short one: no spaces, one @, and a dot in the domain, for example /^[^\s@]+@[^\s@]+\.[^\s@]+$/. Perfect validation by pattern is not practical. Confirm real addresses by sending a message.

Should I validate email addresses on the server too?

Yes. Browser checks can be skipped or fail in some tools. Trim spaces and run the same loose check on the server before saving, and escape the value when you store or display it.

How do I test whether my form rejects valid emails?

Submit the live form with a plus address, a long-TLD address, a subdomain address and one with an apostrophe or underscore. Note any that show an error, then find and loosen the rule behind it.

Can FunnelGuard detect rejected valid emails?

Only partly. It checks that your form accepts its own valid test address and rejects bad input, and alerts you if that breaks. It does not try every address format, so test plus addresses and new TLDs by hand.

Does FunnelGuard catch this?

Partly

FunnelGuard checks part of this.

How: via negative/positive journeys.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.