### [How to Add Domains to the Email Suggestion List](https://wpforms.com/developers/how-to-add-domains-to-the-email-suggestion-list/)

**Published:** March 31, 2020
**Author:** Editorial Team

**Excerpt:** This tutorial will show you how to add domains to the email suggestion list using PHP. 

**Content:**

Would you like to add domain names to the email suggestion list on your form? Using a small PHP snippet, you can easily add your own accepted domain names to appear on this list. In this tutorial, we will show you the PHP needed to expand this suggested list.

## Creating the form

To begin, we’ll create a new form and add at least one **Email** field to the form.

If you need any assistance in creating your form, [please review this documentation](https://wpforms.com/docs/creating-first-form/ "How to Create Your First Form").

![begin by creating your form and adding at least one email address form field to the form.](https://wpforms.com/wp-content/uploads/2022/05/wpforms-create-form-add-email.jpg)

Below, we have two different snippets. You can of course use both or just choose one or the other.

Just copy any or all of the snippets below and add them to your site. If you need help with how and where to add snippets to your site, [please review this tutorial](https://wpforms.com/developers/how-to-add-custom-php-or-javascript-for-wpforms/ "How to Add Custom PHP or JavaScript for WPForms").

## Adding a new domain to the list

With the snippet below, `domain.com` will be added to the list of domains that can appear as a suggested domain.

```

/**
 * Add a new domain to the email suggestion list
 *
 * @link https://wpforms.com/developers/how-to-add-domains-to-the-email-suggestion-list/
 */

function wpf_dev_mailcheck_domains( $domains ) {

    $domains[] = "domain.com";

    return $domains;
}

add_filter( 'wpforms_mailcheck_domains', 'wpf_dev_mailcheck_domains', 10, 1 );
```

![Using this snippet, you can now add domains to the email suggestion list](https://wpforms.com/wp-content/uploads/2022/05/wpforms-add-domain-email-suggestion.jpg)

## Adding a top level domain to the list

With the snippet below, the top-level domain **xyz** will be added to the list of top-level domains that can appear as a suggested top-level domain. For example you could then suggest **sullie@wpforms.xyz** in your email suggestion using this snippet.

```

/**
 * Add a top-level domain to the email suggestion list
 *
 * @link https://wpforms.com/developers/how-to-add-domains-to-the-email-suggestion-list/
 */

function wpf_dev_mailcheck_toplevel_domains( $domains ) {

    $domains[] = 'xyz';

    return $domains;
}

add_filter( 'wpforms_mailcheck_toplevel_domains', 'wpf_dev_mailcheck_toplevel_domains', 10, 1 );
```

A top-level domain (TLD) is the last segment of text in a domain name, such as .com or .net.

And that’s it! You’ve successfully added to the email address suggestion list. Would you like to disable this feature completely? Take a look at our tutorial on [How to Disable the Email Suggestion on the Email Form Field](https://wpforms.com/developers/how-to-disable-the-email-suggestion-on-the-email-form-field/ "How to Disable the Email Suggestion on the Email Form Field").

## Reference Filters

- [wpforms\_mailcheck\_domains](https://wpforms.com/developers/wpforms_mailcheck_domains/ "Using the wpforms_mailcheck_domains filter")
- [wpforms\_mailcheck\_toplevel\_domains](https://wpforms.com/developers/wpforms_mailcheck_toplevel_domains/ "Using the wpforms_mailcheck_toplevel_domains filter")

**Categories:** Fields

**Tags:** PHP

---

