Deleting old emails in bulk through cpanel

These instructions are designed to help you delete old emails in bulk via cPanel. This can be useful in certain occasions, for instance if you’d like to delete all emails from a particular sender, or all emails you received before a particular date.


1) Login into cpanel, click on the Email Disk Usage icon under the Mail section in cPanel.


2) Next to the Account heading – choose the specific email account you’d like to clean up.


3) On the next screen you will see a listing of the different mailboxes for the email account you selected. For example, you will be able to see your Inbox, Sent Items, Junk Mail etc. The number of emails in each of these mailboxes as well as the disk usage for each will be shown.

– Click Manage on the far right next to the mailbox you’d like to clean up. In this example shown below we’ll be cleaning up the Inbox.
– Over on the left click Messages to delete.
– You will be presented with various default options, in this example we’ll select 1 year old or more – this will delete all messages 1 year old & beyond from the Inbox.
– Once you are certain that you wish to proceed with this action – click Delete Permanently.


Advanced Options

It’s possible to perform deletions based on specific values rather than using the default options that are shown in the Messages to delete menu. This is achieved by using the Custom query option.

1) Follow the same steps as defined earlier in this guide until you see the Messages to delete drop down menu – then click Custom query.

2) A new box will appear with the text Dovecot query. You can enter different values into this box to perform deletions based on a range of variables. Once you are ready to proceed – click Delete Permanently.


Some example queries are listed below. These can be modified to your specific requirements:

Delete all emails received before the 12th of March 2016.
savedbefore 12-Mar-2016

Delete all emails received on the 10th of April 2016.
savedon 10-Apr-2016

Delete all emails received since 15th of November 2016.
savedsince 15-Nov-2016

Delete all emails sent before 12th of February 2016.
sendbefore 12-Feb-2016

Delete all emails sent on 21st of September 2016.
senton 21-Sep-2016

Delete all emails since on 12th of December 2016.
sentsince 12-Dec-2016

Delete all emails from

Delete all emails to

Delete all emails with the subject “SPAM-thing-here” (without quotes)
subject SPAM-thing-here

We strongly advise exercising due care when deleting emails.