Remove Legacy Duplicate Images and keep the Thumbnail - WordPress
Vložit
- čas přidán 7. 07. 2024
- Get your 2 Code Snippets to;
1) Only Load the Original and Thumbnail 150 Images
2) Get rid of previously loaded images' duplicated versions
....here from the Snippets Pack: learn.websquadron.co.uk/#free...
NOTE: Before adding New Snippets
1. Always take a Backup
2. Preferably Export a Full Backup
3. Test on a Staging Site.
If you have many images then running this could slow down your site as it is resource intensive.
👉 Grab our $1 Business Packs: learn.websquadron.co.uk/#packs
👉 WordPress Hosting: be.elementor.com/visit/?bta=2...
👉 The Pro Page Builder: be.elementor.com/visit/?bta=2...
Need 1-2-1 Support: learn.websquadron.co.uk/#support
Join our Facebook Group: / websquadron
Get Code Snippets Pro: r.freemius.com/10565/3304295/ - Jak na to + styl
NOTE: Before adding New Snippets
1. Always take a Backup
2. Preferably Export a Full Backup
3. Test on a Staging Site.
If you have many images then running this could slow down your site as it is resource intensive.
nice
thanks
so nice!! fantastic help! thanks! regards from Uruguay!
You're welcome!
Another brilliant and helpful video!!!
Take a backup first :)
Brother these code snippets are so legendary lol. I've been watching your videos recently and, man, God bless you! My websites are infinitely better because of the resources and knowledge you are sharing. God bless you bro! Keep it up.
We asked... you answered. Then you have the nerve to ask "... who the heck am I?"
You must have a lot of corn in your diet, cross you're a-maize-ing!
Thanks, Imran, for another well handy snippet.
Great code Imran, thanks for sharing this. As a variation on this, what would you suggest for controlling the size of images so that even the original is removed leaving a more optomised size when uploading? This question is really for when the client, who would be uploading their own images for a blog post ,and who don't understand image sizes or types, and we want to control how much storage is used. The idea being that if they uploaded a large image file, the image is converted to the largest preset size and the original is deleted.
That's tricky as it could be very subjective. Should be able to modify the Snippet to remove the original, but leave the thumbnail and a certain size say 200px width. But that would need testing.
Can’t tell how long I have waited for something like this. Thanks!!!!
Any time! Make sure you take backups before using :)
What a fantastic code snippet! Thanks Imran, appreciate you sharing this.
Thank you for this! Please keep up the good work!!!
This is glorious!!! Thankssssssss
Hi Imran, great work. But did you delete the 'remove previous media' snippet? I can't find it when I import it.
Yup - it became unpredictable for some people in terms of their resources usage due to their images or hosting so I closed this down as the risk for some is tricky
Can you send me the script to try it out on my own risk? Just do it on a test server.
When I turned on the snippet I got an error:
Too Many Requests - The user has sent too many requests in a given amount of time.
After a while I was able to log in to the site but everything became very slow, after I managed to disable the code snippet plugin, the speed of the site was restored. The images were deleted anyway, only the 150*150 and the original one remained, but for some reason when the plugin is activated the site becomes unusably slow. I only activated the 2 snippets in the video.
How many images did you previously have in your database?
PS once it is run, you don't have to leave it activated as it will have done the removal thus nothing more to remove.
@@websquadron wasn't too much, my hosting provider banned me for 10 minutes after I was able to log in
Where is the code snippets on your website? I don't find it...
learn.websquadron.co.uk/#freepacks - did you open the Snippets Pack and import the bundle?
I have downloaded the zip file gone into code snippets / tools / selected the json file, pressed the import file, after a few seconds the box reverts to no file chosen but none of the snippets appear to have been added. What am I doing wrong please?
And you've definitely unzipped the zip file?
Difficult to be sure.
If it makes you feel better, in the next 7 days, I will be adding each snippet individually so that you can take what you want rather than the whole bundle.
@@websquadron yes, uploaded the json file
@@websquadron Thanks will try again then.
Can you suggest best multi language translation plugin... I am using Google translet but really not happy with it.
Now just imagine just one more code snippet that scans the website to ensure if any images are set to medium or large then that particular image isn't deleted for that size. This way, no website images break and only those used remain. Holly grail !
Yup still trying to crack that one
Hey Imran, thanks for those snippets. So, do you recommend to keep the thumbnail 150, as in your course you said to nil all sizes?
I do like to set at 0 and have no issues but some prefer to use 150 so I’m covering all bases :)
@@websquadron excellent, will probably leave it at 150 and use your script. Thank you, Imran!
Hello there, Imran!
I wasn't able to open the pack on click, had to right-click and open it in new tab. Don't know if it's an issue only on my end or from yours, just to let you know
Also thank you, the second snippet is a goddamn life-changer, and I've been looking for this for a while now
Hi - I just clicked and opened. Let me know if you still have issues.
@@websquadron All working correctly now here too!
You have a great week ahead
I used this snippet and my site froze so I wasn't even able to log into the dashboard. The only way was to disable code snippets and remove it. I would now have to install a fresh copy and try to find all of the code snippets that I used before :(
Did you take a backup first as I recommended?
I stress-tested this and it was fine for me on multiple sites.
I ran this snippet 12 hours ago and have not been able to get into the backend since. I did have a massive amount of images [ my website backed up was 13 GB - I took Imran’s advice and backed up ] could it still be running as the front end is functioning just fine ! Not being able get into the backend makes if difficult to restore if that is what I need to do. I am defiantly not throwing mud just looking for any bright ideas here before I ask a general question on the forums. I am an 80 year old who does this to keep my mind active having two commercial site and seven for charities.
@@warblog6165 Sorry to hear that. 13GB sounds like a lot. See this video where you can put Code Snippets into Safe Mode: czcams.com/video/d7UxhSnCA-g/video.htmlfeature=shared
Then you can enter the site and deactivate or remove the Snippet.
Note that you do need to have access to the backend Files and Databases that may be via your host depending on your host. Also double check with your host if you struggle there.
Backups and automated exports of websites is always a saviour with any new code/plugin.. I use All in One Migration to send daily full exports of my sites to my One Drive.
@@warblog6165 Not sure if my reply got through.
Sorry to hear that. 13GB sounds like a lot. See this video where you can put Code Snippets into Safe Mode: czcams.com/video/d7UxhSnCA-g/video.htmlfeature=shared
Then you can enter the site and deactivate or remove the Snippet.
Note that you do need to have access to the backend Files and Databases that may be via your host depending on your host. Also double check with your host if you struggle there.
Backups and automated exports of websites is always a saviour with any new code/plugin.. I use All in One Migration to send daily full exports of my sites to my One Drive.
@@websquadron That sounds really good Imran, very many thanks for taking the time and I was sorry to have troubled you. After posting the query I ran it through my ChatGPT who did offer a few solutions so I was able to get back to sleep. I greatly admire all the work you do; I still believe you need a ‘buy me a coffee’ widget somewhere - you have to eat!
this is a good way to nuke a whole ton of images you have been using for years. need something to eliminate images that are not being used. i tried meow and it deleted lots or images that were in use, good thing i backed up!
Yup, that's why you need backups and use with caution. Removing unused images is a bugbear.
Uhhh more importantly…..Someone better tell me where to get those animated Star Wars pictures.
Grey Darth - from TikTok