How to address duplicate images problem in WordPress

By default, all images uploaded into the WordPress content folder have a specific number of duplicates (different sizes). Additionally, some templates and plugins also could generate previews of the same images, some needed, and others made just in case. As a result, the number of duplicates may exceed ten images.

 

Read more WordPress related posts:

How to Fix 404 Errors in WordPress After Changing Permalinks

The Many Uses to Which You Can Put Your WordPress Website

Top 5 Security Issues with WordPress and How to Fix Them

WP Rocket WordPress optimization tutorial

What you should know about optimizing your WordPress website for speed

WordPress Search Engine Optimization Tutorial

WordPress Security Plugins

WordPress Website Speed Optimization Tutorial

WordPress image optimization tutorial

How to Fix a Hacked WordPress Website

How to Fix the ERR_CONNECTION_TIMED_OUT Error in WordPress

How to Improve the Security of your WordPress Website\

In case your WordPress site has a large number of photos or images, there could be some problems with the lack of disk space on the host after a while (if it’s not unlimited, of course). This post is to show you how to prevent unwanted image duplication.

We are going to cover:

  • Why Is it Bad to Have Duplicate Images?
  • Where Do Those Duplicates Come From?
  • How to Get Rid of the Duplicates?
  • Contact us for Help

Why Is it Bad to Have Duplicate Images?

Unlike page duplicates, image copies would not cause any harm to your WordPress site. What they do is to take up more space on your hosting account. Luckily, most web hosting providers provide considerable storage. However, sometimes, the storage might not be enough.

Extra duplicates of images are generated after all image uploads. After being uploaded, the image is duplicated in different sizes. Thus, in any blog post, we are loading up to 20 images. If you are not using optimized photos and images, sooner or later the disk space that your hosting provider gives you could evaporate in the blink of an eye.

Duplicate images affect the size of a backup copy of your WordPress website. In case you create the backup copy of your site in the cloud storage, or if you use some plugins, they should work with a large volume of information, which is why errors may occur.

If you find out that some image sizes are not used on your WordPress site, we advise to switch off duplication of images of this specific size. This way, you will potentially save some disk space.

 

Read more WordPress tutorials:

How to modify search features of your WordPress website

7 Security Tips for a WordPress Website

Basic Guide to WordPress Security

Configuring the basic settings in your WordPress website

How to Backup Your WordPress Website Automaticaly Using Backup Plugins

How to Backup and Restore the backup of a WordPress Website

How to Create Redirects in WordPress

 

Where Do the Duplicates Come From?

Before you begin fighting duplicate images, you should know how many copies are generated from one uploaded image. By default, WordPress generates three images of different size (thumbnail size, medium size, and large size). Some templates could generate extra dimensions to create their thumbnails for sliders, or other functions.

To find out the number of additional copies that are generated, log into your FTP client, and open the directory /wp-content/uploads/.

How to Get Rid of the Duplicates?

Removing all duplicates is not always a good idea. Even if you decide on removing the unwanted images, it would not be guaranteed that they will not appear again. When talking about the WordPress engine, there are specific settings that can actually prevent the generation of any unnecessary image sizes. If you want to do this, go to Settings ? Media. After you go there, you need to reset all sizes.

Read more WordPress tutorials:

How to control new user registration in WordPress

How to create a simple portfolio website with WordPress

How to create and manage a page in WordPress

How to enable SSL on your WordPress website and move from http to https

How to enable and disable pingbacks and trackbacks in WordPress

How to safely disable the WordPress automatic update feature

How to update your WordPress installation

Once you reset these figures, you will be able to insert into images of the highest size into the post. Later, you can adjust the size by changing the width value in the editor. You may have other sizes by default. Therefore, when an image is loaded, WordPress would automatically generate it in different sizes. The larger the size of the download, the more duplicates will exist. So, if you upload an image of 600 by 600px, larger-sized duplicates would not be generated. Consequently, the smaller the size of an uploaded image, the smaller the number of doubles created.

By now you have probably visited your content folder and counted the number of duplicates. In case you want to get rid of them, you have two options. Either do it via the File Manager in cPanel or use a plugin. We advise that you go with the first option since it will not require any installs. However, If you choose the second option, we recommend using a powerful WordPress plugin called Image Cleanup WordPress plugin.

This plugin does some great work for your images, like:

  • Saving your space that’s taken up by unreferenced/backup images;
  • Fixing incorrect metadata (sizes);
  • Having a bulk repair/delete functionality;
  • Adding pagination for extensive result sets.
  • Logging tabs that are easily visible for review;
  • Showing detailed information in log tabs;
  • Having full restore functionality.

In case you are not using additional thumbnails, you can disable this functionality in the template itself. You will get rid of a large number of duplicates.

Do not forget to upload images which are optimized for the web. Try not to use the built-in WordPress function for photo editing, since it also makes duplicates and can eventually cram up your disc space.

 

Read more WordPress tutorials:

How to Fix 404 Errors in WordPress After Changing Permalinks

The Many Uses to Which You Can Put Your WordPress Website

Top 5 Security Issues with WordPress and How to Fix Them

WP Rocket WordPress optimization tutorial

What you should know about optimizing your WordPress website for speed

WordPress Search Engine Optimization Tutorial

WordPress Security Plugins

WordPress Website Speed Optimization Tutorial

WordPress image optimization tutorial

How to Fix a Hacked WordPress Website

How to Fix the ERR_CONNECTION_TIMED_OUT Error in WordPress

How to Improve the Security of your WordPress Website

WP Rocket WordPress optimization tutorial

How to Fix WordPress Login Page Refreshing & Redirecting

How to create table of contents in WordPress posts

How to Embed Videos in WordPress

 

Plugins For Image Cleanup

WordPress’ Media Library is quite intuitive, which is beneficial for even the most experienced users. However, you may find that you need a bit more help when it comes to Media Library management. Here are three WordPress plugins for image cleanup that you may find useful.

Media Cleaner

Media Cleaner is a simple plugin, but one that makes the removal of unused media files simple. Once installed, this tool will add all files not being used on your website (such as in posts, pages, or galleries) to a temporary trash bin. You can then look over the files to be sure you want to delete them, and make their removal permanent.

WP-Optimize

WP-Optimize offers many features related to cleaning and optimizing your website’s files. Specifically, you can set the plugin to automatically clean out ‘orphaned’ images or images set to certain sizes. Additionally, you can configure an optimization schedule that fits your website.

WPS Cleaner

WP Cleaner is a multi-function website cleaning plugin. However, it does have specific media-related features. For example, you’ll be able to review the total weight of your media files. Additionally, the user-friendly dashboard can help you identify unused media files and delete them in bulk or individually. WP Cleaner will also identify and include media added through any major page builder plugin.

 

How to Manually Clean Up the WordPress Media Library

If you want to forego adding another plugin to your website, you have another option. You can clean up your WordPress Media Library manually.

Before doing so, it’s a good idea to back up your website. This can be done with a plugin such as BackUpWordPress:

You can also back up only your Media Library via File Transfer Protocol (FTP). Simply download the wp-content folder from your site’s server, and save it in a safe location (such as in cloud storage).

Once you’ve preserved your current website’s content, you can begin to clean out and delete the files in your library that you no longer need. This can be done by going to Media > Library in your dashboard. To delete a single image, click on it and then choose the Delete Permanently option at the bottom of the screen:

A popup will appear, and clicking on OK will remove the file from your Media Library.

You can also bulk delete files and images, which is a quicker way of managing unused media. From the Media Library page, click on Bulk Select at the top:

Click on all the files you’d like to delete, and choose Delete Selected. Then select OK to permanently remove those images:

It’s not uncommon to ‘collect’ files over time that aren’t necessary. This is why you should repeat this process at least every other month (although the more frequently you complete it, the better).

If you choose to delete your files using the dashboard as described above, you’ll also want to double-check them using FTP. Depending on how they were added, some images may still be hanging around on your server, so it’s important to make sure they’re removed for good.

 

Contact us for Help

In case this post didn’t help you solve the issue on your own, feel free to submit a support ticket. Our team of technical support experts works 24/7. You can be sure that they will assist you with everything hosting related.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to Keep Your WordPress Website Updated

Updating your WordPress website is good for its security, content and data integrity and also for...

How to Install and Setup Your Premium WordPress Theme

WordPress is an excellent web development tool and still remains the most popular content...

How to create and manage a page in WordPress

Creating pages in WordPressCreating individual pages in WordPress is quite similar to writing a...

WordPress Search Engine Optimization Tutorial

Wikipedia defines Search engine optimization (SEO) as the process of affecting the online...

How to Secure a WordPress Website

How to Secure WordPress with Unique Admin UsernameMost applications use "admin" as username and...