WordPress.org

Ideas

delete unused image sizes

  1. Jam Viet
    Member

    12345

    So if we use this method, we have to recode to database all the time image query, so it can be slowdown the page ?

    Posted: 1 year ago #
  2. syrupcore
    Member

    12345

    Agreed. Core feature please. Can't even imagine how many files are in the uploads folder for a 6-7 year old site that updates the design every year or so!

    Here's a way to do it that considers whether or not the old image size is included in a post (spoiler, not trivial!): http://wordpress.stackexchange.com/questions/135969/how-do-i-delete-all-generated-images-from-my-server-except-those-currently-used

    As a precaution, wp could dump them all into /uploads/deleted and then use redirects/htaccess to check there if an image is requested that it can't find.

    Posted: 1 year ago #
  3. Beamer-Test
    Member

    I think there is a plug-in pretty similar to your idea.

    Posted: 8 months ago #
  4. OriginalEXE
    Member

    I wrote a plugin to overcome this problem, search for "Optimize Images Resizing" on plugin repository :)

    Posted: 8 months ago #
  5. Martin Hynek
    Member

    12345

    Well i think, that if images are created by WP core itself, it should manage them all the time, if they're not used, then core should delete them, not external plugin...

    Posted: 8 months ago #
  6. Well, if old image files are going to be deleted, then rewrite rules have to be created. Otherwise image search on search engines would create 404s.

    But I do like the idea of having an automatic approach by WordPress core to manage changed image sizes when changing themes.

    But changing all posts automatically and recreating images for years back will break many shared hosts and kill smaller servers.

    Posted: 3 months ago #
  7. Michael
    Member

    This should be a core feature.

    Posted: 2 months ago #
  8. Drew Jaynes
    4.2 Release Lead

    This definitely feels like plugin territory, if not just because there are already a variety of plugins that handle it. The issue of media previously linked in content is the major sticking point – having core remove those files and possible create issues with broken images in old content is never going to be ideal.

    Posted: 1 month ago #
  9. peter-h
    Member

    12345

    +1. I registered today just to support this idea.

    Posted: 1 month ago #

RSS feed for this topic

Reply

You must log in to post.

  • Rating

    12345
    33 Votes
  • Status

    Sorry, not right now