Remove Duplicate Images from Wordpress Database - Media Library Settings

Remove Duplicate Images from Wordpress Database - Media Library Settings

Web Squadron

1 год назад

13,994 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Theo Du Toit
Theo Du Toit - 24.09.2023 11:28

Hi can you make a tutorial for images randomly dissapearing in wordpress ?

Ответить
eJass
eJass - 09.09.2023 20:39

f*** wordpress just causes you so much maintenance and headache... think twice b4 using wordpress...

Ответить
Max Bittle
Max Bittle - 07.08.2023 22:33

I have a 19GB photography site where the previous theme I used created 8 different versions of thumbnails. Is there I quite script I could run to just delete all of the sizes it generated? It's tens of thousands of images and the manual option would take days.

Ответить
Ciprian Relitchi
Ciprian Relitchi - 02.08.2023 10:53

Somehow after I did all the settings, when I check in cPanel file manager, it still creates 2 (sometimes 3) more copies of the initial image I upload (webP). Can you help?

Ответить
Just Jen
Just Jen - 26.07.2023 20:50

I feel lucky to have seen this video while im still building my website. Thank you!

Ответить
SB foto me
SB foto me - 06.07.2023 06:45

Once cleaning up the images, how does this effect page load and gtmetrix and Gpage speed?

Ответить
André Moraes Sarmento
André Moraes Sarmento - 24.05.2023 16:06

Good morning...
I did everything the same as your video, but the images are multiplying on the server.

Ответить
BoutzeroDJ
BoutzeroDJ - 21.05.2023 17:07

Hi Web Squadron. Is there a File Manager option in cPanel? Thanks!!

Ответить
Sujit Biswas
Sujit Biswas - 19.04.2023 13:31

I have added the code using code snippet plugin and done all the settings as you have shown in the video. Afterwards, I added an image to the media library. I can see total 8 versions of the image inside my file manager. Please help.

Ответить
my stuff
my stuff - 18.04.2023 17:08

is there a way to stay only with specific size (large 1920) but without the full size resolution, when i say full size resolution i mean if i upload 3mb image, i want to auto remove the 3MB file and stay only with large size... possible?

Ответить
to the chocolate factory
to the chocolate factory - 09.04.2023 19:49

DEAREST IMRAN, now I am upload woocommerce at 1000 by 1000 usually sometimes less or sometimes more... I see in the code you have not included the size small, is that because you upload small 500px by 500px or is that all irelevant my friend? And shall I just go ahead and copy the code and your method? for my 1000by1000px.... You the expert, do advise, you the man Imran

Ответить
Barad Dediashwili
Barad Dediashwili - 04.04.2023 20:45

but what do we do for the image widget responsive modes?
elementor doesn't let you have different images for mobile in the image widget.
only possible way to use a smaller image for mobile is the scaled images from the media settings

Ответить
Indigo Film School
Indigo Film School - 19.02.2023 18:16

Thanks for this video, lots of great tips! I've now changed my media settings and added the code snippet to the functions.php in my child theme.

I'm also with SiteGround, but couldn't shift select images in the File Manager. Ended up using Filezilla to FTP into the site and delete duplicated images from wp-content > uploads.

Ответить
Am O
Am O - 13.01.2023 15:40

"MUST WATCH" - ehh, this is the kind of videos a stay clear of...

Ответить
World of Nissanka
World of Nissanka - 11.01.2023 21:56

what a useful video ... thank you for this video.. I'm using ligtspeed webserver I should learn how to do it.. it's another question for me 😂😂

Ответить
Mehmet Tüz
Mehmet Tüz - 28.12.2022 01:57

Hi, I've tried this custom php code but wordpress still generates images as 1536x987 and 2048x1317. Why could be it?

Ответить
Pana
Pana - 01.12.2022 23:23

A simpler option would be to add the snippet code below, there is no need to set all the variants of the media settings to zero.

add_filter('intermediate_image_sizes_advanced','stop_thumbs');
function stop_thumbs($sizes){
return array();
}

Ответить
Ron Richardson
Ron Richardson - 27.11.2022 22:12

A follow-up... A lot of this can be solved by using WEBP. I'm now using EWWW Image Optimizer which does a great job of converting to WEBP. And a bonus, it does image sharpening(!). I'm now using sizes: 360, 550, 1120, 1920, and full. Using WEBP, most of these have file sizes at around 50k. These are the sizes that work best with the default 1140px width. And, a final quick comment, if you use the Elementor Hello theme, that has an option set: $content_width = 800. That setting will max out, to 800px wide, any media setting above the 800. If you set Large to 1020, it will only display 800. Took me two days to figure that out... painful!

Ответить
Peter Opsomer
Peter Opsomer - 20.11.2022 02:16

I was able to solve the problem. I hadn't noticed that there was a setting in the settings to show the code or not. I just set it to "Hide" and everything was fine with that... Thank you very much for your prompt reply.

Ответить
Peter Opsomer
Peter Opsomer - 19.11.2022 21:40

Hello, I think it is working but why is the code shown on my website-heading? I have a screenshot...

Ответить
Daniel Berkovich
Daniel Berkovich - 18.11.2022 15:00

What about the thumbmails i'm missing for my blog?
The category page where it shows small images for example: In this case it will takes the feature image? (which is big)?

Search results, archive, etc.

What would you recommend in this case?
Should I allow at least one duplication in a size similiar to what I need?

Ответить
Martin Kaspar
Martin Kaspar - 15.11.2022 02:54

Yeah Imran thank you!!! Super awesome i was using a plugin for this - thanks for this video with the valuable infos!!! I

Ответить
Alwin Langmann
Alwin Langmann - 14.11.2022 12:08

Will WPMUDEV Smush or even setting the display size inside elementor still work?

Ответить
Karipos
Karipos - 13.11.2022 23:27

I think if you add the snippet and install the plugin regenarate thumbnails it will remove the other generated images

Ответить
Stratos Greek Tutorials
Stratos Greek Tutorials - 13.11.2022 15:17

Hi, Imran. I would disagree with some things mentioned in this video.
1. The media cleaner plugin is not something you can trust. It is not that it would be 99% correct. The plugin cannot check the CSS and see which images are used as backgrounds, so you lose all those images.
2. You say copies, but WordPress does not actually create copies of the images. Just different sizes to use when needed. And by disabling this feature you may save some space from your disk, but actually you will use the full size of the images in the pages, and in carousel, post grid and other sections. So you will end up with bigger page sizes and that means bigger loading times.
3. The extra image size that you get when setting the 0 Media > Settings is probably coming from your theme. Other themes may create more sizes. Try a newspaper theme and do the same process. You will end up with a website full of placeholders instead of images.
4. There are plugins that will create different sizes as well, WooCommerce being one of them. And you will end up with more problems when you start deleting images or disabling sizes.
5. There are many themes that are bad at image size handling. Newspaper is one of them. They create over 20 image sizes of each one you upload. There is a solution to identify and only enable the sizes you need, but you will still need some of those. So basically use a better theme.
6. If you end up setting everything to 0 there is a far better way to delete the different image sizes. Use thumbnail image's regenerator. It will delete all the images that are disabled.

Overall, I would not suggest setting everything to 0 and delete all the image sizes. Those images can be used across the website for many reasons.
As always thanks for the video Imnar. Take care

Ответить
Manolo Macchetta
Manolo Macchetta - 13.11.2022 13:54

Doing this you will load "big images" also for archive pages or there is some workaround?

Ответить
Arno Hesse
Arno Hesse - 13.11.2022 05:21

Super-practical vid! Thanks. Two questions, though: Don’t the different file sizes exist for a reason? … often created by image optimizer, to use a smaller version in an archive grid, compared to the image on a single post. Second question: is there any reliable way (plug-in?) to determine which images are actually used on the site?

Ответить
Brock Barr
Brock Barr - 12.11.2022 23:43

Two things... Firstly, sometimes having small versions of images is a good thing if you have a blog. You might want the large image to appear as the featured image on post, while a smaller version appears on the archive page. Secondly, you kept saying database but it's really the uploads folder. The first two images that you uploaded and then deleted from the uploads folder are still actually in the database as paths to the images within the uploads folder. Just to clarify. I'm definitely going to be using this technique but will need to think about smaller images for blogs. Thanks!!!

Ответить
N0 AL N0M 2O30
N0 AL N0M 2O30 - 12.11.2022 22:55

Hey Imran, we can delete all extra images sizes files via cPanel BUT in the sql database the path images records are still there right? Any snippet to delete from database too? Great work!!!

Ответить
N0 AL N0M 2O30
N0 AL N0M 2O30 - 12.11.2022 22:44

Yeah!!! Super awesome i was using a plugin for this!!! I will put this function into my Bricks Child Theme.

Ответить
David Walls
David Walls - 12.11.2022 22:36

Imran, if I could give this video a 2xthumbs up I'd do that. This was a great time saver / website database size save for me.

Ответить
Angela Schmidt Design
Angela Schmidt Design - 12.11.2022 21:20

I thought the thumbnail was created for the media library?

Ответить
Helmut Göbel
Helmut Göbel - 12.11.2022 21:01

Hi Imran. Is that smart to do? There was a reason for WP to create 3 variations: for the 3 device sizes. Is it smart to load the full image on a smart phone? I'm just about to redesign a website with a heck of lot images, so I have to decide wether to follow or not your advice. Thanks bro.

Ответить
Eric Daubié
Eric Daubié - 12.11.2022 20:33

Brilliant. Funny I bumped into this last week. One easy way I found to cleanup the media library is download all images locally from the site (I use Filebird and I think the option comes from that plugin), and that only gets the full images. Then erase everything through file manager and re-upload the images. As I (like you) don't use the year/month/day classification, media path are not changed and everything is fine.

Ответить
MD Jada'an
MD Jada'an - 12.11.2022 19:58

Hi Imran .. Are you Okay man ? what happened to your hand I'm worried bro why you use these ?

Ответить
Ron Richardson
Ron Richardson - 12.11.2022 19:52

I've recently tried your zeroing out the images, as you suggest. The problem that I have is that my customers tend to ignore their image file sizes and load very large file sized images. Then they add this image to a page or post and they have no choice but to use these huge images, even if they set it to thumbnail, medium, etc. They think that adding an image and it fills the column (maybe 33%) that the image is now shrunken to fit that space - but that image is still the huge image that they loaded.

I set those media sizes to: 250x0, 450x0, and 1024x0 - this will control the width and and the proper aspect ratio (height). I explain to my customers that they should use the smallest image that just fills the space, a thumbnail may not fill the space but a medium size will. Thanks... I do appreciate all that you do!

Ответить
inderpreet singh
inderpreet singh - 12.11.2022 19:51

thanks a lot

Ответить
Daniele
Daniele - 12.11.2022 19:19

i still get 3 sized images when i upload one :( 100x, 300x and 600x). :(

Ответить
ekikoo
ekikoo - 12.11.2022 19:01

I guess you also recommend using the Full size of images for example Elementor's Posts widget, Woocommerce grids etc? (Goes without saying the images need to be optimized before uploading) :) edit: Sometimes pagespeed analyzers complain about image sizes with such widgets though, but just ignore them? :D

Ответить
Erling Æ
Erling Æ - 12.11.2022 18:11

The amount and sixes of images added also depends on your theme and your plugins like woocommerce and your beloved :) slider Depicter

Ответить