
A "disk quota exceeded" warning almost never means your site suddenly got bigger overnight. It usually means something quiet has been piling up for months — old email, stale logs, forgotten backups, or a cache directory nobody ever cleared. This tutorial covers a proper cPanel disk usage cleanup: finding exactly what's eating your space and removing it without touching files your site actually needs.
If you manage hosting for clients, this ticket shows up constantly. "My site is down, disk full" is rarely a hosting problem. It's a housekeeping problem — and it's fixable in under 20 minutes once you know where to look.
Where cPanel Disk Space Actually Goes
Before deleting anything, know the usual suspects. In order of how often they cause quota issues:
- Email accounts - especially catch-all addresses collecting spam, or mailboxes nobody has checked in years
- cPanel backups - full account backups stored inside
/home/username/backupscan be larger than the account itself - Log files - raw access logs and error logs under
/home/username/logs, especially on sites without log rotation - WordPress cache and uploads - plugin cache directories, old media uploads, and duplicate image sizes
- Trash and temp files - File Manager's Trash folder, plus leftover install packages from Softaculous
On shared hosting accounts, email and backups are usually the two biggest offenders. On a VPS running WHM with multiple accounts, it's more often logs and unpruned backups.
Step 1: Check Total Usage in cPanel
Log into cPanel and open the Disk Usage section under Files. It breaks down usage by directory, largest first. This is your starting map.
Watch three numbers separately: total account usage, mail usage, and the size of public_html. If mail usage looks disproportionate next to your actual site size, you've found the problem before opening a single file.
If you're on a VPS with SSH access, the command line gives you a faster, more precise picture:
du -sh /home/username/* | sort -rh | head -20
This lists the 20 largest directories under the account's home folder, biggest to smallest. Run it as root or via sudo, and swap in the actual cPanel username.
Step 2: Find and Clear Bloated Mail
Email storage is the most common cause of surprise quota alerts. Check per-mailbox usage in WHM under Email Accounts, or from the shell:
du -sh /home/username/mail/domain.com/*
If a mailbox is enormous, the fix depends on the cause. For a catch-all address drowning in spam, disable the catch-all or tighten spam filtering. For a legitimate mailbox with years of attachments, set up an auto-purge rule, or have the user archive locally via IMAP and delete the server-side copies.
Webmail (Horde/Roundcube) also keeps its own cache. Clearing it from cPanel's Webmail interface under Settings sometimes recovers a surprising amount of space on older accounts.
If bounce-related mail queues are adding to the pressure, check your email bounce troubleshooting setup. Misconfigured SPF or DKIM often generates a flood of returned mail that sits in the mailbox until someone deals with it.
Step 3: Prune Old cPanel Backups Safely
Full account backups generated by cPanel or WHM live inside the account itself, unless you've set up remote destinations. Over time, they stack up and can double or triple your effective disk usage.
Check for them here:
ls -lh /home/username/backups/
Never delete the most recent backup blindly. Confirm you have at least one verified, restorable backup stored offsite before removing anything local.
This is the step people skip and regret. If you haven't tested a restore recently, run through a proper cPanel backup verification process first.
Once you're confident, remove backups older than your retention window:
find /home/username/backups/ -name "*.tar.gz" -mtime +30 -delete
That command removes archives older than 30 days. Adjust the number to match your retention policy. Always test the find command without -delete first to preview what it would remove.
Step 4: Clean Up Logs Without Losing Diagnostic History
Raw domain logs accumulate fast on high-traffic sites. This is especially true if log rotation isn't configured, or keeps too many archives. Check sizes with:
du -sh /home/username/logs/*
In cPanel, go to Metrics > Raw Log Manager and enable archiving with compression. Or disable raw log retention entirely if you rely on Awstats or analytics instead. On a VPS running Apache or Nginx directly, confirm logrotate is actually configured:
cat /etc/logrotate.d/httpd
cat /etc/logrotate.d/nginx
A sane rotation policy keeps 7-14 days of logs compressed, then discards older ones. Without it, a busy site can generate gigabytes of access logs in a single month.
Step 5: Clear WordPress Cache and Media Bloat
WordPress sites often carry dead weight in wp-content/uploads and cache plugin directories. A few quick wins:
- Delete unused image sizes with a plugin like Regenerate Thumbnails, or remove them manually if you've changed themes and no longer need old crop sizes
- Clear cache plugin directories such as
wp-content/cacheorwp-content/litespeed- these regenerate automatically and are always safe to empty - Check for orphaned revision data in the database - it doesn't affect disk directly, but it often correlates with bloated backups
If your site relies heavily on page caching, compare your current setup against a proper Nginx caching for WordPress configuration. Misconfigured cache purge rules can leave stale files piling up instead of expiring.
Step 6: Empty File Manager Trash and Temp Directories
cPanel's File Manager has its own Trash, separate from anything at the OS level. Deleted files sit there until you empty it manually. Check File Manager > Settings > Show Hidden Files, then look for a .trash folder inside public_html or the account root.
Also check for leftover Softaculous install temp files and any tmp directories from failed script installs. These rarely show up in normal browsing. But they can carry several hundred MB of dead weight on accounts that have installed and removed multiple applications over time.
Step 7: Set Up Alerts Before It Happens Again
Cleanup fixes the immediate problem. Monitoring prevents the next one. In WHM, enable disk usage notifications under Server Configuration > Contact Manager, and set a threshold well below 100% - 80% is a reasonable early warning.
For VPS environments outside cPanel, pair this with proper resource alerting. A dedicated monitoring setup, covered in this server monitoring tutorial, catches disk pressure days before it turns into an outage instead of after.
A quick checklist worth running monthly:
- Review Disk Usage breakdown in cPanel or WHM
- Check mailbox sizes for outliers
- Confirm backup retention is pruning old archives
- Verify log rotation is active and compressing correctly
- Clear WordPress cache directories on high-traffic sites
If cleanup only buys you a few weeks before you're back at the same quota wall, the account has outgrown its plan. HostMyCode's shared hosting plans include generous storage tiers, and if you're running multiple client sites, our reseller hosting packages give you full control over disk allocation per account without guesswork.
FAQ
Why does my disk usage keep climbing even though I haven't uploaded new files?
Check email and backups first. These grow silently in the background and cause most unexpected quota alerts on shared hosting accounts.
Is it safe to delete files shown in cPanel's Trash folder?
Yes, once you've confirmed they're not files you meant to recover. Trash items are already marked for deletion and don't affect your live site.
How much disk space should I keep free as a buffer?
Aim to stay under 80% of your quota. That leaves room for backups, temporary upload spikes, and log growth between cleanup cycles.
Can deleting logs break anything on my site?
No, access and error logs are historical records, not active dependencies. Deleting or archiving them has no effect on site functionality.
Should I disable backups entirely to save space?
No. Move backups to remote storage instead of keeping them local, and prune old local copies once offsite copies are verified.