The add_image_size function is used to add image sizes in addition to the default thumbnail, medium, large, & full which are generated in WordPress by default.

Is there any way to only add those image sizes for specific uploads? Or are we limited to generating all possible image sizes for every upload?

1 Answer 1


Take a look at the intermediate_image_sizes_advanced filter. This filter receives the attachment ID in question, so with that you should be able to work out whether or not you want the intermediate sizes, and return an empty array if not.

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.