Title: WordPress default comment email field validation
Last modified: April 29, 2021

---

# WordPress default comment email field validation

 *  [Subhro](https://wordpress.org/support/users/subhro2321/)
 * (@subhro2321)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/wordpress-default-comment-email-field-validation/)
 * I want the email field in the default WordPress comment to accept only {gmail.
   com},{icloud.com},and {yahoo.com}
 * Someone help me out by giving me the validation code.
 * Thanks in advance!

Viewing 1 replies (of 1 total)

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/wordpress-default-comment-email-field-validation/#post-14382174)
 * I cannot offer specific code for this, but you could hook the ‘preprocess_comment’
   filter and check the email within the passed data. If it’s inappropriate, you
   can just `wp_die()` with a message since the comment hasn’t been inserted yet.
   The user would have to use their browser’s back button to get back to the comment
   form.

Viewing 1 replies (of 1 total)

The topic ‘WordPress default comment email field validation’ is closed to new replies.

## Tags

 * [validation](https://wordpress.org/support/topic-tag/validation/)

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 1 reply
 * 2 participants
 * Last reply from: [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * Last activity: [5 years, 1 month ago](https://wordpress.org/support/topic/wordpress-default-comment-email-field-validation/#post-14382174)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
