Code Snippet to Stop Wordpress Creating Duplicate and Unused Images in your Database

แชร์
ฝัง
  • เผยแพร่เมื่อ 17 ต.ค. 2024

ความคิดเห็น • 44

  • @maddy1mymk
    @maddy1mymk ปีที่แล้ว +2

    I can only imagine how quickly this grows in an ecommerce website 😱. Thanks Imran!

  • @PicSta
    @PicSta ปีที่แล้ว +4

    Absolutely a jewel of a snippet. Useful for so many websites out there, especially the image heavy ones or big shops. Great job & video.

    • @websquadron
      @websquadron  ปีที่แล้ว +1

      This video now supersedes this one as it addresses images that are already loaded into the database.
      th-cam.com/video/XcZfKGBmJRA/w-d-xo.html

  • @GoExploreGreece
    @GoExploreGreece ปีที่แล้ว +1

    A fantastic tip Imran. As someone who already has over 1200 images which are growing weekly, I'll apply this over weekend.

  • @digwillhachi
    @digwillhachi ปีที่แล้ว +3

    This should be an option in base wordpress to be honest. Good info 👍

  • @davidsonzed
    @davidsonzed 27 วันที่ผ่านมา

    Thank you Imran, can you please write snippet code to delete all these sized images for a previously uploaded site? I think this will be a great solution if we can write a code to deleted all these sizes of images. Thank you

  • @Jason_1010
    @Jason_1010 ปีที่แล้ว +1

    Very useful, thanks Imran 👍

  • @ericblackwell3727
    @ericblackwell3727 ปีที่แล้ว +1

    This should be an option in WP imho, but thanks for a great tip. I have a multisite with 250 sites on it that this is going to prove VERY useful for.

    • @websquadron
      @websquadron  ปีที่แล้ว +1

      Glad it was helpful!

  • @amiralbatal
    @amiralbatal ปีที่แล้ว +1

    i love this kind of content VERY VERY much

    • @websquadron
      @websquadron  ปีที่แล้ว +2

      This video now supersedes this one as it addresses images that are already loaded into the database.
      th-cam.com/video/XcZfKGBmJRA/w-d-xo.html

    • @amiralbatal
      @amiralbatal ปีที่แล้ว

      @@websquadron Of course, WordPress is already not the best performance CMS, so any tricks helps WordPress have better performance will be very good content.

    • @amiralbatal
      @amiralbatal ปีที่แล้ว

      by the way 2 2 or 3 days i have tried media cleaner be meo apps (i think) it was very good

  • @jcnation5393
    @jcnation5393 ปีที่แล้ว

    Imran, then there will be the "proper size" issue on pagespeed insight, don't you think?

    • @websquadron
      @websquadron  ปีที่แล้ว

      Not always if you're methodical about what you remove.

  • @genethompson9154
    @genethompson9154 ปีที่แล้ว +1

    Would this delete these images too - or just prevent them from being loaded?

    • @websquadron
      @websquadron  ปีที่แล้ว +1

      Won't delete but will stop it happening again.
      It's a pain that it does it in the first place.

  • @antonichristian5845
    @antonichristian5845 ปีที่แล้ว +1

    cheers Imran... really wish Wordpress wouldn't do this by default or at least give us an option to turn it off... can end up with a ton of crap in the database...

  • @siddiqtalks
    @siddiqtalks ปีที่แล้ว +1

    Aoa Imran is it possible to take some consultation ? It’s about calendly/elementor integration

    • @websquadron
      @websquadron  ปีที่แล้ว +1

      Hi. Sure, we have 2 options - 30mins or 1hr.
      websquadron.co.uk/services/

    • @siddiqtalks
      @siddiqtalks ปีที่แล้ว

      @@websquadron site seems down

    • @websquadron
      @websquadron  ปีที่แล้ว +1

      @@siddiqtalks Just checked and it's all fine. Or you can email me on info@websquadron.co.uk

  • @soicybunny
    @soicybunny ปีที่แล้ว +3

    golden

  • @deanazelinova5103
    @deanazelinova5103 ปีที่แล้ว

    Hello, thank you for nice tip. I have a problem to save snippet in Elementor custom code section. Button save just doesn't react. { Where Do You Want to Display Your Code?}. It's just a Elem. bug?

    • @antonichristian5845
      @antonichristian5845 ปีที่แล้ว +1

      use a plugin like codesnippets as suggested by Imran in the video... you can also add it to your themes functions.php file... i know that elementor custom code can accept js and css... not to sure about php...

    • @websquadron
      @websquadron  ปีที่แล้ว +1

      Add to Code Snippets as in the video. It's a much safer way to do it.

    • @deanazelinova5103
      @deanazelinova5103 ปีที่แล้ว +2

      @@websquadron I don't know why instal other plugin, when in Elementor Pro exist already. So I added to functions on child theme and it works. Thanks for idea.

  • @danjepi82
    @danjepi82 ปีที่แล้ว

    Thanks! All done but then, uploading a new media, WP still create 3 new sized images: 100x100, 300x300, 600x600, so strange...

    • @websquadron
      @websquadron  ปีที่แล้ว +1

      This video now supersedes this one as it addresses images that are already loaded into the database.
      th-cam.com/video/XcZfKGBmJRA/w-d-xo.html

    • @audunjemtland8287
      @audunjemtland8287 8 หลายเดือนก่อน

      @@websquadron Do you have a video on after the code is inserted and it still makes duplicates? It still makes 2 duplicates here. x100 and x300. (They are checked off)

  • @dingadanga8653
    @dingadanga8653 ปีที่แล้ว

    Aqesome, is there a way to remove the existing images that have being created , prior to applying the code ?

    • @websquadron
      @websquadron  ปีที่แล้ว +1

      Manually but I’m going to clarify tomorrow with a better method

    • @dingadanga8653
      @dingadanga8653 ปีที่แล้ว

      @Web Squadron I looked at media cleaner, but that can open a can of worms on an ecommerce site as it can break the site.
      Would be great to have a plugin which scans your whole website and keeps only the images in use across responsive view.
      I know you can restore using meoaps media cleaner, but in even a small ecommerce website with 1000 products, it can be time consuming and then a pain if ir breaks etc

    • @dingadanga8653
      @dingadanga8653 ปีที่แล้ว

      @Web Squadron could you tag me if you have a better way please 😁👌💯🤙

    • @websquadron
      @websquadron  ปีที่แล้ว +2

      @@dingadanga8653 yup I’m looking into an alternative way

  • @OnkelFolie
    @OnkelFolie 10 หลายเดือนก่อน

    The Snippets doesnt work for me, i tried so many things but i still get duplicates

    • @websquadron
      @websquadron  10 หลายเดือนก่อน

      It works for me though.

  • @erling5148
    @erling5148 ปีที่แล้ว

    It still makes different sizes images

    • @websquadron
      @websquadron  ปีที่แล้ว +1

      Yup hold on - I will do a video to clarify this as some sizes will still be generated by WP

    • @erling5148
      @erling5148 ปีที่แล้ว

      @@websquadron it also depends on the theme you use
      this pluging seems to be working ThumbPress - Stop Generating Unnecessary Thumbnails
      2869 images processed
      19178 thumbnails removed
      0 thumbnails regenerated
      it shows al the sizes that will be generated, including the sizes your theme sets, you can just copy these sizes and add these to your snippet

    • @audunjemtland8287
      @audunjemtland8287 8 หลายเดือนก่อน

      @@erling5148 So one cannot use this generally on any theme? What is it that differs?