Finding duplicate images in a WordPress media library, without flagging WPML translations
说明与用途
在多语言 WordPress 站点中检测精确的图像重复,而不误报 WPML 翻译。使用字节级哈希、翻译集分组和缺失文件检测。
问题
Detecting exact duplicate images in a multilingual WordPress site without mistakenly flagging language‑specific attachments or breaking alt‑text audits.
结果
The updated Filikod plugin accurately identifies true duplicate images, removes false positives caused by multilingual attachments, flags orphaned files, and improves alt‑text audit scores without deleting or merging files.
工作流
- 1. Fingerprint each image file’s bytes and store the hash.
- 2. Detect duplicate hashes and group attachments sharing the same hash.
- 3. Load translation‑set mappings (WPML table, Polylang taxonomy, Bogo meta) to collapse groups per language set.
- 4. Apply the same rule to alt‑text audit: count alt duplicates only across distinct images.
- 5. Identify attachments whose file no longer exists on disk and list them with usage paths.
- 6. Suppress third‑party filters in admin queries using 'suppress_filters'=>true to get accurate counts.
- 7. Present results in the plugin UI: duplicate groups, redundant files, orphaned attachments, and upload‑time warnings.
证据
"I shipped duplicate image detection in Filikod, the free alt text audit plugin I maintain."
"After the fix the same library gave 29 groups and 30 redundant files."
"The scan finished with 232 images 'still waiting'. They were not waiting."
- 记录日期: 2026-09-22T08:30:27.542Z