How to Free Up Disk Space on a WordPress Server
To free disk space on a WordPress server, first measure what's using it. Usually it's old backups, logs, caches or the media library. Clear backups and logs first, since they're easy and safe. If media is the real cause, move it to cloud storage, then remove local copies only once every file is proven there.
What kind of limit have you hit?
Hosts limit more than one thing, and each has a different fix. These commands only read, so they're safe to run over SSH:
| Limit | How to check | What usually helps |
|---|---|---|
| Disk space | df -h | Clearing backups, logs and caches, or moving media |
| File count (inodes) | df -i | Clearing caches and old sessions, or removing local copies of media |
| Database size | Your host's panel, or wp db size | Revisions, old transients and logs in the database |
Offloading media doesn't help with a database limit.
What's using the space?
Your host's control panel may show this. With SSH, run:
du -h --max-depth=2 wp-content | sort -hr | head -20Look at wp-content/uploads, wp-content/updraft or other backup folders, wp-content/cache, and any large log files. Also check outside WordPress, because staging copies and old site folders can take as much space as the live site.
What can you clear safely?
- Old backups stored on the same server. They don't protect you if the server fails anyway. Move them elsewhere, then delete them.
- Logs. A
debug.logcan grow very large. Fix what's filling it, then clear it. - Caches. They rebuild themselves.
- Unused plugins and themes. Delete what you've deactivated and don't need.
- Old post revisions, which live in the database rather than on disk, but count on some hosts.
What about the media library?
If uploads is the biggest folder, you have a few options:
- Compress images. It helps, but doesn't change the long-term trend.
- Remove unused media. Be careful: "unused" tools can miss images used in places they don't scan.
- Offload to cloud storage. Files live in a bucket and visitors load them from there.
Offloading alone doesn't free disk space if local copies stay. Those local copies are a safety net, so removing them is its own decision.
How do you remove local copies safely?
Only remove a local copy when all of these are true:
- Every size of that image is checked in the bucket.
- Some time has passed, so a mistake has time to show.
- You can get the file back.
Some plugins read files straight from the uploads folder, including certain image optimizers, shops and download managers, and on-server backup plugins. Check yours first.
Bringing files back later needs room on the server again, so don't plan to use the freed space for anything you can't move.
Offloft's free plugin keeps your local copies, so it won't free disk space by itself. Offloft Pro can remove them under these rules, and a removed file comes back by itself when WordPress needs it. Keep your own backups of important media either way.
Will this lower your hosting bill?
It can, if your host charges for storage or you'd otherwise need a bigger plan for the room. Check your plan first, because many charge for other things too, and some don't depend on disk space at all. Then add what your storage provider will charge you for storing and serving the files. Offloading saves money only when that total is lower than what you pay now, or would have to pay to upgrade. See how egress fees work for the part that's easiest to miss.
What if the disk is full right now?
A full disk can stop uploads and even break logins. Clear backups or logs first to get some room. Don't start a big move on a server with no free space.