Hello,
We started to use Newspaper theme 9 or 10 months ago, the /upload/ folder is now 45 GB. We found out that every single thumbnail size was activated in Block setting so we have a lot of sizes for every single image.
We deactivated several of them. Then, we decided to do 2 things:
1 – Change every single post to the same template so every past article has just 1 image. My question is, Where is the post template setting saved at the database? We need to change them in bulk.
2 – Remove every single picture of the last month except the one that uses the template we are going to use. So the question is, where is the exact picture URL saved at the database?
Lastly, and most importantly, can you think a way to do this? This would be amazing for every user if we come up with a way to remove old pictures. Once they go out of home screen there is no reason to have 10 sizes of the same picture if the post is going to show just one every time for an old article.
Thank you very much!
Hi,
That would be correct, the theme will create thumbnails (the sizes which are enabled) from each image that is uploaded in the media library – https://forum.tagdiv.com/theme-thumbs/
These will be displayed in various locations and elements, when needed.
1. Changing the post template won’t remove the thumbnails that were created or which will be created. But regardless of this, the post template of a post can be changed only by editing each post, this would take a lot of time however if there are many posts.
These topics may be of use if you would like to attempt this in the database
– https://forum.tagdiv.com/topic/apply-a-single-post-template-globally/
Make a backup of the database before, or try it at first in a local or sub-domain copy/clone of the website.
2. Depends on the post template you want to use, these would be the sizes predefined post templates use – http://prntscr.com/njvdgj
The thumbnails will be created regardless of planning to use them or not, in case they are needed. There are plugins that can be used to remove unused thumbnails
– https://www.webnots.com/how-to-cleanup-thumbnails-in-wordpress/
This plugin – https://wordpress.org/plugins/regenerate-thumbnails/ should be able to do that. It has an option to remove unused thumbnails, this should reduce the size considerably.
Let me know if you have more questions.
Thanks
Hello,
Maybe I’m getting something wrong.
I’ve installed the plugin you suggested to remove unused thumbnails from my server. It says: “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.”
So, once I run that, it will result in broken images. What’s the sense in that?
Then, It says that my thumbnails are 17 different sizes. I only have 11 activated in my Newspaper Theme panel. So, once again, what’s the sense in regenerating all of them?
My question still remains. I need to remove all the thumbnails that the template is not using. So, how can I do that? Please, I need some help, I really need to reduce the 400,000 inodes that I have in the server urgently.
Thanks
Hi,
It says “it may result in broken images”, I personally haven’t seen cases where this happened however, or seen negative feedback after recommending it. However you could just to be safe make a backup of the uploads folder, and only then regenerate. If you find other methods or other plugins you can give those a try instead. We don’t have specific guides in this matter.
If you have 11 sizes activated in the theme panel, then the theme will create 11 thumbnails. WordPress will create an additional 3 sizes – http://prntscr.com/nlyiz3 Plugins can create thumbnails as well.
Thanks
