Urgent.News

What's breaking now, across thousands of outlets.

Tech

Finding duplicate images in a WordPress media library, without flagging WPML translations

How I added exact-duplicate detection to a free WordPress plugin, what broke on a 3,099-image multilingual site, and the SQL that fixed it. Last week I shipped duplicate image detection in Filikod , the free alt text audit plugin I maintain. On paper the feature is small: fingerprint every image file, group identical fingerprints, show the groups. Then I ran it on a real client site. 3,099…

I introduced duplicate image detection into Filikod, a free WordPress plugin I maintain. During testing on a real client site with 3,099 images across three languages under WPML and two migrations, my initial assumptions proved incorrect. I discovered that exact duplicates require exact byte matches, not just similar filenames. Resized or re-encoded variants should be treated as distinct files.

I avoided counting near-duplicates to simplify the process. My findings revealed that WPML creates separate attachments for each language, even when referencing the same physical file. This resulted in hundreds of redundant copies that needed to be consolidated. Additionally, I identified images left behind from migrations that still appeared in the media library but had no associated file.

I created a dedicated tab to list these orphaned attachments and the pages where they were used. Lastly, I ensured the plugin marked the oldest version of each duplicate group for easier cleanup, but it never automatically deletes or merges files.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

bro.js v3.0.0 – What’s new

Tired of flaky state leaking between tests or worrying about insecure defaults? bro.js just hit v3.0.0 and brings a bunch of practical upgrades that let you focus on code, not on runtime quirks.

Four bugs my test suite couldn't catch

216 passing tests. A feature that was completely broken. Here is the gap between those two facts, and what I changed afterwards. The feature I am building an encrypted messenger.

Automating Deployment with Github Actions

Deploying to a Server You Can't Reach: Building a CI/CD Pipeline with AWS SSM and OIDC From pushing code manually to building, testing, containerizing, and deploying every change automatically.

More from Sunday 20 September →