Remove unsed image sizes
-
Hello,
I′ve set to Opx medium and large image sizes in Media tab in de Administration Screen, and unset in functions.php theme′s file the largest ones being generated since the last WordPress updates. But I′d like to remove from db all sizes but both the uploaded as featured image and thumbnails.
In another time, I removed the unused ones directly from the file manager in cpanel and had to reedit post/pages since the removal deteled displayed images on the site. And had to upload them all again with different names.
1) I′d like to know if there′s a safe command to run or function to add to remove the unwanted sizes. I′ve found a function here using wp_get_attachment_image but I don′t understand how to search in all posts/pages for the sizes I want to remove by applying a filter, and then remove them.
2) A time ago I manually deleted somme of the images′ metadata from db (wp_attachment_metadata meta key in wp_postmeta table), since I didn′t find a command or any other way to do it. I′d like to know if this could be done manually by deleting other elements of that array, or would that also remove images from being displayed as before?
Regards,
Julia
- The topic ‘Remove unsed image sizes’ is closed to new replies.