{"id":259,"date":"2025-04-10T14:25:10","date_gmt":"2025-04-10T12:25:10","guid":{"rendered":"https:\/\/www.24x7serverguard.com\/blog\/?p=259"},"modified":"2025-05-08T13:46:53","modified_gmt":"2025-05-08T11:46:53","slug":"how-to-automatically-delete-old-emails-in-cpanel-using-cron-jobs","status":"publish","type":"post","link":"https:\/\/www.24x7serverguard.com\/blog\/cpanel\/how-to-automatically-delete-old-emails-in-cpanel-using-cron-jobs\/","title":{"rendered":"How to Automatically Delete Old Emails in cPanel Using Cron Jobs?"},"content":{"rendered":"\n<p>To automatically delete old emails in cPanel, you can set up a cron job to remove messages older than a specified number of days. Follow these steps:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Log in to your <strong>cPanel dashboard<\/strong>.<\/li>\n\n\n\n<li>Navigate to <strong>Cron Jobs<\/strong> under the <strong>Advanced<\/strong> section.<\/li>\n\n\n\n<li>Add the following command as a new cron job:<\/li>\n<\/ol>\n\n\n\n<p><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">\/usr\/bin\/archivemail &#8211;quiet &#8211;delete &#8211;days 20 \/home\/{USER}\/mail\/inbox<\/mark><\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>\u26a0\ufe0f Replace <code>{USER}<\/code> with your actual cPanel username.<\/p>\n<\/blockquote>\n\n\n\n<p>This command will automatically delete emails that are older than <strong>20 days<\/strong> from your inbox. You can customize the number of days as needed. Using this method helps you <strong>manage email storage efficiently<\/strong> and <strong>keep your inbox clean<\/strong> without manual intervention.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>To automatically delete old emails in cPanel, you can set up a cron job to remove messages older than a specified number of days. Follow these steps: \/usr\/bin\/archivemail &#8211;quiet &#8211;delete &#8211;days 20 \/home\/{USER}\/mail\/inbox \u26a0\ufe0f Replace {USER} with your actual cPanel username. This command will automatically delete emails that are older than 20 days from your [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":260,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[220,226,221,216,218,229,223,217,224,225,222,28,228,219,227],"class_list":["post-259","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cpanel","tag-autodeleteemails","tag-cpanelautomation","tag-cpanelguide","tag-cpaneltips","tag-cronjobs","tag-digitalhousekeeping","tag-emailcleanup","tag-emailmanagement","tag-hostingtutorial","tag-inboxmaintenance","tag-linuxhosting","tag-servermanagement","tag-techtips","tag-webhostingtips","tag-websitemanagement"],"_links":{"self":[{"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/posts\/259","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/comments?post=259"}],"version-history":[{"count":1,"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/posts\/259\/revisions"}],"predecessor-version":[{"id":261,"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/posts\/259\/revisions\/261"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/media\/260"}],"wp:attachment":[{"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/media?parent=259"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/categories?post=259"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/tags?post=259"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}