Remove Legacy Duplicate Images and keep the Thumbnail - WordPress

  Рет қаралды 1,748

Web Squadron

Web Squadron

Күн бұрын

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.websquad...
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.websquad...
👉 WordPress Hosting: be.elementor.c...
👉 The Pro Page Builder: be.elementor.c...
Need 1-2-1 Support: learn.websquad...
Join our Facebook Group: / websquadron
Get Code Snippets Pro: r.freemius.com...

Пікірлер: 51
@websquadron
@websquadron 2 ай бұрын
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.
@gastondearaujo9203
@gastondearaujo9203 2 ай бұрын
so nice!! fantastic help! thanks! regards from Uruguay!
@websquadron
@websquadron 2 ай бұрын
You're welcome!
@edywerder
@edywerder 2 ай бұрын
Another brilliant and helpful video!!!
@websquadron
@websquadron 2 ай бұрын
Take a backup first :)
@aminvalipoor2061
@aminvalipoor2061 2 ай бұрын
nice thanks
@OtisBurgos
@OtisBurgos 3 ай бұрын
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.
@Jimsoda
@Jimsoda 2 ай бұрын
Can’t tell how long I have waited for something like this. Thanks!!!!
@websquadron
@websquadron 2 ай бұрын
Any time! Make sure you take backups before using :)
@WisefocusdesignsAu
@WisefocusdesignsAu 2 ай бұрын
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.
@websquadron
@websquadron 2 ай бұрын
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.
@QuaverloveStudio
@QuaverloveStudio 2 ай бұрын
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.
@StooCambridgeArtist
@StooCambridgeArtist 2 ай бұрын
What a fantastic code snippet! Thanks Imran, appreciate you sharing this.
@quiatimet
@quiatimet 3 ай бұрын
Thank you for this! Please keep up the good work!!!
@wgm247
@wgm247 2 ай бұрын
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 !
@websquadron
@websquadron 2 ай бұрын
Yup still trying to crack that one
@gabrielk5497
@gabrielk5497 2 ай бұрын
This is glorious!!! Thankssssssss
@PetervanRemmen
@PetervanRemmen 2 ай бұрын
Hi Imran, great work. But did you delete the 'remove previous media' snippet? I can't find it when I import it.
@websquadron
@websquadron 2 ай бұрын
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
@PetervanRemmen
@PetervanRemmen 2 ай бұрын
Can you send me the script to try it out on my own risk? Just do it on a test server.
@emilyemr2591
@emilyemr2591 3 ай бұрын
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!
@websquadron
@websquadron 2 ай бұрын
Yup, that's why you need backups and use with caution. Removing unused images is a bugbear.
@truthninja298
@truthninja298 2 ай бұрын
Uhhh more importantly…..Someone better tell me where to get those animated Star Wars pictures.
@websquadron
@websquadron 2 ай бұрын
Grey Darth - from TikTok
@Properture
@Properture 2 ай бұрын
Where is the code snippets on your website? I don't find it...
@websquadron
@websquadron 2 ай бұрын
learn.websquadron.co.uk/#freepacks - did you open the Snippets Pack and import the bundle?
@phkoon
@phkoon 3 ай бұрын
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
@websquadron
@websquadron 2 ай бұрын
Hi - I just clicked and opened. Let me know if you still have issues.
@phkoon
@phkoon 2 ай бұрын
@@websquadron All working correctly now here too! You have a great week ahead
@szocshanna
@szocshanna 2 ай бұрын
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.
@websquadron
@websquadron 2 ай бұрын
How many images did you previously have in your database?
@websquadron
@websquadron 2 ай бұрын
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.
@szocshanna
@szocshanna 2 ай бұрын
@@websquadron wasn't too much, my hosting provider banned me for 10 minutes after I was able to log in
@5minutesplan
@5minutesplan 2 ай бұрын
Can you suggest best multi language translation plugin... I am using Google translet but really not happy with it.
@RetoB1976
@RetoB1976 2 ай бұрын
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?
@websquadron
@websquadron 2 ай бұрын
I do like to set at 0 and have no issues but some prefer to use 150 so I’m covering all bases :)
@RetoB1976
@RetoB1976 2 ай бұрын
@@websquadron excellent, will probably leave it at 150 and use your script. Thank you, Imran!
@tchazanov
@tchazanov 2 ай бұрын
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 :(
@websquadron
@websquadron 2 ай бұрын
Did you take a backup first as I recommended? I stress-tested this and it was fine for me on multiple sites.
@warblog6165
@warblog6165 2 ай бұрын
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.
@websquadron
@websquadron 2 ай бұрын
@@warblog6165 Sorry to hear that. 13GB sounds like a lot. See this video where you can put Code Snippets into Safe Mode: kzbin.info/www/bejne/mmi4qZuJo6h0Y8kfeature=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
@websquadron 2 ай бұрын
@@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: kzbin.info/www/bejne/mmi4qZuJo6h0Y8kfeature=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
@warblog6165 2 ай бұрын
@@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!
@1958moxon
@1958moxon 2 ай бұрын
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?
@websquadron
@websquadron 2 ай бұрын
And you've definitely unzipped the zip file? Difficult to be sure.
@websquadron
@websquadron 2 ай бұрын
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.
@1958moxon
@1958moxon 2 ай бұрын
@@websquadron yes, uploaded the json file
@1958moxon
@1958moxon 2 ай бұрын
@@websquadron Thanks will try again then.
UK Property Just Changed FOREVER
11:28
Property Hub
Рет қаралды 675 М.
How do QR codes work? (I built one myself to find out)
35:13
Veritasium
Рет қаралды 4,7 МЛН
Un coup venu de l’espace 😂😂😂
00:19
Nicocapone
Рет қаралды 5 МЛН
Incredible: Teacher builds airplane to teach kids behavior! #shorts
00:32
Fabiosa Stories
Рет қаралды 12 МЛН
Крутой фокус + секрет! #shorts
00:10
Роман Magic
Рет қаралды 29 МЛН
Help Me Celebrate! 😍🙏
00:35
Alan Chikin Chow
Рет қаралды 69 МЛН
6 Side Hustles Students Can Start in 2024
25:30
Ali Abdaal
Рет қаралды 3 МЛН
Smart SEO Automation | theseoevent.com
1:00:42
Theseoevent
Рет қаралды 761
HTMX Sucks
25:16
Theo - t3․gg
Рет қаралды 125 М.
Generative AI in a Nutshell - how to survive and thrive in the age of AI
17:57
WTF Is Going On With WordPress? WCUS24 & The Future of WP
11:07
Un coup venu de l’espace 😂😂😂
00:19
Nicocapone
Рет қаралды 5 МЛН