is it safe to delete unattached images on wordpress?

Shaybib

Senior Member
Joined
Mar 23, 2018
Messages
831
Reaction score
262
* I have many unattached images can I delete them?
*is there a way to determine which auto-generated size my theme creates is useless and I can delete them?
 
the images would become 404, but if they're not included in any posts then odds are they weren't indexed in the first place so it's safe to remove them. As for the auto-generated I don't think it's that important to remove them, they don't really make that much of a difference.
 
Generally speaking it is not recommend you to delete unattached image files from WordPress directly. Unattached images are not necessarily unused images in WordPress. They could be used in WordPress posts, pages, other sections of your WordPress theme. A lot of WordPress plugins claim to be able to find all unused media files in WordPress, but none of them can assure you they can find and delete only unused images. Sometimes pictures in use may also be deleted as well. Check out the plugin reviews before you use such a plugin to remove or clear image files of your WordPress site. At least you need to verify the images first, then create a backup of them before you delete the unattached images from WordPress site or blog.
 
Generally speaking it is not recommend you to delete unattached image files from WordPress directly. Unattached images are not necessarily unused images in WordPress. They could be used in WordPress posts, pages, other sections of your WordPress theme. A lot of WordPress plugins claim to be able to find all unused media files in WordPress, but none of them can assure you they can find and delete only unused images. Sometimes pictures in use may also be deleted as well. Check out the plugin reviews before you use such a plugin to remove or clear image files of your WordPress site. At least you need to verify the images first, then create a backup of them before you delete the unattached images from WordPress site or blog.
Isn't unattached images meaning if images that are not in post or pages?
 
Well, in case anyone is interested in this:
I delete the unattached images and it seems ok. I had to go through it manually because some unattached images were avatars and some images that are linked from a post.
As for the generated images, I check the html of all the kind of pages on my site: home, pages, posts, lists, and grid.
I found out the kind of generated sizes that are in use (the source had classes for them).
It turned out it was using 4 sizes out of the 12 the theme generated.
 
Back
Top