11
dec

Saving, cleaning, and maintaining hosting space

When we create and publish a website, and use e-mails, it is inevitable that, after a certain time, we will run out of disk space to store new images, e-mails, and other site files. Depending on how the site is maintained, we may have to move to a bigger hosting package, but certainly, before that, we can check if there is any possibility to organize our hosting, find and delete files we don't need, and thus free up disk space.

You can view the site files using an FTP client or the File Manager application if you have a cPanel on your hosting.

Чишћење хостинга

 

Site themes, plugins, and addons

Check which theme and plugins you are using. By removing themes and plugins that the site does not use, you will not only save disk space, but you will improve the security of the site and save the time needed to update the site. All themes and plugins on the site need to be updated regularly, regardless of whether they are active or not.

Site security is improved by reducing the number of themes and plugins because you have fewer files on your site that could have security flaws.

Make a backup copy of the site before removing files from the site, that way you will ensure that you have a copy of the site in case you delete some of the files that are still necessary for the site to work.

 

Control of error_log files

Site errors are written to error_log files. Depending on the server settings, usually, the error is written to the error_log file located in the directory where the file with the error is located.

Depending on the number of errors in the files and the number of visits to the site, there is a huge possibility that the error_log file will take up a lot of disk space. Every time a visitor visits the page where the error is found, the error data will be written to the specified file, so the file can grow to several megabytes or hundreds of megabytes, and can even be in gigabytes in more extreme cases.

Before removing the error_log file we need to investigate the problem and fix the errors to prevent new errors from being written after we remove the error_log file.

 

Backup copies and backup files

It is extremely important to make backup copies of the site, especially before updating or other changes to the site files.

There is no need to store backup copies of the site on hosting, you can download them to your computer, which is also recommended. For example, in case a problem occurs on the server ie. hosting, you won't have to worry since you have a backup copy on your computer.

These files can be extremely large because they can contain all site files, databases, and e-mails, so saving backup copies on your computer frees up an extremely large part of the space on the hosting, i.e. disk.

 

View using the cPanel Disk Usage application

A great cPanel application that helps a lot to find out what is using storage space is Disk Usage. As soon as you open the application, the first thing you will see is a list of folders and how much each folder takes up. For a better visibility, you can set the directories to be sorted according to their space consumption. At the bottom of the page, set "Sort directories by" to the Disk Usage option, that way the directories will be sorted from largest to smallest.

When you click on one of the directories, it will open in the File Manager, so you will be able to immediately view the files and determine whether you can delete any of them from the hosting or download them to your computer if they are not needed for the site's operation.

 

Empty the trash

Many people when deleting files using the cPanel File Manager application, do not actually delete the files, but just move them to the Trash folder. When deleting files, don't forget to tick the option "Skip the trash and permanently delete the files", otherwise you will just move the file to the Trash folder and the file will still exist on the hosting, it will not be permanently deleted or free up disk space.

 

Skip the trash

 

These are safe ways to check and maintain hosting disk space, so even less experienced users can get by. If a new tool or feature for maintaining disk space appears, I will add it to this article. I didn't mention e-mails as one of the possibilities to free up disk space, if you know how, you can download e-mails to your computer and remove the old ones from the hosting.

Author: Aleksandar Vranešević
Published: 11.12.2022.
Updated: 11.12.2022.