WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I found this post: How do I delete all generated images from my server except those currently used in posts which describes how to delete all image sizes but the original uploaded image file.

I need to do this on a post by post basis for a custom post type named "gallery". None of the images are in the post content, they are simply attached ot the post. There is no content entered for my gallery custom post type.

How would I go about altering the code in the above post to fit my needs? A simple push in the right direction would be greatly appreciated.


share|improve this question
I always try to post code that show how to do what it is asked, but in this case I totally recomend Force Regenerate Thumbnails. – cybmeta Jun 9 '14 at 17:23
Works like a charm! Thanks for the link and recommendation! – dkmojo Jun 12 '14 at 20:23

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.