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

Поделиться
HTML-код
  • Опубликовано: 24 авг 2024
  • Even after you set the Wordpress Media Settings to be 0 for many sizes, you may find that they are still be created in your Wordpress Database which can build over time for no good reason.
    Code:
    websquadron.co...
    We love to create - share - respond - and deliver.
    🧐 Learn with our Mastery Modules: websquadron.co...
    🔗 All of our Important Links: websquadron.co...
    😃 Join our Facebook Group: / 3309523509284305
    😃 Get Code Snippets Pro: r.freemius.com...
    😃 Get Elementor Pro: be.elementor.c...
    😃 Boost your RUclips Analysis: www.tubebuddy....
    👕 Get our Merchandise: websquadron.co...
    🥹 Support us: paypal.me/Webs...
    Hire us to work on your Website!
    💌 info@websquadron.co.uk
    👩‍💻 Visit websquadron.co.uk

Комментарии • 43

  • @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.
      ruclips.net/video/XcZfKGBmJRA/видео.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 👍

  • @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.

  • @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.
      ruclips.net/video/XcZfKGBmJRA/видео.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

  • @soicybunny
    @soicybunny Год назад +3

    golden

  • @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...

  • @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.

  • @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.

  • @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.

  • @OnkelFolie
    @OnkelFolie 8 месяцев назад

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

    • @websquadron
      @websquadron  8 месяцев назад

      It works for me though.

  • @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.
      ruclips.net/video/XcZfKGBmJRA/видео.html

    • @audunjemtland8287
      @audunjemtland8287 7 месяцев назад

      @@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)

  • @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

  • @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

  • @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 7 месяцев назад

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