Optimize, Clean, and Reclaim Disk Space to Ensure Efficient Performance and Seamless Maintenance of Your WordPress Website.
Why does your WordPress blog take up more disk space and what can you delete? If you can delete things from homedir/tmp and homedir/public_html/wp-content/cache when you notice that they have just increased the disk space occupied by your WordPress blog. When I moved from hosting abroad, the backup archive of my WordPress blog was about one gigabyte, and after a day of hosting in my country, it increased to one and a half gigabytes.
Since things don’t grow overnight, like Prince Charming, and I pay attention to everything that moves around here because I don’t like to download backup archives larger than necessary, I looked to see what it was.
I knew that I didn’t even have a cache plugin activated because at the foreign hosting, it still worked to use Cloudflare for such purposes, not just as authoritative DNS, like now.
Not knowing what it was from, I looked to see what had increased because in the archive, things are compressed, and they occupy even more unnecessary space on the disk, and I noticed two things: some smaller things in homedir/tmp and some larger things in homedir/public_html/wp-content/cache.
There is no need to delete the files from homedir/tmp yourself, especially since they can be used by things you have on your blog, such as plugins. They are automatically deleted at the next server restart, so it is not good to meddle there if you don’t know which programs create those files and if they are being used at that moment.
As for homedir/public_html/wp-content/cache, which is the stuff that takes up the most disk space, they were added by an optimization program from cPanel, by the guys from the hosting. I didn’t need automatic compression or shrinking of files on the blog because I was doing it manually to see exactly what and how, so I deleted the contents of the cache folder.
I deleted everything from there, and things returned to how they were before: a one-gigabyte backup archive.
Pay attention: if you have a cache plugin activated on your WordPress blog, do not delete the contents of the “cache” folder because, for example, W3 Total Cache, which I’m using now, creates temporary static files (HTML) for recently accessed articles, with the idea of serving them faster. Those temporary files are automatically deleted, so you don’t have to worry if the content of the “cache” folder has increased significantly for a certain period of time. It will be emptied automatically after a certain period of time if those articles are no longer accessed.
Most of the time, this sudden increase in the “cache” folder occurs due to aggressive crawling bots that access all the articles on your WordPress blog within a short period of time. That’s why the disk space occupied by your site doubles for a certain period of time until the “cache” folder is automatically cleared.
Files in “tmp” are automatically deleted at server restart, so there is no need for you to mess around there, and files in the “cache” folder can be deleted or not, depending on what I wrote above. It depends on the case.
These are the things that can suddenly increase the disk space occupied by your WordPress blog.
If you didn’t understand something, feel free to ask below in a comment.
Question for our readers: What strategies do you use to manage disk space usage on your WordPress blog?