I’d like to validate the last part of the domain name submitted in a WordPress Contact Form 7 email field. The validation condition is that the last part of the address domain (not the whole domain name) must match one of several values.

So for example I’d only like to validate addresses ending in “cabbage.com”, “peas.com” or “carrot.com”:



would both be OK, however


would fail.

Any ideas or pointers to code I could use?

Many thanks! 😀


Read more here: WordPress Contact Form 7 email address validation


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Wordpress related questions and answers: