WP Manifestindependent plugin directory
manifest / media / hmdg-image-file-name-search-and-replace-bulker

HMDG Image File Search and Replace

A WordPress admin plugin that identifies and removes unwanted image filename suffixes (_converted, -converted, -scaled, etc.) appended by WP Engine, WP Smush, Imagify and similar tools. Scans the entire WordPress database, renames files, updates DB references, and registers 301 redirects.

by HMDG · github.com/felmerald-hmdg/hmdg-image-file-name-search-and-replace-bulker · website

0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/felmerald-hmdg/hmdg-image-file-name-search-and-replace-bulker/archive/refs/heads/master.zip

Version: 1.0.1 | Author: HMDG | Requires: WordPress 6.0+, PHP 8.0+


What It Is

A WordPress admin plugin that identifies and removes unwanted image filename suffixes — _converted, -converted, -scaled, -scaled-converted, and all variations — that are silently appended by WP Engine Smart Image Optimisation, WP Smush, Imagify, and similar tools during upload or conversion.

Example:

  • Before: https://disc.co.uk/wp-content/uploads/2025/04/Leg-2_converted.avif
  • After: https://disc.co.uk/wp-content/uploads/2025/04/Leg-2.avif

What It Does

  1. Scans every location where image URLs appear in the WordPress database:

    • Post content (Classic Editor, Gutenberg blocks)
    • Post meta — including Elementor JSON (escaped slashes) and Divi meta
    • wp_options (theme customiser, widget data, site settings)
    • Attachment GUIDs and _wp_attached_file records
  2. Displays a results table showing:

    • The original (broken) image URL
    • The clean URL it will become after fix
    • Every page/post where the image is referenced (with links)
    • File status (whether the clean file already exists on disk)
  3. Removes the suffix safely:

    • Renames the physical file on the server
    • Runs targeted REPLACE() SQL on every affected table
    • Updates the Media Library attachment record (guid + _wp_attached_file)
  4. Registers a 301 redirect from the old URL to the new one — so previously cached links, sitemaps, or external references never hit a 404.

  5. Exports scan results to a properly formatted Excel (.xlsx) file with columns:

    • Scanned Image URL
    • Redirected (Clean URL)
    • Pages / Posts That Have This Image
  6. Downloads itself as a ready-to-install plugin ZIP via the dashboard button.


Why It Was Built

HMDG manages 500+ WordPress sites hosted on WP Engine and Flywheel. The hosting platforms auto-convert images to AVIF/WebP and append _converted or -scaled-converted to filenames. When clients supply their own images with specific filenames for SEO or URL-consistency reasons, these suffixes break expected URLs across Elementor, Divi, post content, and site options simultaneously.

This plugin automates what would otherwise be 70+ manual edits per site.


Installation

  1. Download HMDG-Image-Search-Replace-v1.0.1.zip from the plugin dashboard
  2. Go to WP Admin → Plugins → Add New → Upload Plugin
  3. Upload the ZIP and click Activate
  4. Navigate to Image Fix in the WordPress sidebar

Usage

  1. Click Scan Site — the plugin scans the entire database
  2. Review the results table
  3. Click Remove on individual rows, or Remove All to fix everything in bulk
  4. Click Export to Excel to download a .xlsx report
  5. 301 redirects are registered automatically — no extra configuration needed

Important Notes

About the "Filename" Field in Edit Media

The Filename input visible in WP Admin → Media → Edit Media is added by Rank Math SEO (not WordPress core). When Rank Math renames a file it correctly updates the attachment record but does not update Elementor JSON, Divi meta, post content, or site options. This plugin handles all of those.

File Safety

  • If the clean file already exists on disk, the plugin skips the rename and just updates DB references
  • If the original file is missing from disk, DB references are still updated and a 301 is registered
  • No files are ever deleted — only renamed

Suffix Patterns Covered

Pattern Example
_converted Leg_converted.avifLeg.avif
-converted Leg-converted.avifLeg.avif
_scaled Leg_scaled.jpgLeg.jpg
-scaled Leg-scaled.jpgLeg.jpg
-scaled-converted Leg-scaled-converted.avifLeg.avif
_scaled-converted Leg_scaled-converted.avifLeg.avif
-scaled_converted Leg-scaled_converted.avifLeg.avif
_scaled_converted Leg_scaled_converted.avifLeg.avif
-scaledconverted Leg-scaledconverted.avifLeg.avif

Changelog

v1.0.1

  • Added 301 redirect registration (old URL never 404s)
  • Added Excel .xlsx export (native ZipArchive, no dependencies)
  • Added plugin self-download as installable ZIP
  • Added Rank Math filename field explanation in dashboard
  • Added CSV fallback if ZipArchive unavailable

v1.0.0

  • Initial release
  • Full database scanner (post content, postmeta, options, attachments)
  • Elementor JSON double-pass (escaped slash support)
  • Divi meta scanning
  • Individual and bulk remove actions
  • Bootstrap 5 + vanilla JS UI