I have a custom post type that requires different image sizes than other posts. Right now the images are added via wp_insert_attachment, a thumbnail set via set_post_thumbnail, and images are resized on the users end. I'd like to serve different sized images but wp_generate_attachment_metadata generates too many different sizes considering we're working with tens of thousands of photos. Is there a way to generate intermediate image sizes individually ie: create a medium size version of this image but not that one?

1 Answer 1


WordPress isn't natively friendly to such granular size management. Also it could take a considerable toll on humans to manage it, if manual.

The common approach is to switch image sizes generation from the moment of upload to the moment of size being requested. So the sizes which are never actually used are never generated accordingly.

If I am not mistaken WPThumb is one of popular implementations.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.