We release a place on the hosting, delete unused images. Get rid of garbage on hosting - We delete unnecessary files in the Uploads folder Plugin WordPress Delete unnecessary image files

Sooner or later they will have to pay for negligence and waste. Now I mean a negligent relation to the order in the site files and frivolous use of disk space. Perhaps many familiar situations: when the files in the media loaded illiterately, or they were not optimized, or the downloaded photos were not used in the articles, or several identical photos were downloaded, only one of which was used on the site. Such errors, from frivometry or ignorance, lead to the fact that the site files begin to occupy a lot of space on the disk.

So I recently faced a similar problem, partially solve the plugin Media Cleaner helped me. I liked the plugin, so I write about him. The plugin is not bad and performs its function. However, I do not recommend using the plugin without an acute need - it still deletes files. In addition, I found some flaws in it, which already unsubscribed the author - little things.

As for my problem, I have been working on the "patient" about the day, it was possible to reduce the size of the Uploads folder from 1200MB to 150MB and all by removing unnecessary and optimizing the desired pictures. So you will be alert, do not let the files on the sample, unless you do not have free hosting.

Together with this article I recommend getting acquainted with my plugin to create a thumbnail chart: Kama thumbnail. With it, you can create miniatures of any sizes, only where they are needed, and the dimensions that "walk" WordPress simply disable.

About the plugin Media Cleaner

Media Cleaner - helps to clean the download directory (Uploads) and library of media files.

What makes the plugin specifically? Plugin checks if:

    the physical file is attached to the library

    media file is used in record

    media file is used in an arbitrary recording field

    media File Used in WordPress Gallery Records

  • at retina media file (under the retina screen) there is a regular file (file without @ 2x)

In case of incomprehension with the specified checks, the plugin will mark the found files that can be deleted in the future.

What items need to be checked is set in the settings of the plugin.

Using plugin

I will describe briefly as the plugin works:

After activating the plugin, go to the settings of the plugin (menu will appear) and mark how we want to scan files:


Media Cleaner Scan Settings

Then go to the Media File\u003e Cleaner page and run the scanning - the "Scan" button. After scanning you need to update the page and you will see the files found:

Files required on the site, you need to mark as ignored: Highlight the files checkbox and click the "IGNore" button. All other files that are not needed on the site can be moved to Cart (TRASH): Select unnecessary files checkmark and click "Delete" or click "Delete All", then all files found will be moved to the basket.

Note: When moving to the basket, the plugin creates a new folder: / Uploads / WPMC-trash and the files deleted are moving there. Structure Year / Month / File Name Save. The type of media files (files that are present in the library) are removed from the library, and the physical files are moved to the "WPMC-TRASH" basket folder.

To completely delete files from the disk (from the server), you need to go to the basket, Trash section and use the buttons: "Delete" (delete selected files) or "Empty Trash" (will delete all the basket files).

In the same section, you can restore files by selecting. To do this, use the "Recover" buttons (restore selected files) and "Recover All" (restores all the basket files).

Note: Remote Media Files are restored only physically, i.e. The file will be restored to the Uploads directory from which was removed, but in the library it will not appear.

Keep in mind before use. The plugin highlights files that did not find in the media library, or in the content of the record, or in arbitrary recording fields, or in galleries. These checks may not take into account other points, for example, if loaded to the liboke or directly to the Uploads directory files are used. If you download and use files outly standard, for example, pictures for headings you download to the library and do not use them in the records, but these files are used in the template as pictures to the headings. Such files, plugin deemed unnecessary. Therefore, before removing files from the disk, make sure that the files selected to delete are not used on the site.

Critical assumption: If you are using standard WordPress thumbnails, while you install the recording thumbnail and the picture is not used in the recording itself, the plugin will consider such a picture of unused!

Note: After deleting (uninstalling), the plugin does not delete the Kesha folder (WPMC-TRASH) in the Uploads directory. Therefore, perhaps this folder will need to be deleted manually.

Errors in the plugin

After deleting, the plugin does not delete its options from the WP_Options table. A frequent error of the authors of plugins ... This moment I corrected, the version corrected by me can download this link. I hope the author will hear my comment and in the next release will correct this moment.

There is a WordPress engine one feature for which few people pay attention. Especially when only begins to keep a blog or site on this engine.

What's the point? When initial settings, at the moment you publish an article with images, WordPress automatically creates a duplicate of all these images with defined sizes. It turns out interesting arithmetic. You add one image, and in the daddy Upload 4 images appear. And so every time.

In principle, there is nothing catastrophic here. Well, adds it and let him add. If your hosting place is not limited, in principle, you can not bother. But, as practice shows, most sites are located on tariffs with a specific sizes size for files. And here, it may happen a very sad picture when the places begins missing, and it is not possible to immediately deal with the situation.

These doubles, during the years of site maintenance, a decent amount can accumulate. Moreover, let's understand in this folder, which image is used in the articles and output, and which is not. How much time will need to shove everything and remove the desired one.

DNUI - unnecessary image removal plugin

This is where the plugin is useful. DNUI. The name consists of capital letters of text DELETE NOT Used Image - Delete not used images. Plugin proven, proven itself, as a stable and reliable tool for cleaning the folder Upload.

Setting plugin DNUI

Everything is simple and understandable. But, before you begin to remove, you need to progress. Make a database backup. There is a plugin for this. wordPress Database Backup., Hoster panel, or through the phpmyAdmin panel - here, someone like how much knowledge and desire allow. It's much easier to have a backup speed at hand than then break your head, how to restore hundreds of articles in the right form.

  • Now we go to the search and find the plugin DNUI.Swing, install, activate.
  • In the panel Parameters We find the plugin and launch scanning. Number of files for checking install no more than a hundred, the process will go faster.
  • The images that anywhere and never on the site are not used on red are highlighted.
  • Click buttons Select all. and Delete. and get rid of unnecessary files.
  • The procedure continues the button Next as long as in the folder Upload The desired order will not be posted.
  • Then the DNUI plugin can be disabled and deleted.

So, it is easy and simple, you can free the place from unnecessary files on your hosting.

And in the future, so that the situation is not repeated, it makes sense to change the settings of the WordPress engine itself. In the tab ParametersMedia File Slip the desired dimensions, or, generally remove all the numbers and checkboxes, if there is no need.

This is an article on how to delete unused images on WordPress. The fact is that by default, the WordPress generates several pictures at once when loading just one image. The dimensions of these images are specified in the Console of the Management Console in the Media File section. Some webmasters recommend to delete these settings - that is, it is not recommended to make the size of the thumbnail of the thumbnail. This makes it difficult to insert images into an article (the image will be inserted only in full size).

There are such craftsmen who found plugin DNUI DELETE NOT Used Image And it is recommended to set this particular plugin to remove not attached images. After testing this supplement, I had to restore the site from the backup, as pictures that were in miniatures of records disappeared. To search and delete images that are not attached to any record or site page, it is recommended to use only one plugin - Cleanup Images .

Plugin Cleanup Images

In the Gallery of Media Files WordPress, there is a filter that allows you to remove not used images:

They are also recommended to delete them, but it is worth thinking before doing it. It is possible that the images were loaded and inserted by you in records by direct links. It is possible that a special design was used to insert - And in this case, the engine will show the picture as not attached. Therefore, think about several times before deleting these images.

All problems will solve the specified plugin Cleanup Images .

Installation

Installed as an ordinary plugin through the menu "Plugins""Add new".

Setting and using a plugin to remove not necessary images

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

You have almost nothing to configure, you only need to specify the number of not used pictures that will be displayed on the page. You can also specify in what order to sort the results found: first new added pictures Date Added Descending (Last Added FIRST) or old Date Added Ascending (First Added FIRST):

Loading excessive files leads to the fact that the media library is clogged with unused files, or the files used are not optimized. Another frequent 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 the plugin WP Media Cleaner.

This plugin perfectly performs the tasks in front of it and does not load the system. But you should not forget that its main purpose is to delete files, so it is worth using the plugin gently.

Using WP Media Cleaneryou can correctly reduce the size of the Uploads folder several times by optimizing the desired and removing unnecessary files.

The work of the plugin is as follows:

  • checking the attachment of the physical file to the library library;
  • checked the use of a file in the record;
  • it is checked using a multimedia file in any of any arbitrary entries.

In addition, the plugin will check if there is a file in the blog entry gallery and has a multimedia file for retinic duplicate in normal format.

If the file does not match any of the check items, it will be marked and later it can be removed from the library.

Work with a plugin.

First, download WP Media Cleaner (can be installed in admin). The Russian translation is absent, but also the settings at least.

We activate the plugin and open its settings, where all the ticks should be noted:

Go to page Media Files -\u003e Media Cleaner And click on the "Scan" button. The plugin will search for files and will show the result:


If the file is necessary - we mark it as ignored by pressing the "Ignore" button. Unnecessary files move to the basket, highlighting them and clicking on the "Delete" button.

The plugin deletes the files not to the standard basket, but in a separate WPMC-Trash folder, which will be located in folderuploads. To completely delete the file server, you must open the basket and delete files with the standard way. Here you can restore deleted files. The restored file will not appear in the library, although it will be restored physically.


An important point - after cleaning files from the library, it may be necessary to manually delete the WPMC-Trash folder located in the Uploads folder.