Home › Forums › General Issues › Limit image sizes created for ACF image field › Reply To: Limit image sizes created for ACF image field
If you were talking about not creating image sizes for custom images sizes added with add_image_size(), https://developer.wordpress.org/reference/functions/add_image_size/ then I think it would be possible using acf/upload_prefilter https://www.advancedcustomfields.com/resources/acfupload_prefilter/.
I don’t know that it is possible but in this filter you might be able to call remove_image_size() on the custom sized you do not want to create.
But, if you read the documentation for remove_image_size() https://codex.wordpress.org/Function_Reference/remove_image_size it says
Note: Cannot be used on reserved image size names
There isn’t anything in WP that will let you stop WP from creating the 3 images sizes that are built in.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
🤔 Curious about the ACF user experience? So are we! Help guide the evolution of ACF by taking part in our first ever Annual Survey and guarantee you’re represented in the results. https://t.co/0cgr9ZFOJ5— Advanced Custom Fields (@wp_acf) May 8, 2023
© 2023 Advanced Custom Fields.