These instructions are designed to help you delete old emails in bulk via cPanel. This can be useful in certain occasions where youâ™d like to remove emails en-masse based on some kind of variable â“ for instance if youâ™d like to delete all emails from a particular sender, or all emails you received before a particular point in time. if you're unsure how to log into cPanel please refer to the following guide here.

1) 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 / Custom Query

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 someone@somedomain.com.au
from someone@somedomain.com.au

Delete all emails to someone@somedomain.com.au
to someone@somedomain.com.au

Delete all emails with the subject "SPAM-thing-here" (without quotes)
subject SPAM-thing-here
We strongly advise exercising due care when deleting emails. If you do happen to accidentally delete emails via the above processes that you need to recover, it may be possible to restore them via our Click Restore feature.





Did you find this article useful?