WordPress Contact Form Domain Validation

via Freelancer ·

Budget / Salary$10–30
TypeFreelance project
LocationRemote
Posted2 hours ago
I need our Contact Us form (built with Contact Form 7) to refuse any address whose domain cannot actually receive mail. A simple pattern match is not enough—I want true domain-level validation, ideally by checking DNS MX or a comparable method before the form is allowed to submit.

When a visitor enters an address from a non-existent domain the form should stay on the page and show a concise custom error message; I’ll provide the exact wording or adjust it later, but the mechanism for editing it must be clear. Everything else in the form should continue to behave exactly as it does now, including the AJAX spinner and any existing field validations.

Feel free to implement the logic with a dedicated mini-plugin, a functions.php filter, or any Contact Form 7 hook you prefer, as long as it is lightweight and won’t break on future WP or CF7 updates. Please test against a few known invalid domains to demonstrate that the mail is never sent and the error message appears reliably.

Deliverables:
• Code (plugin or snippet) that hooks into Contact Form 7 and performs domain validation
• The editable custom error message string, clearly labelled
• A short read-me explaining where the code sits and how to change the message or move it to staging/production

I’ll provide site access and staging details once we agree on the approach.
php javascript ajax wordpress dns mysql html web development
Apply on Freelancer →

Project sourced from Freelancer.com. Applications happen directly on the original platform — we never collect your data.