We get rid of garbage on the hosting - delete unnecessary files in the Uploads folder. WordPress plugin for optimizing your media library How to remove unnecessary thumbnails

When a website is just being created, at the initial stages the webmaster may be dismissive of the disk space on the hosting - after all, very little is currently occupied, about 10% of the space, and it will not be possible to reach the limit soon. And therefore, all sorts of unnecessary pictures are loaded (what if they come in handy), or of too high quality, unoptimized (just as beautiful!) or the same images (oops...).

However, once the site has been running for a year or two, its volume exceeds 90-95% of the allotted space on the hosting. And this mainly happens due to these unnecessary media files, which play absolutely no role, but take up a lot of space. And here there are two options - buy more expensive hosting, with more space, or delete these files. The second method is obviously more profitable. And in this article we will tell you how to make it also smart - after all, you can’t delete all unnecessary pictures manually. There is a WordPress plugin for this.

WP Media Cleaner

The WordPress plugin WP Media Cleaner allows you to remove all unnecessary media files from the site. It works simply - after installation and activation, the plugin will scan the entire wp-upload folder (where all images are stored) and identify those images that are not used in any of the posts.

To install this plugin for WordPress, you need to download it from the developer’s website or from the admin panel, entering its name in the search. Read about installing the plugin. After activation, the WP Media Cleaner sub-item will appear in the “Settings” item. Everything here is in English, and there is no Russian version, but there are only two settings, and both need to be enabled - just check two boxes for “Scan Media” and “Scan Filter”.

To use this plugin to remove unnecessary media files, now go to the “Media files” item and the Media Cleaner sub-item. Press the “Scan” button and scanning will begin, after which the page must be refreshed. And then you will see a list of all files that can be deleted.

Don't rush to delete. No matter how good this plugin for WordPress is, you cannot completely trust it. It is so automated that its operation must be checked by a live human eye. You should look through all the images found that are “unsuitable”, according to the plugin, and tick those that are really needed. Perhaps the plugin identified as “junk” those pictures that were used in some non-standard way in the post.

And only after you have looked through all the pictures yourself and highlighted the unnecessary ones, you can delete them by clicking on the “Delete” or “Delete All” button if you need to delete all files. But here this plugin for WordPress has protected us - all files are deleted to the trash. And if suddenly you did something wrong, you can restore them. And to delete media files completely, physically, you need to do this in the Trash section.

This plugin for WordPress has one big drawback. He considers thumbnail images as unnecessary, not attached to the post, if they are not used in the post itself, in the text. Therefore, be careful before deleting.

The second way of clogging with images is when deleting irrelevant posts on a blog, the images that were in the note are not deleted, but remain in folders on the hosting. Didn't you know about this? Now you will know that unattached images also need to be deleted. But, be careful, because not all unattached images need to be deleted; for me these are pictures in widgets, icons of various services and social networks.

If your site is still young and there are only a small number of notes and images, you can clean out the folder of unused images manually. Since I already have more than 100 posts, to remove unnecessary duplicate images I use a plugin, of which there are quite a few for the WordPress engine.

How to remove unused images on a wordpress website

If it’s difficult to manually delete unnecessary images, then install the “DNUI Delete not used image” plugin.

To do this, go to the site’s admin panel, plugins => enter the name of the plugin => find

After that, select the plugin we need and install it, then activate it.

After that, go to the settings section and click DNUI, then click on SCAN DATABASE at the top:

As you remove unnecessary images over time, the entire page will be filled with used images (“use”), which cannot be deleted and there will be no room for new ones, then click “Next” at the bottom and you will see the next page.

I thought it would be much faster to do this, but I had to “sweat.” I deleted everything unnecessary manually, you can use the automatic deletion of all images not attached to posts. Don't forget about the settings ("Option") at the top in the plugin settings, I set 100 images per page and started with 1 post, you can go from the end note and move gradually to the initial posts.

The algorithm is simple - select the unnecessary ones, then delete them (“Delete all selected”) and so on until the bitter end. The plugin in the settings suggests creating a backup in the settings, but I was better off creating it through the hosting.

While I was deleting a bunch of unnecessary pictures, I remembered the words that used to begin any fairy tale: “The fairy tale is told quickly, but the work is not done quickly,” you can’t say it more precisely!)))

When opening a new sheet with a list of images, I put a tick in the checkbox opposite “Name” and all unused images were highlighted with ticks, then I ran down through them all and then deleted them, this is easier than putting a tick in each box, the mouse will get tired)

Once you remove all unused images on the site, the file size will be significantly reduced.

As you can see from the screenshot above, image deletion operations helped the blog “lose weight” by 20 Mb (about 1000 files), the result is not bad, I think that for many the numbers will be higher.

Please note that immediately after deleting the images I did not see that the blog began to weigh less, the hosting had the same numbers as before deletion, but the next day I saw the difference) I don’t know what this is connected with and how it will be in your case. I also logged in via an ftp client and manually cleaned up duplicate images with the sizes I had previously set in the settings.

Do not forget that before placing pictures or screenshots in site notes, they must be optimized and their size should not exceed 50Kb. Otherwise, the page loading speed will increase greatly and your readers will not like it, believe me.

Now I present the next crossword puzzle of the Erudite-4 marathon

Crossword No. 6 “Drawing” of the crossword marathon “Erudite-4”

Let me remind you, friends, that this is another crossword puzzle of the Erudite-4 marathon, in which 5 crossword puzzles have already been released and we are entering the finish line. In addition to the published crossword puzzle, there will be one last one, which I will publish in the next post and then I will summarize and announce the results of the marathon.

So, click on the picture and solve the crossword puzzle.

Click on the crossword and start solving it

Now we compete in speed and send the guessed keyword to support:

>> Submit keyword<<

If you have any questions about the topic of the note, write in the comments, we will solve them. Regarding the crossword, if you have any questions, please ask.

See you!

Interesting notes

Uploading too many files results in your media library becoming cluttered with unused files, or the files you use are not optimized. Another common problem is the presence of identical media files.

You can solve the problem manually, but this approach is tedious and will take a lot of time. There is another way out - use a plugin WP Media Cleaner.

This plugin perfectly performs its tasks and does not load the system. But do not forget that its main purpose is to delete files, so you should use the plugin carefully.

Using WP Media Cleaner correctly, you can reduce the size of the uploads folder several times by optimizing the necessary files and deleting unnecessary files.

The plugin works as follows:

  • checking the attachment of the physical file to the blog media library;
  • the use of the file in the recording is checked;
  • The use of a multimedia file in any of the custom fields of the record is checked.

In addition, the plugin will check if the file is in the blog post gallery and if the retina media file has a duplicate in the regular format.

If a file does not meet any of the check points, it will be flagged and can later be removed from the library.

Working with the plugin.

First, download WP Media Cleaner (can be installed in the admin panel). There is no Russian translation, but there are minimal settings.

We activate the plugin and open its settings, where you need to check all the boxes:

Go to the page Media files -> Media Cleaner and click on the “Scan” button. The plugin will search for files and show the result:


If the file is necessary, mark it as ignored by clicking on the “Ignore” button. We move unnecessary files to the trash by selecting them and clicking on the “Delete” button.

The plugin deletes files not into the standard trash, but into a separate wpmc-trash folder, which will be located in the uploads folder. To completely delete files from the server, you need to open the recycle bin and delete files in the standard way. Here you can also recover deleted files. The restored file will not appear in the media library, although it will be physically restored.


An important point - after clearing files from the media library, you may need to manually delete the wpmc-trash folder located in the uploads folder.

This article is about how to remove unused images on a WordPress site. The fact is that by default, WordPress generates several images at once when uploading just one image. The sizes of these images are set in the site management console in the “Media files” section. Some webmasters recommend removing these settings - that is, setting the thumbnail sizes to zero, but this is not recommended. This will make it difficult to insert images into articles (only full-size images will be inserted).

There are also craftsmen who found the plugin DNUI Delete not used image and they recommend installing this particular plugin to remove unattached images. After testing this add-on, I had to restore the site from a backup copy, since the pictures that were in the post thumbnails disappeared. To search and delete images that are not associated with any post or page on the site, it is recommended to use only one plugin - Cleanup Images .

Cleanup Images plugin

In the WordPress media gallery, there is a filter that allows you to remove unused images:

Many also recommend deleting them, but you should think twice before doing this. It is possible that the images were downloaded and inserted into your posts via direct links. It is possible that a special design was used for the insertion - and in this case the engine will show the picture as not attached. So think twice before deleting these images.

All problems will be solved by the specified plugin Cleanup Images .

Installation

Installs like a regular plugin via the menu "Plugins""Add new".

Setting up and using a plugin to remove unnecessary images

After installing the plugin, go to the section "Settings""Cleanup Images":

There is practically nothing to configure; you just need to specify the number of found unused images that will be displayed on the page. You can also specify in what order to sort the found results: new added pictures first Date Added descending (last added first) or old Date Added ascending (first added first):

    Why fence a garden? There are no words. Just set the photo sizes (settings-media files) to zero and you will be happy - no photos four in a row. The entire Internet is filled with pseudo-tips like this, and then they complain about bad Word.

    A post “about that” itself, I’m trained to read. All such lessons are intended for beginners and have little relation to actually operating sites (the GS that have flooded the Internet do not count).
    For a beginner to get into all this jungle is to kill the site. IMHO.
    For the advanced, all the necessary information is here - http://codex.wordpress.org/ (there is also one in Russian, but not much).
    Previously, when my hands were getting hairy, I did this rubbish with photos; there is a plugin for inserting snippets for functions.php. And he played around with themes... oooh... just amazing what he set up. And then I realized, !WHAT! ? Apparently, you understood this too, the theme is very minimalistic and logical.

    I repeat - set up the above in the menu and you will have TWO photos, the one you uploaded and the one that will be shown on the page.. but... this is if the image is large (VP optimizes it), if the photo is small (for example 20 kb) and the size is small (height and width), then it will be ONE! It's TESTED.

    And it’s even easier, if there is no need to enlarge when clicking on a picture, post photos using links. It is not necessary to upload it to a photo hosting site. Why is it easier to make another website and tightly close the entrance to it for everyone and post photos on it?

    ps: for the vast majority of fans, a couple of dozen plugins, a dozen snippets and a default theme will be enough. I just set myself the last one, 2015... - this is an orgasm, not a topic.
    The main part of the design can be completely adjusted with the color of the site and photographs...

    • Let’s say you have 1000 images on your website in folders by month + 3 thousand of their duplicates that are not used.
      The post is about how to delete these copies automatically.

      I repeat - set up the above in the menu and you will have TWO photos

      What you described works superficially, I don’t remember now what exactly, but I know for sure that there were some bugs with it.

      All such lessons are aimed at beginners and have little to do with real-life sites.

      This particular post is for everyone. Since you are a clear example of the fact that a person who already understands WordPress does not know everything either (no offense intended).

      For the advanced, all the necessary information is here - http://codex.wordpress.org/

      The official code is specifically designed for beginners. Russian speakers don't count at all. The only thing you can find is interesting solutions on their forum.

    Well, first of all: calling me a person who understands Word would be an exaggeration, and probably a big one. Experienced user, here is the exact definition. For example, of what’s in your portfolio, I could probably repeat half, or a little more than half.
    Code - a beginner will not understand anything there at all, it is for beginners who are studying professionally (I don’t know how to write correctly), who do not wander around such sites (no offense :) your site is quite adequate and there is little to complain about ).
    About photographs - for a completely dense user, and this lesson is designed for such people, it’s easier to delve into the settings, the site will definitely not be worse. I don’t rule out that such a variant has a flaw, but... it works, so what else? And about sites with a thousand photos and still not optimized.... this is the so-called. There is no point in editing them; it is better to demolish them and let their owners learn how to make normal websites. And in the end, if you clean it once, you can erase it through hosting, and clean and configure the database... this is all done through the admin panel... although a plugin is an even better solution, installed it, used it and threw it away // if the plugin normal, then you can leave it, because it is well known that a high-quality plugin does not carry any load at all (well, only if the code grows in size, but this will also happen from direct placement of pieces of code in the engine //.
    Based on my rather rich experience, I say: there is no point in getting under the hood without a theory. It’s better to let them turn to programmers, for example, to you, and he will do everything for them, and for a separate fee he will write instructions on what he did and how he did it and how to configure it without him, including under the hood.
    For others, I repeat: a couple of dozen plugins (including Jetpak, it has CSS control) and a plugin for snippets, and a dozen snippets for it. Yes, a normal, no-nonsense topic. Here you can check _http://themecheck.org/, I achieved 100% on the default and their child themes. By the way, very good. many themes, including premium ones, do not score even 50% there, often ZERO.
    Yes, such sites are not hung, like Christmas trees, with various toys, but they have undoubted advantages - they work perfectly and do not require constant intervention from the owner, just add photos and texts, and once a week, 15-20 minutes for maintenance.

    Good afternoon Please tell me how best to solve this problem:
    The site has about 25,000 images, some of them are miniatures, some are original images and some are from various plugins
    The problem is this:
    from all this rubbish, 2/3 of the thumbnails are used, sized 50x50, 292x164, which are created by the theme from the originals loaded by plugins, thumbnails from the first image, “poster” videos from YouTube and popular posts; in the future, after downloading, I don’t need the originals and they weigh a lot
    When you delete it manually, a bunch of 404 errors from search engines appear in the logs. As I understand it, they follow these plugins created by SEO
    Is it possible to massively replace the original, for example with this size 292x164?
    Or maybe there are some other solutions?
    those. The goal is to save space, get rid of original images and 404 errors

Share