| 开发者 | onemorekrishna |
|---|---|
| 更新时间 | 2026年10月8日 22:58 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
clarvity-media-replace.zip and click Install Now. (Or unzip it into /wp-content/plugins/.)No. With "Keep the current filename" and the same file type, the image's URL doesn't change at all. When the URL must change (a new file type or filename, or new thumbnail dimensions because the aspect ratio differs), every stored copy of the old URL is rewritten to the new one.
They store the image's ID, and the ID never changes, so they show the new image automatically. This covers featured images, WordPress and WooCommerce galleries, ACF and other custom fields that store IDs, the site logo, site icon and header image, and Elementor image widgets. Custom fields and page-builder data that store URLs are updated by the URL rewrite.
All thumbnail sizes are regenerated from the new image. Each old size URL is mapped to the same size of the new image. If the new image is too small to have that size, the full-size image is used instead.
The current files are moved to a temporary folder first. If copying or processing the new image fails, the new files are deleted, the originals are moved back, and the attachment data is restored. Nothing is left half-changed.
Not with one click. The old file is permanently replaced, which is why the confirmation prompt asks you to acknowledge that. Keep a backup, or replace the image again with the old file.
The image file must be on the server's disk. If an offload plugin removed the local copy, the plugin stops with a clear message and changes nothing.
If a setting stores PHP objects, rewriting it could corrupt it, so it is skipped and the result message tells you how many entries were skipped. This is rare for image URLs.
Yes:
clarvity_mr_required_capability (filter): the capability needed to replace images. Default edit_others_posts.clarvity_mr_url_pairs (filter): the old => new URL paths about to be applied.clarvity_mr_replacement_targets (filter): the tables and columns searched for URLs.clarvity_mr_image_replaced (action): fires after a replacement, with the attachment ID, the replacement's ID and the URL pairs. Useful for purging caches.