Viewing 3 replies - 1 through 3 (of 3 total)
  • Joy

    (@joyously)

    I don’t know about automatic, but here are a couple plugins that help delete stuff.
    https://www.ads-software.com/plugins/bulk-delete/
    https://www.ads-software.com/plugins/wp-bulk-delete/

    You might have to delete all meta (for a meta key) and then regenerate the image data again.

    Moderator bcworkz

    (@bcworkz)

    The size data is stored as a serialized array. Slicing out portions via SQL like the SO OP wants to do is fraught with problems. Doing so is best done with custom PHP code where the data is converted to normal arrays and back to serialized automatically. You can do a SQL query to get some metadata where the meta_value has a string like one of the size names you want to delete. Don’t try to process too many at one time or the script will time out.

    Once you have the query results in PHP, step through the records and unset the undesired size elements, then save the modified array back to the DB. If you don’t require a nice user interface for this, the code isn’t all that involved, but of course it does require adequate coding skills.

    The only other option I see is as Joy suggests, delete wholesale and regenerate.

    Joy

    (@joyously)

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Automatic remove of useless attachment metadata’ is closed to new replies.