A WordPress website can quickly balloon and take up a lot of server space, which might increase hosting costs and slow down a website. It’s good practice to keep your website lean and running smoothly by cleaning it up occasionally.
In this article, we will provide a step-by-step process to reduce WordPress website size.
Where does WordPress store data?
WordPress stores data in the file system (in your www or public_html folders on your hosting), and the SQL database. Usually, the file system is the area that contains the largest portion of your website size. This is because your theme, plugin files, and images are stored in the file system.
How to check your website size
There are several ways to check the size of your WordPress website. Certain hosting providers have a size calculation right in their platform, you can also check using cPanel, or in the WordPress dashboard.
Check the website size in cPanel
If your hosting provider uses cPanel, you can find the WordPress website size in the dashboard when you log in.
Please note that this may include more than just your WordPress installation. It can include other files and email accounts if you are using cPanel emails. This figure also includes all WordPress installations and files that you are storing in the hosting environment.
Check the website size in WordPress
You can also check your WordPress website size in the WordPress admin dashboard.
Navigate to Tools > Site Health and expand the Directories and Sizes tab to get a detailed breakdown of the WordPress directories, uploads (media), themes, plugins, and database.
This is the most accurate representation of your website size. In the previous example, you will remember that cPanel also includes your emails and other files that may not be related to this particular website.
Why you need to reduce WordPress website size
While there is no limit on the amount of space a WordPress website can use, keeping your website lean can help with performance, and it will keep your hosting bill low and avoid issues. Although some hosting plans include unlimited hosting, most have a size limit that you will need to adhere to.
How to reduce WordPress website size
In the next few sections, we will give you several ideas on how to clean up your disk space.
Cleaning up images
One of the items that increase the size of the site the most is images, especially if they are not optimized and compressed. If you want to get rid of images that you no longer use, for example, some posts or pages are no longer active, the images will remain on the website.
We recommend this great tool that we have tested and it gave us exceptional results, called Media Cleaner by Meow Apps.
Don’t forget to make a full website backup before you start. Below we will show you how to use this plugin in a few simple steps.
1. Install the media cleaner plugin that you can find in the WordPress directory or download it directly from their site.
2. The setup is very easy. Check all the offer boxes, and in the pro version, an additional Live Content scanning option is available which can help identify images that are used in the content.
3. After setting this up, navigate to Media and select Cleaner. Click Scan and that’s it.
4. After the plugin has found all redundant images on your site, simply click on delete all. Clear the cache, and check the content on your site. If everything is fine and in place, go to Trash and empty it. The size of your site will be significantly reduced if you have a lot of unused images.
Cleaning up the database
WordPress uses MySQL as its primary database management system. Essentially, MySQL is where all the content of your WordPress site is stored. This includes your posts, pages, comments, and user information, among other things.
Think of MySQL as a vast library, and WordPress is the librarian that organizes and retrieves the books (or in this case, your website data). Every time someone visits your website, WordPress communicates with MySQL to fetch the necessary data, such as the post content or user comments and displays it on their screen.
Over time, especially for a large and older website, the database can get filled up with unused data and records. Therefore, it’s a good idea to clean up the database once in a while to ensure that your website is running smoothly and that you clean up unnecessary disk space.
Keep in mind that relative to your file system, the database will usually not take up as much space and is usually much smaller than the rest of the website unless you have a lot of post revisions or something else that might be taking up unnecessary space.
There are two ways to clean up your database, one is with the help of a plugin, and the other way is manually.
Manual WordPress Database Cleanup
Before you delete anything from the database, make sure that you take a backup because this can severely damage your website.
To manually clean the database, you will navigate to phpMyAdmin in your hosting, open up your database, and look for tables that should not be there to purge them.
You can also connect to your database using MySQL Workbench and make changes through that application.
Please note that cleaning up your database manually is both technically challenging and not recommended for novice users. A much safer way is to use a plugin to help you with this task.
Cleaning up your database using a plugin
Plugins that can clean a WordPress database are specially tuned to recognize which tables usually hold the most redundant data and are safe to purge.
Our preferred plugin to clean a database is Perfmatters. For more information on how this process works, you can review this article by Perfmatters.
If you are looking for a free alternative, check out the free plugin called Advanced Database Cleaner.
The only disadvantage of using a plugin versus cleaning the database manually is that a plugin will rarely remove unused or old plugin tables, but it’s still a safer method than doing this manually.
Cleaning and optimizing your WordPress database can significantly improve your WordPress performance, help you save server space, and reduce your website size.
Cleaning up the file system
One of the most common ways for WordPress websites to balloon in size is by adding or leaving unnecessary files in the file system.
This varies from site to site, but common files include old backup files, large log files (like PHP error_log and similar), and unused images and assets.
To identify these files, log into your hosting or FTP into your site and look for files that shouldn’t be there. Make sure that you take a backup before deleting any files.
cPanel also has a useful feature that lists large files by directory. To view these large files, log into your cPanel account, and navigate to Disk Usage. Scroll to the bottom until you see this section.
You can expand the folders and drill into the largest ones to find files that might be taking up a lot of space.
WordPress can also point you in the right direction. In your WordPress admin dashboard, navigate to Tools > Site Health. Open the Info tab and expand the Directories and Sizes section. This section will list all of the website locations and show you which ones are taking up the most space.
Find the files that are unnecessary and delete them from the file system to save space.
In this article, we tackled how to reduce your WordPress website size. We gave you tips related to cleaning up unused images, optimizing your database, and cleaning up the file system.
Many WordPress sites have too many or overly large images, which can slow them down. We provide tips for identifying and removing unnecessary images and suggest tools to remove used images from a website.
Next, we move on to cleaning up your website’s database. As your site grows, it accumulates unused data like old post drafts and deleted comments. We guide you through the process of clearing out this clutter, which can be done manually or with the help of plugins.
Lastly, we focus on tidying up your file system. This involves removing unneeded files such as outdated plugins, themes, and backups. Think of it as decluttering your website’s storage, making it more organized and efficient.
In essence, by starting with image optimization, then moving to database cleanup, and finishing with file system organization, you can effectively reduce your WordPress site’s size, leading to improved speed and performance, and also reducing your hosting costs.
We hope that you enjoyed reading about how to reduce WordPress website size. Our recommendations and techniques are based on years of experience helping businesses just like yours.
At Clio, we have helped many clients improve their speed scores. We have been developing websites and providing website maintenance services since 2006.
Contact us if you would like us to help you speed up your WordPress website.