Tagged: media files
-
AuthorPosts
-
January 2, 2019 at 6:09 pm #1049330
Happy New Year Enfold Team! I hope you all had restful holidays.
My site is approaching the WP Engine storage limit of 10 GB so I spent the holidays trying to figure out what’s going on. In short, it appears that Enfold saves 15 different files for each photo I upload for each of the 11 sizes in Enfold, plus an additional 4 that I’m not sure where they come from…. I read one thread that suggested they are for Woo Commerce which I don’t use. Those files really add up since my site is very photo intensive. Is there anything I can do?
I always compress photos I upload with TinyPNG, and I also followed the instructions in this post from Ismael on changing the default upload quality back to 80 and re-generating thumbnails. That did not make much of a difference in my storage.
Do you have any suggestions on what else I can try?
Thanks!
RobJanuary 3, 2019 at 5:33 am #1049470Hey goldengate415,
Thank you for using Enfold.
You can use the Simple Image Sizes plugin to disable those thumbnails.
// https://wordpress.org/plugins/simple-image-sizes/
This article might help as well:
// https://kriesi.at/archives/4-key-wordpress-image-optimization-tips
Best regards,
IsmaelJanuary 3, 2019 at 5:15 pm #1049652Hi Ismael,
Thank you for the response!Is there a way to do this without a plugin? Modify functions.php in my child theme? And are there additional sizes generated by Enfold for Woo Commerce?
Thanks!!
RobJanuary 5, 2019 at 2:34 am #1050161Hi,
Add the following code
function ava_image_sizes() {
remove_image_size(‘masonry’);
remove_image_size(‘magazine’);
remove_image_size(‘widget’);
remove_image_size(‘featured’);
remove_image_size(‘featured_large’);
remove_image_size(‘extra_large’);
remove_image_size(‘portfolio_small’);
remove_image_size(‘gallery’);
remove_image_size(‘entry_with_sidebar’);
remove_image_size(‘entry_without_sidebar’);
remove_image_size(‘square’);
}
add_action( ‘after_setup_theme’, ‘ava_image_sizes’, 11 );and then u need to find which images sizes you are using, so you can simple remove the lines that are active and u are using.
Best regards,
BasilisJanuary 5, 2019 at 5:52 am #1050193Thank you, Basilis!
Questions:
1. Will this process get rid of the photos used for Woo Commerce? I won’t use Woo Commerce.
2. For this line do I change the 11 to the number of photo sizes I end up with? add_action( ‘after_setup_theme’, ‘ava_image_sizes’, 11 );
3. After this, do I use Regenerate Thumbnails plugin to re-process all the photos in my media library and delete the ones not used, or do I use a different plugin?Thanks!!!!
RobJanuary 5, 2019 at 6:04 am #1050204According to the Regenerate Thumbnails Plugin, here are the sizes currently configured in Enfold:
“Thumbnail Sizes
These are all of the thumbnail sizes that are currently registered:thumbnail: 600×650 pixels (proportionally resized to fit inside dimensions)
medium: 300×300 pixels (proportionally resized to fit inside dimensions)
medium_large: 768×0 pixels (proportionally resized to fit inside dimensions)
large: 1030×1030 pixels (proportionally resized to fit inside dimensions)
widget: 36×36 pixels (cropped to fit)
square: 180×180 pixels (cropped to fit)
featured: 1500×430 pixels (cropped to fit)
featured_large: 1500×630 pixels (cropped to fit)
extra_large: 1500×1500 pixels (proportionally resized to fit inside dimensions)
portfolio: 495×400 pixels (cropped to fit)
portfolio_small: 260×185 pixels (cropped to fit)
gallery: 845×684 pixels (cropped to fit)
magazine: 710×375 pixels (cropped to fit)
masonry: 705×705 pixels (proportionally resized to fit inside dimensions)
entry_with_sidebar: 845×321 pixels (cropped to fit)
entry_without_sidebar: 1210×423 pixels (cropped to fit)
shop_thumbnail: 120×120 pixels (cropped to fit)
shop_catalog: 450×450 pixels (cropped to fit)
shop_single: 450×999 pixels (proportionally resized to fit inside dimensions)”Hope that helps clarify.
January 7, 2019 at 1:48 pm #1050873Hi,
1.) You have to include the last 3 thumbnails (shop_thumbnail, shop_catalog & shop_single) from that list.
remove_image_size(‘shop_thumbnail’); remove_image_size(‘shop_catalog’); remove_image_size(‘shop_single’);
2.) That is the action priority. You don’t have to change that.
3.) Yes, you need to regenerate the images to remove the unwanted thumbnails.
Best regards,
IsmaelJanuary 8, 2019 at 3:15 am #1051136OK I added the below code to functions.php on my child theme and nothing changed… I uploaded a photo and all the sizes were generated when I SFTP in and look at the directory:
function ava_image_sizes() {
remove_image_size(‘magazine’);
remove_image_size(‘widget’);
remove_image_size(‘portfolio_small’);
remove_image_size(‘gallery’);
remove_image_size(‘entry_with_sidebar’);
remove_image_size(‘entry_without_sidebar’);
remove_image_size(‘shop_thumbnail’);
remove_image_size(‘shop_catalog’);
remove_image_size(‘shop_single’);
}
add_action( ‘after_setup_theme’, ‘ava_image_sizes’, 11 );What did I do wrong?
Thanks,
RobJanuary 9, 2019 at 1:32 pm #1051817Hi,
Thanks for the update. This filter works on my end.
add_filter('avf_modify_thumb_size', 'avf_modify_thumb_size_mod', 10, 1); function avf_modify_thumb_size_mod($size) { $size = array(); return $size; }
Best regards,
IsmaelJanuary 9, 2019 at 6:20 pm #1051980I am unclear what to do here. Am I supposed to add that to the script you already gave me? Does this replace the code you already gave me? I am not a coder so need more explanation please.
Thanks
RobJanuary 9, 2019 at 7:34 pm #1052056Use the plugin https://de.wordpress.org/plugins/simple-image-sizes/ and set in the plugin’s settings (Settings -> Media) each image format, that you do not use or want, the size to height 0 and width 0; that means, that this image format will not be created for future uploads. Works only for new uploads, not for existing images.
For example at my end I don’t need the shop image formats and set them to 0 / 0 – this image sizes aren’t created:
http://imgbox.com/JbnLnm3aSimple and effective.
The benefit of this plugin is, that you can also change existing image sizes to your desire.
January 10, 2019 at 11:08 am #1052268Hi!
@goldengate415: You have to remove the first filter and use that one instead. Regenerate the thumbnails afterwards. If you’re using the following plugin, you’ll notice that after adding that code the theme’s thumbnail are going to be removed from the list of thumbnails in the plugin’s panel.// https://wordpress.org/plugins/regenerate-thumbnails/
@Gitte: Thank you for the info. He doesn’t want to use a plugin, so we’re suggesting the filter.
Cheers!
IsmaelJanuary 10, 2019 at 6:57 pm #1052441Ismael, thanks so much. However I want to keep some of Enfold’s sizes.
It sounds like this will eliminate all the theme’s sizes?I would like keep all except:
– portfolio
– portfolio small
– gallery
– entry with sidebar
– entry without sidebar
-shop thumbnail
-shop catalog
– shop singleDo I need to customize the above code?
Thanks for continuing to work with me on this…. !
Cheers
RobJanuary 13, 2019 at 11:59 pm #1053453Hi,
Replace the filter with the following code to remove specific thumbnails:
add_filter('avf_modify_thumb_size', 'avf_modify_thumb_size_mod', 10, 1); function avf_modify_thumb_size_mod($size) { unset($size['magazine']); unset($size['widget']); unset($size['portfolio_small']); unset($size['gallery']); unset($size['entry_with_sidebar']); unset($size['entry_without_sidebar']); unset($size['shop_thumbnail']); unset($size['shop_catalog']); unset($size['shop_single']); return $size; }
Best regards,
IsmaelJanuary 17, 2019 at 1:18 am #1054813This code seems to keep all the thumbnails except the shop thumbnails when I upload… so after I installed the code in functions.php in my child theme, I uploaded a photo, and there are still 12 files (versus the original 15 at the top of this thread).
I would imagine others will have this request if and when they start running up against their own 10 GB server storage limits. Can we figure this out please?
Thanks,
RobJanuary 17, 2019 at 12:47 pm #1054978https://kriesi.at/support/topic/photos-taking-up-a-huge-amount-of-space-on-my-site-storage-anything-i-can-do/#post-1052056
January 17, 2019 at 9:32 pm #1055162Thanks Gitte, and then to re-generate the older media files already uploaded, do you use regenerate thumbnails plugin?
I’m a bit concerned that the plugin you are recommending has not been updated in a long time and has not be certified to be compatible with WP 5.0…?January 18, 2019 at 7:15 am #1055362OK… I gave up on using the functions.php and installed the plugins…. and I’ve reduced the storage used on my site by 50% from 9 GB to 4.5 GB with zero impact on the site itself. I DO THINK that Enfold should add this to the theme options… it’s ridiculous to save 15 files for every photo if you only need a few of them… wastes lots of space.
For anyone else searching for this or needing to do this in the future, download:
– Regenerate Thumbnails plugin
– Simple Image Sizes PluginUse Simple Image Sizes (SIS) to select which photo sizes you want to use on your site (See Gitte’s screenshots above for how to do it), then use Regenerate Thumbnails and select ” Delete thumbnail files for old unregistered sizes in order to free up server space. This may result in broken images in your posts and pages”
BE SURE TO MAKE A BACKUP OF YOUR ENTIRE SITE BEFORE YOU BEGIN THIS PROCESS
Thanks all for your help!! I am surprised this isn’t a more common request on this forum.
Rob- This reply was modified 5 years, 10 months ago by goldengate415.
January 18, 2019 at 12:09 pm #1055416when you use the “Simple Image Sizes Plugin” you do not need to install the “Regenerate Thumbnails plugin”, too, because the Simple Image Size plugin has the regenerate thumbnail functionality. See at the very bottom of the page, where you change your media sizes.
January 18, 2019 at 5:21 pm #1055520Hi Gitte, I saw that button and used it on Simple Image Sizes Plugin to re-generate thumbnails, but after it ran I checked via SFTP and all the old ones were still there. It was not until I used the “Regenerate Thumbnails” plugin that the old ones were deleted. Perhaps this is unique to my server environment on WP Engine but I’m just glad to have the disk space cleaned up.
Thanks for your help!
January 19, 2019 at 7:20 am #1055786Hi Rob,
Thanks for sharing your experiences, much appreciated :-)
Best regards,
RikardJanuary 19, 2019 at 7:34 am #1055791Sure thing, Rikard, hope it helps someone else. And maybe Gunter can work on this option for a future version of Enfold? :)
-
AuthorPosts
- You must be logged in to reply to this topic.