How to Restrict Email Domains in WordPress Forms
Not all email addresses are equal. A submission from [email protected] is likely more valuable than one from [email protected]. Email domain restrictions let you control which email addresses your forms accept—block free providers, require business domains, or whitelist specific organizations. Better emails mean better leads and less spam.
In this guide, you’ll learn how to restrict email domains in your WordPress forms for higher quality submissions.
Why Restrict Email Domains?
Common Reasons
- B2B lead quality: Require business emails, not personal
- Reduce spam: Block disposable email domains
- Internal forms: Only accept company domain emails
- Membership verification: Verify organization affiliation
- Student/faculty forms: Only .edu domains
- Government forms: Only .gov domains
The Problem with Free Email Providers
For B2B forms, free email submissions often mean:
- Lower conversion rates
- Harder to verify identity
- Less serious inquiries
- Can’t identify the company
- More spam and fake submissions
When NOT to Restrict
- Consumer-facing forms (B2C)
- Newsletter signups
- General contact forms
- Support forms (customers use personal email)
- Event registration (personal attendees)
Types of Email Domain Restrictions
1. Whitelist (Allow Only)
Only accept emails from specific domains:
- Accept: @company.com, @subsidiary.com
- Reject: Everything else
Use for: Internal forms, partner-only access, organization-specific
2. Blacklist (Block Specific)
Block certain domains, accept everything else:
- Block: @gmail.com, @yahoo.com, @hotmail.com
- Accept: All other domains
Use for: B2B forms wanting business emails only
3. Category Restrictions
Block categories of email providers:
- Block all free email providers
- Block disposable/temporary email domains
- Allow only educational (.edu)
- Allow only government (.gov)
Setting Up Domain Restrictions
Step 1: Add Email Field
- Open your form in AFB
- Add or select the Email field
- Click to configure settings
Step 2: Find Domain Restriction Option
- Look for “Domain Restriction” or “Allowed Domains”
- Enable the restriction feature
Step 3: Configure Whitelist
Enter allowed domains (one per line or comma-separated):
company.com subsidiary.com partner.org
Step 4: Set Error Message
Customize the validation message:
- “Please use your company email address”
- “Only @company.com emails are accepted”
- “Please enter a business email address”
Step 5: Test the Restriction
- Preview your form
- Try a blocked domain (should fail)
- Try an allowed domain (should succeed)
- Verify error message displays correctly
Configuration Examples
Internal Company Form
Scenario: Employee feedback form, only staff can submit
Allowed Domains:
acmecorp.com acme.co
Error Message: “Please use your @acmecorp.com email address”
Help Text: “This form is for Acme Corp employees only”
B2B Lead Generation
Scenario: Demo request form, want business emails
Blocked Domains (Blacklist approach):
gmail.com yahoo.com hotmail.com outlook.com aol.com icloud.com mail.com protonmail.com
Error Message: “Please enter your business email address”
Help Text: “We require a business email to schedule demos”
Educational Institution
Scenario: Student application, verify enrollment
Allowed Pattern: *.edu domains
Error Message: “Please use your .edu email address”
Help Text: “Use your university email to verify student status”
Government Forms
Scenario: Inter-agency communication form
Allowed Pattern: *.gov domains
Error Message: “Please use your .gov email address”
Partner Portal
Scenario: Partner-only resource access
Allowed Domains:
partner1.com partner2.com partner3.org distributor.net
Error Message: “Access restricted to authorized partners”
Multi-Organization Whitelist
Scenario: Consortium or association members
Allowed Domains:
university1.edu university2.edu research-institute.org hospital-network.com
Error Message: “This form is for consortium members only”
Common Free Email Domains to Block
Major Providers
gmail.com yahoo.com hotmail.com outlook.com live.com msn.com aol.com icloud.com me.com mac.com
International Providers
mail.ru yandex.com qq.com 163.com 126.com gmx.com gmx.net web.de
Privacy-Focused Providers
protonmail.com proton.me tutanota.com fastmail.com
Disposable Email Domains
mailinator.com guerrillamail.com tempmail.com 10minutemail.com throwaway.email
Whitelist vs. Blacklist Approach
Whitelist (Recommended for Internal)
How it works: Only listed domains accepted
Pros:
- Maximum control
- No new domains slip through
- Perfect for internal/partner forms
Cons:
- Must know all valid domains
- New partners need manual addition
- Can frustrate legitimate users
Best for: Internal forms, known partner lists, strict access control
Blacklist (Recommended for B2B)
How it works: Listed domains blocked, others accepted
Pros:
- Accepts all business domains automatically
- No maintenance for new companies
- Flexible approach
Cons:
- New free providers may slip through
- Must maintain block list
- Can’t catch all free providers
Best for: B2B lead gen, demo requests, business-only forms
Error Messages Best Practices
Be Clear About the Requirement
Bad: “Invalid email”
Better: “Please use a business email address”
Best: “Please enter your work email (Gmail, Yahoo, etc. not accepted)”
Explain Why (Optional)
- “We require business emails to verify your company”
- “Personal email addresses are not accepted for this form”
- “Please use your organization email for verification”
Be Specific for Whitelists
- “Please use your @company.com email”
- “Only .edu email addresses are accepted”
- “This form requires a .gov email address”
Offer Alternatives
- “Don’t have a business email? Contact us at [email protected]”
- “For personal inquiries, use our general contact form”
User Experience Considerations
Set Expectations Early
- Add help text before they type
- “Business email required”
- Show accepted/blocked domains if appropriate
Validate in Real-Time
- Check domain as user types or on blur
- Don’t wait until form submission
- Immediate feedback saves frustration
Don’t Be Too Restrictive
- Consider freelancers (may use Gmail)
- Small businesses without custom domains
- International variations
Provide Contact Alternative
- Direct email for edge cases
- “Need to use a different email? Contact us directly”
Testing Domain Restrictions
Test Cases for Whitelist
- ✓ [email protected] (should accept)
- ✗ [email protected] (should reject)
- ✗ [email protected] (should reject)
- ✓ [email protected] (should accept)
Test Cases for Blacklist
- ✗ [email protected] (should reject)
- ✗ [email protected] (should reject)
- ✓ [email protected] (should accept)
- ✓ [email protected] (should accept)
Edge Cases to Test
- Subdomains: [email protected]
- Case sensitivity: [email protected]
- Typos in blocked domains: [email protected]
- New TLDs: [email protected]
Combining with Other Validations
Domain + Format Validation
- First: Valid email format
- Then: Domain restriction check
- Both must pass
Domain + Confirmation Field
- Require email confirmation (type twice)
- Domain check applies to both
- Catches typos in business emails
Domain + Required
- Field is required
- Must be valid format
- Must pass domain restriction
Common Issues and Solutions
Issue: Legitimate Users Blocked
Problem: Freelancers or small business owners use Gmail
Solutions:
- Provide alternative contact method
- Add note: “Don’t have business email? Email us at…”
- Consider if restriction is really necessary
Issue: New Free Providers Slip Through
Problem: Blacklist doesn’t catch new services
Solutions:
- Regularly update your blacklist
- Use a comprehensive list service
- Review submissions periodically
Issue: Subdomain Handling
Problem: [email protected] rejected when company.com is whitelisted
Solutions:
- Add common subdomains to whitelist
- Use wildcard matching if supported: *.company.com
- Document subdomain policy
Issue: Case Sensitivity
Problem: [email protected] rejected
Solution: Ensure validation is case-insensitive (most are by default)
Privacy and Data Considerations
What You’re Collecting
- Email domain reveals organization
- Consider privacy implications
- Be transparent in privacy policy
GDPR Compliance
- Domain restriction itself is fine
- Still need consent for processing
- Explain why business email required
Frequently Asked Questions
Will this stop all spam?
No. Spammers can use business-looking domains or compromised accounts. Domain restriction improves quality but isn’t spam-proof. Combine with CAPTCHA for better protection.
Should I block all free email providers?
Only for B2B forms where business email matters. For consumer forms, newsletter signups, or support, free emails are perfectly valid.
What about freelancers who use Gmail?
This is a trade-off. Strict B2B forms may lose some freelancer leads. Provide an alternative contact method for edge cases, or reconsider if restriction is necessary.
Can I allow multiple specific domains?
Yes. Whitelist as many domains as needed. Common for partner portals, consortium forms, or multi-organization access.
How do I handle international email providers?
If blocking free providers, include international ones (mail.ru, qq.com, etc.). If whitelisting, add all valid organizational domains including international offices.
Summary
Restricting email domains in WordPress forms:
- Decide your approach – Whitelist (allow only) or blacklist (block specific)
- Configure Email field – Enable domain restriction
- Add domains – List allowed or blocked domains
- Set clear error message – Explain what’s required
- Add help text – Set expectations before they type
- Provide alternatives – Contact option for edge cases
- Test thoroughly – Both valid and invalid emails
Conclusion
Email domain restrictions improve lead quality for B2B forms, ensure only authorized users access internal forms, and reduce spam from disposable addresses. Choose whitelist for strict control, blacklist for flexible business-email-only requirements. Always provide clear messaging so users understand what’s expected and have alternatives when needed.
Auto Form Builder supports email domain restrictions through its Email field settings, letting you whitelist specific domains for quality control. Build forms that capture the right emails from the right people.
Ready to filter email domains? Download Auto Form Builder and set up domain restrictions for better quality submissions.