You can automatically delete or archive old emails in Gmail by creating a filter. Enter the search criteria for your filter, along with the time period, in the search box. Click on the “Show search options” button and then on “Create a filter”. Choose Archive or Delete, then click “Create Filter” to save and apply.

Keeping your Gmail inbox clean can be a daunting task these days. Instead of manually searching for old emails that you want to delete or archive, you can set up a filter to do it automatically based on a selected time period. We’ll show you how.

Automatically archive or delete old emails

To get started, go to the Gmail website and sign in with your Google account. Go to the search box at the top of Gmail and enter the criteria you want to use.

For example, to archive or delete only emails from your inbox, you would use label:inbox Where in:inbox before the deadline. Then add older_than: followed by the period, using “d” for days, “w” for weeks, or “y” for years.

For example, to search for emails older than 90 days, you would use the following:

label:inbox older_than:90d

Or, to see messages older than two years, you would use:

label:inbox older_than:2y

After entering the criteria, press Enter or Return, and you will see the matching emails in your inbox.

Gmail Find emails older than 2 years

Next, select the “Show search options” icon, located at the far right of the search box.

When the window opens, you will still see your criteria in the search box. Go to the Has The Words field and enter only the period.

Using our examples above, you would enter older_than:90d Where older_than:2y .

Period in field Has the words

Select “Search. You should see the same emails in the list. Click the “Show search options” button again and this time choose “Create filter”.

Create a filter for search criteria

You’ll see a warning that the terms you’re using don’t match incoming emails. However, you know this because you are looking for old emails, not new ones.

Click “OK” to continue.

Confirm filter creation

In the next box, you will choose whether you want to archive or delete the emails. To archive them, check the “Skip the inbox (archive)” box. To delete them, check the “Delete” box.

RELATED: What is the difference between archiving and deleting emails?

You can optionally check the box at the bottom of the list to apply the filter to all matching conversations in your inbox.

When you’re done, select “Create Filter” to save and apply the filter.

Check the box to archive or delete emails

You can locate your archived emails or view deleted emails anytime you want.

Optional: Confirm that the filter is working

If you checked the box to apply the filter to existing conversations in your inbox, you can immediately verify that the filter has done its job.

Return to your inbox and enter the search criteria you used to create your filter in the search box. Press Enter or Return. You should see a message that no emails match your search.

Message that no email matches search

Change or remove AutoArchive or Deletion Filter

Once the filter is set up, you no longer have to worry about selecting and archiving or manually deleting emails from your inbox. The filter handles everything for you. But if you want to edit or remove the filter, you can certainly do that.

RELATED: How to Auto Forward Specific Emails in Gmail

Select the gear icon in the top right of Gmail and choose “See all settings” from the sidebar.

Select the “Filters and blocked addresses” tab. You’ll see your filter listed along with any others you’ve created. To edit the filter, select “Edit” on the right side.

Options for editing and deleting a filter

Make your changes in the pop-up window and select “Update Filter”.

Update filter for a changed filter

To completely remove the filter, select “Remove” on the right side, then confirm that you want to remove the filter by clicking “OK”.

Confirmation of deleting a filter

Save time by automatically archiving or deleting your emails in Gmail. You can then keep your inbox clean and spend your time on more important things.