We’re no strangers to plugin development at Online Optimism, but we keep them specific and personalized, packaging out exactly the functionality we need for a site and placing it just where it’s needed. When we refreshed our brand and our website in spring 2025, though, we realized our next plugin might be something a little bit bigger than usual.
Tracking Down Image Usage
Refreshing, rebranding, or even fully rebuilding a website comes with plenty of challenges, including outdated content. Brand colors change, team members come and go, and old blog posts get scrapped. Plus, your WordPress Media Library holds all the images you’ve ever uploaded: your old logos, headshots, featured images, and so on.
The only information in the Media Library about where you might find each image is the “Attached To” property: the link to the page where the page was originally uploaded. But images can be used on more than one page, and if you uploaded anything directly to the Media Library, the “Attached To” property simply says “Unattached.” If you assume that property is the whole story and delete an “unattached” image, you could be deleting an orphaned image that was once used for a long-gone blog post… or an image you actually used on five other pages since then, which now all display placeholders (or worse, broken images).
This is such a key issue that we figured there had to be a plugin to handle it! But testing out the existing plugins we found, even trialing pro versions, we couldn’t find a single plugin that actually checked for everywhere an image file was used. Most plugins simply scan post content, which is barely a step up from the “Attached To” column when you consider custom fields, taxonomies, meta image tags… the list goes on. So we built one.
How Our Media Usage Tracker Plugin Works
The new Online Optimism Media Usage Tracker plugin covers everywhere you would typically find an image:
- Inside post content, naturally (including native WordPress gallery shortcodes, WPBakery page builder elements, and video poster images)
- In the Featured Image field for posts, pages, custom posts, or taxonomies
- In Advanced Custom Fields (including repeaters) and in any other type of custom field
- In Yoast OpenGraph and X social image fields
- In Yoast Site Representation fields, like the site logo and default image
- In Gravity Forms field choices, confirmation pages, and notification emails
- In wpDataTable cells, for both manual and automatic tables
Some of those locations store the image by its ID number; others store it by its filename, or by its file URL (with or without the website domain included). WordPress complicates this further by adding resizing suffixes: an image could be called Optimism.png when we upload it, but when we add it to a page at 1024px wide, the filename that’s stored in the content of that page is now Optimism-1024×576.png. And wpDataTables introduces a whole new layer of complexity by creating its tables directly in the PHP database, instead of as a custom post type.
The Media Usage Tracker plugin accounts for all of this—picking up the ID for each image it scans, retrieving its filename and its absolute and relative URLs, and checking in every post, page, taxonomy, custom field, and wpDataTable database entry for any of those identifiers.
Tracking down everywhere you used your old logo? Want to be sure you updated your headshot everywhere on the site? Scan it and the Media Usage Tracker will show you exactly which pages the image is present on, no matter how it was stored.
We covered ACF, Yoast, Gravity Forms, and wpDataTables since we frequently use those plugins and could easily test compatibility, but there are thousands of other WordPress plugins out there and many of them will have their own ways of storing images. Checking post content and custom fields will cover a lot of these cases, but if you find a situation where an image is stored and our plugin doesn’t detect its location, fill out the form to let us know! We’re looking forward to updating and expanding our plugin to cover as many use cases as we can.
Get the Media Usage Tracker Plugin Now
The new Media Usage Tracker plugin is available to download now in the WordPress plugin repository!
Request Plugin Support
"*" indicates required fields
Note: This plugin was developed with the assistance of Cursor AI, an AI-powered code editor that helped us draft use cases and troubleshoot bugs. It was reviewed by humans both on our team and on the WordPress Plugin Repository review team, and it will continue to be maintained by humans on our team. If you encounter any bugs, please contact us and let us know.