Step 1: Take a Backup
You should never do anything to your site without first taking a backup. If this rule is not already firmly drilled into your head, make sure that it is before you proceed.
With the above said, I strongly recommend that you take a manual backup of any files that you will be editing or removing during this process. You may not know what those files are yet so this step is something to bear in mind throughout the process rather than put into action right now. Just remember: for each of the following steps make sure that you take a backup before making any changes.
You will need FTP access to take backups and carry out some of the following steps. If you’re not set up with an FTP client yet I recommend FileZilla (for both PC and Mac). You can get the FTP login details from your hosting provider.
Step 2: Remove Redundant Themes and Plugins
Let’s start with the basics. There are two things that you should know about deactivated themes and plugins on your WordPress dashboard:
- They take up unnecessary space
- They represent a security risk (your site can still be breached via deactivated themes and plugins)
That’s two good reasons to get rid of deactivated themes and plugins. I would also recommend that you take a close look at your activated plugins and ask yourself whether you really need all of them. It could well be that the functionality present in two plugins is actually covered by one (for instance, WordPress SEO by Yoast includes XML sitemap functionality, therefore negating the need for a separate XML sitemap plugin), or that you have a bloated plugin whose resource intensiveness is not worth the added functionality. Use the Plugin Performance Profiler Plugin to single out the main offenders.
Beyond mitigating the two issues above, removing plugins should also result in an increase in site speed, which is never a bad thing.
Step 3: Change Your Media Settings
The media files on your server probably account for the majority of your website’s bulk. This is to be expected, but WordPress is particularly notorious for creating various duplicates of the same file and making your media folder two or three times larger than it needs to be.
It comes down to image sizes, which you can define on your WordPress dashboard by navigating to Settings > Media:
With these three image sizes defined, WordPress creates three separate image files in addition to the version you upload. That’s four images for each file you upload of which you may only use one.
You probably don’t need more than one size of a particular image, and if you do, you’d probably be better off uploading them in their respective sizes (so that you have control over cropping etc). And that is precisely my recommendation — start uploading images in the correct size and dimensions so that you do not need to do any fiddling on the WordPress side.
But what about those pesky image files that WordPress creates? Simple — just change the Max Width and Max Height fields to zero in the Settings > Media screen and WordPress will no longer create them. This may have adverse effects depending on how your theme is set up so I would advise that you take a backup and experiment before committing.
A final tip is to use a lossless optimization plugin like WP Smush.it to reduce the size of your image files when they are uploaded. It’ll only take a minute to install and activate the plugin and from then on it in it will do its job without you having to lift a finger.
However, in this case you should make sure that only one backup is being kept and that duplicates aren’t piling up over time. The tool should be excluding that backup folder from being included in the regular backups (as ManageWP does), which negates the size issue.
Step 5: Remove Random Files
There are plenty of things that may appear on your site’s servers that simply don’t belong there. One personal example I have is “core” files (e.g. a file labelled “core.129483”) — an issue that can arise occasionally. These files (which are actually core dumps) can be upwards of 100mb each and appear in droves, yet they shouldn’t be there at all. You can safely delete them and should also inform your hosting provider of the issue so that they can resolve it.
As a rule of thumb, any file that is particularly large should be viewed with suspicion. As I said previously, there are few times when a website will utilize a large file. I am not however suggesting that you should start deleting large files willy nilly — it pays to be sure that what you are deleting isn’t conducive to the running of your website, even if you do have a backup ready should something awry happen. If you do find something suspicious then turn to Google or the WordPress support forums for help.