TagDiv Newspaper Thumbnail Size

Posted in: Newspaper
Post count: 21

Hello,

My 2 months sports website is fast becoming ridiculously large in size, it is already about 11GB and I am searching for an option to reduce in size. The vast majority of the GB are in the uploads folder 9GB so i did a little research and find out that Thumbnail copies of my pictures are enormous in all sizes.

So I went to thumps on module/blocks on newspaper theme and disabled all the Thumbnails i do not need in my theme.
I think it will work in new posts but i need somehow to delete all the useless Thumbnails that are already in me server. I find in your https://forum.tagdiv.com/api-thumbnail-introduction/ that i can use the td_api_thumb::delete function to get rid of the useless thumbnails but i cannot understand where to use the code.

The resolutions I need to delete in the following:

td_api_thumb::delete(‘td_324x400’);
td_api_thumb::delete(‘td_1068x0’);
td_api_thumb::delete(‘td_1920x0’);
td_api_thumb::delete(‘td_0x420’);
td_api_thumb::delete(‘td_80x60’);
td_api_thumb::delete(‘td_265x198’);
td_api_thumb::delete(‘td_1068x0’);
td_api_thumb::delete(‘td_356x220’);
td_api_thumb::delete(‘td_356x364’);
td_api_thumb::delete(‘td_533x261’);
td_api_thumb::delete(‘td_534x462’);
td_api_thumb::delete(‘td_696x385’);
td_api_thumb::delete(‘td_741x486’);
td_api_thumb::delete(‘td_1068x580’);

So please advise me where i can use the above code exactly to solve my storage problem

Many thanks and happy new year.

  • This topic was modified 6 years by diriras.
Post count: 18283

Hello !

It would be easier to use the Regenerate Thumbnails plugin: https://prnt.sc/qkpq4p select this option AFTER you have deactivated all the unwanted thumb sizes

This should fix your issue.

I hope this was helpful !

Thank you !

Post count: 21

Hello,

I have tried your suggestion but currently I am on a shared hosting environment with over 12.000 pics for regeneration, it just never ends, and I am not sure if this plugin actually deletes the unnecessary thumbs…

One faster way i found if someone has shell access to the Host domain is the below.

cd directory to the upload folder of the wordpress for ex.
cd /example.com/wp-content/uploads/2020/01/

and run the following with correction to the resolutions you don’t need.

find . -type f -name ‘*[324]x[400]*’ -delete
find . -type f -name ‘*[1068]x[0]*’ -delete
find . -type f -name ‘*[1920]x[0]*’ -delete
find . -type f -name ‘*[0]x[420]*’ -delete
find . -type f -name ‘*[80]x[60]*’ -delete
find . -type f -name ‘*[265]x[198]*’ -delete
find . -type f -name ‘*[1068]x[0]*’ -delete
find . -type f -name ‘*[356]x[220]*’ -delete
find . -type f -name ‘*[356]x[364]*’ -delete
find . -type f -name ‘*[533]x[261]*’ -delete
find . -type f -name ‘*[534]x[462]*’ -delete
find . -type f -name ‘*[696]x[385]*’ -delete
find . -type f -name ‘*[741]x[486]*’ -delete
find . -type f -name ‘*[1068]x[580]*’ -delete

this one delete FAST all the thumbnails not needed by your theme.

Best Regards

Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic.