Linux 软件免费装
Banner图

Clarvity Media Replace

开发者 onemorekrishna
更新时间 2026年10月8日 22:58
PHP版本: 7.4 及以上
WordPress版本: 7.1
版权: GPLv2 or later
版权网址: 版权信息

标签

media images media library attachments replace image

下载

1.0.0

详情介绍:

Need to swap a product photo, a team headshot or an outdated banner? Instead of hunting down every page, post, widget and page-builder section that uses it, open the image in the Media Library, click Replace Image, choose the new one, and confirm. Every place that used the old image now shows the new one. How it works The original library item is kept: same ID, title, alt text, caption and permalink. Only its file is swapped and all thumbnail sizes are regenerated. Anything that stores the image by ID keeps working with no changes at all, and any file URL that did change is updated automatically across the site. Features Privacy This plugin does not collect data, set cookies, or contact any external service.

安装:

  1. In wp-admin go to Plugins → Add New → Upload Plugin, choose clarvity-media-replace.zip and click Install Now. (Or unzip it into /wp-content/plugins/.)
  2. Click Activate.
  3. There are no settings. Go to Media → Library to use it.

升级注意事项:

1.0.0 First release.

常见问题:

Will this break my links?

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.

How are featured images, galleries and custom fields handled?

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.

What if the new image has a different shape or is smaller?

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.

What if something goes wrong halfway?

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.

Can I undo a replacement?

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.

Does it work with images stored in the cloud (S3, etc.)?

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.

Why is some data left unchanged?

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.

Can developers extend it?

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.

更新日志:

1.0.0