| 开发者 | gwalter75 |
|---|---|
| 更新时间 | 2026年8月24日 23:04 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
wp-config.php says so, so a deleted image is simply gone from the server.
Image Locator brings its own — the SEO'n'AI Trash for unused Images, switched on from day one. Every image the plugin deletes goes there first: the file stays on the server, the image keeps its attachment ID, and one click puts it back so that every post, page and page-builder element referencing it works again. A file from a backup cannot do that — it returns with a new ID, and the gaps stay.
That turns the honest limit of any scanner into something you can live with. Delete, then look at your website, then empty the trash. And if the site does run WordPress' own media trash, the plugin recognises it and uses that one instead.
Where it looks
The scan searches the database, not just the post content:
wp-config.php contains define( 'MEDIA_TRASH', true ); — and no plugin can switch it on for you, because WordPress settles that constant before plugins are even loaded. That is why the plugin keeps its own instead of promising something it cannot deliver.
Where it lives: on Media → Image Locator — every deleted image with a preview, the day it was deleted, the days left before WordPress clears it, "Restore", "Delete permanently" and "Empty trash". Without MEDIA_TRASH, the media library itself does not list trashed images; that is WordPress, not the plugin, and the reason the trash has its own page here.
Three ways lead into it, and they all belong to this plugin: the bulk action "Move unused to SEO'n'AI Trash (verified)" in the media list, the "Move to SEO'n'AI Trash" link under an image in list view, and the button on an image's usage page. What WordPress itself calls "Delete permanently" stays exactly that and removes the file at once — in the list as well as in the grid view, where WordPress offers plugins no place for an extra action. If you want every deletion on the site to be caught, add the wp-config.php line above; the plugin then steps aside and uses WordPress' own media trash.
Mind the clock: WordPress empties the trash by itself after 30 days (EMPTY_TRASH_DAYS). Do your check within that window. On a site that sets EMPTY_TRASH_DAYS to 0, no trash of any kind is possible — the plugin says so plainly instead of promising a net it cannot hold.
Installing, updating, removing: new installations start with the safety net on. A plugin update never changes the behaviour of an existing site; the switch simply sits on the tools page, ready. And if you ever delete the plugin, it puts every image it had trashed back into the media library before it uninstalls itself — nothing is left behind that WordPress would quietly clear out later. Deactivating does not touch anything, but the plugins screen warns you while images are still in the trash.
Without the net, deletion is permanent and removes the actual files, like WordPress' own delete. Keep backups either way.
Honest about the limits
A database scan cannot see everything. Images hard-coded in theme or plugin template files, images referenced from custom CSS, and use on other websites are invisible to any plugin of this kind. Treat "unused" as strong evidence, not as a court ruling — that is exactly why the bulk delete re-checks each image, and why nothing is ever deleted automatically.
Disclaimer
This plugin is a tool, not a promise. It reads your database and reports what it finds; it cannot see images hard-coded in theme or plugin template files, referenced from custom CSS, or used on other websites. Deleting images is always your decision and your responsibility: every deletion is started by you and confirmed by you. The trash buys you time to notice a mistake, but it is not a backup and it does not last forever — once it is emptied, by you or by WordPress after 30 days, the files are gone. Verify the findings before you delete (the usage page exists exactly for that) and keep backups. The author accepts no liability for deleted images, broken layouts or any other consequences of using this plugin.
Performance
The media list never scans on render — the column reads only cached results. Scanning happens when you ask for it: per image with one click, or for the whole library in batches with a strict time budget per request. When content changes, existing results are marked as outdated instead of silently lying to you.
One honest trade-off: a full library scan takes time on large libraries. Every image is checked individually, with the same logic that runs before any deletion — one truth, one code path. On a library with thousands of images that can take a while; on a typical site it is a few minutes, and it is a one-time cost — after the first full run, "Check new images" only looks at new uploads. To really catch everything, thoroughness beats speed. The front end of your site is never touched either way.
seonai-image-locator folder to /wp-content/plugins/, or install it through the plugin installer.Yes, within honest limits. Builders like Elementor, Divi and WPBakery store image references in post meta — as attachment IDs, as file URLs, or both. The scan searches post meta for the ID patterns and for every file name variant of the image. Exotic storage formats a builder might invent can escape any scanner; the live re-check before deletion is the safety net.
Something on the site changed since that image was last checked — any saved post or updated widget triggers it, for all images at once. It is not a statement about this particular image: if you have not placed the image anywhere since, the result still stands, and unused is still unused. Re-check the image or re-run the library scan to make it fresh. Bulk deletion never relies on outdated results anyway — every image is re-checked live right before deletion.
That is thoroughness, not a hang — the progress counter shows the current run moving. Every image is checked individually against content, custom fields, page-builder data, widgets and term images, using the same logic that runs before any deletion. Large libraries with thousands of images take correspondingly long; to really catch everything, that time is the price. Keep the tab open — the scan works in small batches and cannot time out. It is a one-time cost: after the first full run, "Check new images" only scans new uploads.
No. Everything runs in the admin, and the media list reads only cached values. The visitor-facing site is never touched.
Because deleting images is the one step here that cannot be undone, and WordPress ships with the media trash switched off. A plugin cannot switch it on — the constant MEDIA_TRASH is settled in wp-config.php, before plugins load. So the plugin does the next best thing with WordPress' own mechanism (wp_trash_post()): images it deletes are moved to a trash and can be restored with their original ID from Media → Image Locator. If your wp-config.php does set MEDIA_TRASH, the plugin uses WordPress' media trash instead and stays out of the way.
Walk through the places a scan cannot look into: the home page, sliders and hero areas, category and product pages, a few older posts, and any page your builder or theme assembles from its own files. Images hard-coded in template files or referenced only from CSS are invisible to any database scan — if one of them is missing, you will see the gap there. Restore it from the trash and you are done. Only empty the trash once you are sure. Remember that WordPress empties it on its own after 30 days.
Deleting the plugin is safe: before it uninstalls itself, it restores every image it put in the trash back into the media library — with the original ID, as always. Nothing of yours is left behind in a place you cannot see.
Deactivating is different, and the plugin warns you about it right on the plugins screen while images are still in the trash. Trashed images stay trashed, the media library does not list them (that is WordPress without MEDIA_TRASH), and WordPress deletes trashed items for good once EMPTY_TRASH_DAYS have passed — with or without this plugin. So restore what you want to keep before you deactivate; one button on the plugins screen or in the trash view does it for all of them at once.
Never. Deletion happens only when you select images and run the bulk action yourself — and even then, every image is re-checked live first.
No plugin can guarantee that, and you should distrust any that claims to. Hard-coded template references and external use are invisible to a database scan. That is why deletion is manual, warned, and re-checked.
image_id="123|full" are now detected.image_ids="…") and classic [gallery ids="…"] shortcodes.