Skip to content
Back to Blog
Hosting Support8 min read

How to Free Up Disk Space on a cPanel Account: 7 Fixes

Your cPanel account is full and your site won't upload files. Learn which directories hog space and how to clean them without breaking anything.

Written by Abdul AbrorTechnical Hosting Support Engineer
How to Free Up Disk Space on a cPanel Account: 7 Fixes
On this page

Your site stopped accepting file uploads. The backup script threw an error. You logged into cPanel and saw a red disk usage bar at 98%.

A full disk on a shared hosting account stops everything: email delivery fails, WordPress won't update, databases can't write new rows. Most hosts enforce a quota—typically 5 GB to 50 GB depending on your plan—and once you hit it, services break until you free space.

This guide walks through the seven places that eat disk space on cPanel accounts and shows you exactly how to reclaim it.

What cPanel disk usage actually counts

Your cPanel quota measures everything inside your home directory: website files, databases, email, logs, backups, and trash. The Disk Usage tool in cPanel shows a breakdown, but it can lag by an hour or more.

The quota does not include the cPanel system itself or other users' accounts. You share the server's physical disk with other customers, but your quota is your private allocation.

When you see "98% of 10 GB," that means 9.8 GB of your 10 GB limit is used. Once you cross 100%, most hosts suspend write operations. Some allow a brief grace period; others cut you off immediately.

Check where the space went first

Log into cPanel and open Disk Usage under the Files section. It scans your directories and shows a bar graph sorted by size. Let it finish scanning—on accounts with millions of files this can take a few minutes.

Look for the biggest bars. In most cases I've handled, the top offenders are:

  • mail/ — email accounts and spam folders
  • backup-*/ or backups/ — old cPanel backups
  • logs/ — Apache and application logs
  • public_html/ — your actual website, especially uploads or cache folders
  • tmp/ or .trash/ — leftover session files and deleted items

Write down the top three directories and their sizes. You'll target those first.

1. Clean out old email messages

Email is the number-one space hog on shared hosting. Each message with attachments lives on disk, and spam folders can balloon to gigabytes in weeks.

Delete from webmail

Open Email Accounts in cPanel, click Access Webmail next to an account, and log in (Roundcube or Horde). Open the Junk or Spam folder and select all messages, then delete. Do the same for Trash.

If the Sent folder has years of messages, delete anything older than six months unless you need it for compliance.

Purge via cPanel

For faster bulk deletion, use Email Disk Usage in cPanel. It lists every email account and its size. Click Manage next to a large account, then Delete Messages or Empty Folder.

I've seen accounts where a single abandoned mailbox held 12 GB of spam. Deleting it freed the entire quota.

Configure auto-deletion

In Email Filters, create a rule that auto-deletes spam older than 30 days. Set another filter to purge Trash weekly. This prevents future buildup.

2. Remove old backups

cPanel's Backup Wizard stores full-account or partial backups in your home directory by default. A single full backup can match your entire site size.

Open File Manager, enable Show Hidden Files in settings, and look for folders named backup-* or files like backup-2023-05-10.tar.gz. These sit at the root of your home directory or inside public_html/.

Select old backups and delete them. Keep only the most recent one unless you have a reason to preserve older snapshots.

If you need backups, store them off-server: download to your local machine, upload to cloud storage, or use your host's remote backup feature (many hosts back up accounts separately from your quota).

3. Clear Apache and error logs

Web server logs grow fast on high-traffic sites. Apache's access_log records every request; error_log captures PHP warnings and 404s.

In File Manager, navigate to logs/ (or sometimes public_html/logs/). You'll see files like:

access_log
access_log.1
error_log
error_log.1

The numbered versions are rotated older logs. Open the largest file in the text editor to confirm it's a log (lines with timestamps and IP addresses), then delete it.

Do not delete the current access_log or error_log while the server is writing to them—this can cause write errors. Instead, empty them:

> logs/access_log
> logs/error_log

This truncates the files to zero bytes but leaves them in place for Apache to keep writing.

If logs refill quickly, ask your host to enable log rotation or reduce retention from 30 days to 7 days.

4. Delete unused files in public_html

Your website directory—public_html/, www/, or httpdocs/—holds everything visitors see. Over time, old themes, plugins, and uploads accumulate.

Find large subdirectories

In Disk Usage, expand public_html/ to see which folder is largest. Common culprits:

  • wp-content/uploads/ — WordPress media library
  • wp-content/cache/ or cache/ — plugin cache files
  • tmp/, temp/, or sessions/ — temporary data
  • Old CMS installs in subdirectories (Joomla, Drupal)

Remove old uploads

If you have a WordPress site, open wp-content/uploads/ and sort by date. Delete folders from years you no longer reference (e.g., /2019/, /2020/). Check the Media Library in WordPress first to confirm those images aren't in use.

For non-WordPress sites, search for directories named uploads/, files/, or media/ and audit their contents.

Clear cache and temp files

Delete everything inside:

  • wp-content/cache/
  • public_html/cache/
  • tmp/ or temp/

Cache regenerates automatically. Session files older than a day are safe to delete. If a folder is empty afterward, you can remove the folder itself.

Remove old CMS installations

If you have a staging site or an old Joomla install in a subdirectory you don't use, delete the entire folder. A full WordPress install with themes and plugins can weigh 500 MB before any content.

5. Empty the Trash folder

cPanel's File Manager has a hidden .trash/ directory that holds deleted files until you manually empty it. It doesn't auto-purge.

In File Manager, enable Show Hidden Files (Settings button, top right). Navigate to your home directory and look for .trash/. Open it, select all, and delete permanently (not "Move to Trash" again—delete outright).

6. Compress or offload databases

MySQL databases count toward your quota, but they rarely exceed a few hundred megabytes unless you run a forum, LMS, or analytics tool that logs everything.

Open phpMyAdmin in cPanel. Look at the Size column for each database. If one is unusually large (over 1 GB), click into it and check the individual tables.

Truncate log tables

WordPress plugins like WooCommerce and security tools create log tables that grow unbounded:

  • wp_actionscheduler_logs
  • wp_wfHits (Wordfence)
  • wp_statistics_visit (WP Statistics)

Click the table, switch to the Operations tab, and click Empty the table (TRUNCATE). This deletes all rows but keeps the structure. The plugin will repopulate it as needed.

Export and delete old data

If you have order history or user logs older than two years that you need for records but not for the live site, export the table to SQL, download it, and truncate the table in phpMyAdmin.

Optimize tables

Select all tables in a database, choose Optimize table from the dropdown. This reclaims fragmented space. The savings are usually small (a few MB), but it's free.

7. Remove unused add-on domains and subdomains

Each add-on domain or subdomain creates a separate public_html/ folder. If you parked a domain for a project that never launched, its empty directory structure still uses inodes and a bit of space.

In cPanel, open Addon Domains and Subdomains. Remove any you don't actively use. This deletes the domain mapping and its document root.

Before deleting, verify the folder is empty or contains nothing you need.

What if you're still over quota?

After the seven fixes above, re-check Disk Usage. If you're still near the limit, you have three options:

  1. Upgrade your hosting plan. Most hosts let you move to a higher tier with a larger quota. This is the simplest fix if your site legitimately needs more space.
  2. Move large files off-server. Host videos and large downloads on a CDN or S3 bucket, then link to them. This keeps media off your quota.
  3. Ask your host for a temporary increase. Some hosts grant a one-time quota bump while you migrate or clean up, especially if you're mid-contract.

Don't ignore the problem. A full disk can corrupt databases if a write fails mid-transaction.

How to prevent disk bloat going forward

Set email quotas

In Email Accounts, edit each mailbox and set a quota (e.g., 500 MB). When the mailbox fills, older messages must be deleted. This forces users to clean up instead of hoarding years of spam.

Disable unnecessary logging

If you don't actively read Apache logs, ask your host to disable them or set a 3-day retention. Error logs are useful; access logs on a brochure site are not.

Use remote backups

Never store cPanel backups in your home directory. Use the Backup tool's option to send backups to FTP, SFTP, or a remote server if your host supports it.

Audit storage monthly

Add a calendar reminder to check Disk Usage once a month. Spot a growing folder early and clean it before it hits your quota.

Offload media

For WordPress, use a plugin like Offload Media to move uploads to S3 or Cloudflare R2. The files serve from the bucket but appear on your site. This keeps your quota low even with thousands of images.

The easiest wins for most accounts

Start with email and backups. Those two alone clear 70% of bloat in shared hosting accounts I've worked on.

Empty spam folders across all mailboxes, delete old local backups, and truncate any plugin log tables over 100 MB. Check Disk Usage again. If you're back under 80%, you're done.

The rest—cache folders, old uploads, log files—are smaller wins but still worth doing if you're tight on space or want to prevent future issues. Once you're comfortable with File Manager and phpMyAdmin, the whole process takes under 15 minutes.

FAQ

Why does cPanel Disk Usage show more space than File Manager sizes add up to?

File Manager rounds sizes and skips hidden system files. The Disk Usage tool scans everything, including . files, database files, and maildir metadata. It's the accurate number.

Can I increase my quota myself?

No. The quota is set by your hosting plan and enforced at the server level. You need to contact support or upgrade your plan.

Will deleting email in webmail free space immediately?

Most of the time, yes. Some mail servers queue the deletion for a few minutes. If Disk Usage doesn't drop after 10 minutes, log out of webmail, wait, then log back in and check Trash is empty.

Is it safe to delete everything in the tmp folder?

Yes, as long as you're not actively uploading files or running a script at that moment. Temp files are transient. If something breaks, it will regenerate them.

What happens if I hit 100% during a database write?

The write fails, and the query returns an error. If the write was part of a transaction (like updating a row), the transaction may roll back. If not, you could end up with a partially written table. Free space quickly to avoid corruption.