Duplicate Images in Database

[ad_1]

Hello all

I've been using WordPress for about ten years and never encountered this issue before.

My database on my site has, for some reason, just replicated the images in it as different sizes. The original size image is in there, and about fifteen variations on the size. It's now caused my database to increase by about 2gb.

I haven't added any new plugins that would create an issue like this, however I do use the free version of Smush.

Because the files are all named differently now, I can't just remove them via dedupe as they don't technically look the same.

Any idea what's causing the issue or how to easily remove/rectify it?

Thanks in advance

[ad_2]
2 Comments
  1. This is normal WordPress behavior. It will generate separate images for all registered image sizes, so with a lot of sizes it adds up. It also won’t go back and erase sizes that no longer exist.

    Running a plugin to regenerate sizes (I vaguely remember WP CLI might have a command too) will rebuild sizes as they currently are. There are also plugins that would adjust this behavior, such as only generating sizes as they are requested or arbitrary sizes (latter can be a ddos concern though).

  2. Like u/Rarst said – that is (and has always been) how WordPress works.

    I doubt that it has made your DB that big. It will definitely impact your disk space, but not your DB like that. And even if it did impact your DB, that doesn’t affect your site’s performance.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer