Free up space in an email account: find the emails that take up the most and delete them
When an email account fills up, the first thing people usually do is delete hundreds of messages. But each email takes up only a few kilobytes and the space recovered is minimal. The key is to find the ones that take up the most first, which are almost always the ones with large attachments.
Find the largest emails in webmail
-
Log in to Roundcube webmail and open the folder you want to review. Email usually builds up in the Inbox and in Sent.
-
At the top of the message list, click Options.

-
Choose to sort by Size, in descending order, and save. The emails that take up the most will appear first.

-
Open each email to see its attachments and how big they are. If you want to keep an attachment, download it before deleting the message.

-
Delete the ones you do not need and empty the Trash: while messages are in it, they still take up space.
Repeat in Sent and in your own folders. Sent emails often carry the same heavy attachments you sent, and they are good candidates to start with.
Delete in bulk from cPanel
If you do not need to review the emails being deleted one by one, in cPanel go to Email > Email Disk Usage, choose the account in the drop-down at the top and click Manage next to the folder. INBOX is the inbox and Sent is Sent.

You can delete based on these conditions:
- 1 year old or more: emails more than a year old.
- 30 MB in size or more: emails of 30 MB or more.
- Previously viewed: emails that have already been read.
- All messages: every email in the folder.
- Custom query...: a custom query, explained below.
Choose one, click Delete Permanently and confirm. The emails are deleted for good, without going through the Trash. If there is anything you want to keep, save it to your computer first.
Custom queries (Custom query)
With Custom query... you write a query in Dovecot's search format and delete exactly what you want. The query only applies to the folder where you clicked Manage.
By date
Emails before 1 January 2024:
BEFORE 01-Jan-2024
Emails from 2023 (from 1 January 2023 up to before 1 January 2024):
SINCE 01-Jan-2023 BEFORE 01-Jan-2024
Emails more than 30 days old:
BEFORE 30days
For relative dates you can use days or weeks (for example 52weeks for a year). months and years do not work: for long periods, use a specific date.
BEFORE and SINCE use the internal date the server stores each email with (usually when it was received). If you imported email from another provider and those dates do not match, use SENTBEFORE and SENTSINCE, which look at the date written in the email itself:
SENTBEFORE 01-Jan-2024
By size
Emails larger than 5 MB:
LARGER 5242880
The size is in bytes: 1 MB = 1048576, 5 MB = 5242880, 10 MB = 10485760, 20 MB = 20971520, 50 MB = 52428800.
Combine conditions
Write the conditions one after another, separated by spaces: the emails that meet all of them are deleted.
Emails before 2024 and larger than 10 MB:
BEFORE 01-Jan-2024 LARGER 10485760
Emails from one sender in a given period:
FROM "avisos@ejemplo.com" SINCE 01-Jan-2023 BEFORE 01-Jan-2024
All emails from one sender:
FROM "notificaciones@ejemplo.com"
Emails sent to an address:
TO "destinatario@ejemplo.com"
Newsletters more than a year old and larger than 2 MB:
SUBJECT "newsletter" BEFORE 52weeks LARGER 2097152
By read status
Emails already read, before 2024 and larger than 20 MB:
SEEN BEFORE 01-Jan-2024 LARGER 20971520
SEEN means read and UNSEEN means unread. Use them together with another condition: a read email may still be important.
To check which emails match before deleting, you can run a similar search in Roundcube (by sender, subject or date). You will find all the criteria in the Dovecot search query reference.
After deleting
The space used can take a few minutes to update in cPanel. If you still need the email and do not want to delete any more, you can increase the account's quota if your hosting has free space. If emails stopped arriving because the mailbox was full, see emails not received due to lack of space.
If you want old emails to be deleted automatically every day, see delete old emails automatically.
You may also find useful
- Email Disk Usage: see what takes up space in a mailbox and empty it With cPanel's Email Disk Usage tool you can see which folders take up the most space in an email acc...
- Download your email to your computer and delete it from the server Three ways to keep your email on your computer and free up space on the server: copy it to local fol...
- Access your email through webmail and use Roundcube Log in to your email from the browser at yourdomain.com/webmail with the full address and its passwo...
- Add a safe sender in SpamAssassin Shows how to lower the SpamAssassin score of a specific sender address and explains why this list do...
Something wrong or out of date? Tell us and we will review it.