Filikod 1.2.0: Duplicate Image Detection in WordPress
Filikod developer shares how duplicate image detection was built for a 3,099-image multilingual site, resolving WPML translation conflicts.

Stock photo for illustration only, not from the actual event
- Filikod adds exact-duplicate image detection to its WordPress media library audit plugin.
- Multilingual sites using WPML create separate attachments per language pointing to the same file.
- The scanning logic requires filtering translation sets and detecting missing physical files on disk.
- The plugin displays copies and warns users instead of automatically deleting files for safety.
Managing a WordPress media library often involves dealing with redundant image uploads that go unnoticed. The developer of the free alt text audit plugin Filikod recently shared insights from building an exact-duplicate detection feature, tested on a real client site containing 3,099 images and utilizing WPML across three languages, which challenged several initial assumptions.
In reality, duplicate images rarely share identical naming patterns like photo.jpg and photo-1.jpg. Dashboard screenshots on the developer's site appeared under three different names, uploaded in July, August, and September by three different individuals with distinct titles and alt texts. The WordPress admin interface maintains no connection between them, making byte-level content fingerprinting essential for accurate identification rather than relying on filenames.
Subtle technical hurdles also emerged during development. Since WordPress 5.3, large uploads are scaled down, directing the attachment to the scaled version while the original remains on disk. If a site changes its image library between uploads, byte structures can differ. Fingerprinting must target the original file whenever WordPress retains it, and metadata updates require immediate recomputation following optimizations or edits.

Stock photo for illustration only, not from the actual event
A major complication on multilingual sites is that translation plugins like WPML, Polylang, and Bogo generate separate attachments for each language while referencing the exact same physical file on disk. Consequently, duplicate scanners initially flag these as redundant files requiring cleanup, even though deleting one breaks the translated page. Furthermore, alt text audits mistakenly flagged identical brand names across languages as duplicate errors.
Developing plugins for multilingual WordPress environments requires deep architectural awareness because translation plugins store data relationships differently. Standard database queries fail to capture cross-language entries or pull irrelevant data unless developers explicitly handle third-party filters and custom database table structures.
The solution relies on a structural rule treating an entire translation set as a single image. Multilingual plugins store relationship links in queryable tables, taxonomies, or post meta, allowing the system to load the entire mapping map in a single query. Once mapped, identical files collapse into one entry per translation set, and alt text errors apply only to genuinely distinct images. On-the-fly translation plugins like Weglot or TranslatePress bypass this entirely by omitting extra attachments.
"Rewriting every reference to a file across post content, page builder JSON, custom fields and widgets is where duplicate cleaners earn their one-star reviews"
Filikod DeveloperFollowing these fixes, the test library yielded 29 groups and 30 redundant files, representing actual duplicates such as shared product photos or duplicated partner logos. An additional 232 leftover images from previous migrations featured missing physical files on disk while retaining broken references in the admin panel. A dedicated tab was introduced to surface these broken paths and associated pages.
Another administrative quirk involved admin queries filtering by the current language, which silently bypassed two-thirds of the library until 'suppress_filters' => true was implemented. Developers building media audits should always verify counts against raw SQL. All these updates are now live in Filikod 1.2.0, available for free under the GPL license on WordPress.org.
Source:
Dev.to
Found something wrong in this article? Report an issue with this article
Comments
Leave a Comment