You might already be stopping emails from certain senders from flooding your inbox. But sometimes, you’ll receive several emails with different addresses, yet all from the same domain. You can block that entire domain in Gmail. Here’s how.

To block an email address in Gmail, you can create a filter that automatically deletes those messages. So, they go directly to the Trash folder rather than sitting in your inbox. Entire domains, like “@example.com”, can get the same treatment. There are two methods to do this, with the first being slightly faster but the second allowing you to block multiple domains at once.

Method 1: Create a Filter From an Email

Head to Gmail, sign in, and select an email from the domain you want to block. Click the three dots on the top right of the message and pick “Filter Messages Like This.”

You’ll see the Create Filter window open. Go to the email address that populates automatically and remove everything to the left of the @ (At) symbol. Select “Create Filter”.

On the next screen, mark the option for Delete It. Optionally, you can choose to apply the filter to all matching conversations. You’ll see a count of other emails in your inbox from that sender.

Then, click “Create Filter.”

Moving forward, emails from that domain will be deleted rather than arriving in your inbox.

Method 2: Create a Filter From the Settings

You can also set up a filter from your Gmail settings to delete emails from a domain. Click the gear icon on the top right and pick “See All Settings.”

Select the Filters and Blocked Addresses tab and choose “Create New Filter.”

You’ll see the Create Filter box appear. In the From field, enter the @ symbol followed by the domain, for example, “@domain.com”.

The advantage to using this method is that you can enter more than one domain. Simply separate them with “OR” as in “@domain1.com OR @domain2.com”.

Then click “Create Filter.”

Mark the option for Delete It, optionally apply the filter to matching conversations in your inbox, and select “Create Filter.”

Just like the first method explained above, any new emails from that domain will be automatically deleted when they arrive.

Deleting emails you receive from a particular domain doesn’t necessarily “block” that domain as with sending to Spam. But it does give you control to remove those messages before they land in your Gmail inbox.

For more, look at how to unsubscribe from emails in Gmail.