
-
AuthorPosts
-
August 31, 2025 at 3:19 pm #1488784
Hi
I’m just trying to convince our customer to upload smaller files sizes and use image compression and nexgen image formats etc rather than what they uplaod. However I’ve noticed that files that they have already uploaded which are for example 2500px wide x 1660px with a file size of 231KB. Enfold/Wordpress then creates files for banners etc which are 3 times the files size. e.g. 1500px x 630px becomes 721kb and 1500px x 430px becomes 670kb and so on.
Do you know why this would be and how we can prevent the image files becoming larger than the orgiinal that is uploaded?
Many Thanks
Regards
ColinAugust 31, 2025 at 5:30 pm #1488786Hey waveseven,
This is due to the default image compression settings, Enfold unpacks the original file and generates new thumbnail sizes without applying compression, resulting in larger file sizes, especially for larger dimensions like “featured”, “featured_large”, and “extra_large”. This occurs because the theme sets the default JPEG quality to 100, which is higher than the typical WordPress default of 80, and the generated files are not compressed during the resizing process.
To change the compression of new thumbnail sizes, add this code to the end of your child theme functions.php file in Appearance ▸ Editor and adjust to suit.add_filter("avf_jpeg_quality", "avf_set_quality_mod", 9999, 1); add_filter("avf_wp_editor_set_quality", "avf_set_quality_mod", 9999, 1); function avf_set_quality_mod($quality) { $quality = 60; return $quality;}
For thumbnails already created you will need to regenerate the thumbnails
Best regards,
MikeSeptember 1, 2025 at 8:25 am #1488795Hi Mike
Ah. that makes sense. Thanks for the code I’ll try that.
Regards
ColinSeptember 2, 2025 at 12:55 pm #1488859Is there a similar code for webp files as well, as it also seems to increase the sizes of the additional images?
Regards
ColinSeptember 5, 2025 at 12:37 am #1488958Hi,
Thanks for your patience, the theme does not have a built-in setting to directly control the quality or compression of WebP images during the generation process, the avf_jpeg_quality filter is designed for JPEG images and does not apply to WebP. Typically is handled by WordPress and the PHP image extension on your server, ie: ImageMagick or GD, which is more common. If you can switch to ImageMagick on your server you can follow this documentation to adjust it.
Otherwise, I recommend using a plugin to compress WebP files further such as Imagify or WebP Express. I have not tested these, there may be others.Best regards,
MikeSeptember 5, 2025 at 9:32 am #1488980Hi Mike
No problem, thanks for your help. I will re add a compression plug-in. We initially remove it as the client didnt like the time it took to compress but I think he will just have to live with it.
Regards
ColinSeptember 5, 2025 at 11:03 am #1488982Hi,
Glad we were able to help, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.Best regards,
Mike -
AuthorPosts
- The topic ‘Enfold creating images larger than the orginal’ is closed to new replies.