| 开发者 | idesolutions |
|---|---|
| 更新时间 | 2026年11月6日 22:26 |
| PHP版本: | 8.0 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
media-switcheroo folder to /wp-content/plugins/ or install the ZIP through Plugins > Add New > Upload Plugin.This plugin keeps the existing Media Library URL. Requiring the same file extension prevents an existing .jpg URL from suddenly containing PDF data, or similar mismatches that can break browsers, servers, and existing links.
No. The existing WordPress attachment record is preserved.
Yes. The plugin changes the underlying file, not the attachment's editorial information.
Yes. WordPress attachment metadata and registered image sizes are regenerated after replacement, and image sizes that no longer apply are removed.
Yes. The plugin clears the cached data WordPress holds for the replaced file and attempts to purge supported page-cache, hosting, optimization, and builder caches that are detected on the site. It does not flush your whole object cache unless you ask it to. Developers can use the media_switcheroo/cache/purge action to integrate additional cache systems, or return true from the media_switcheroo/flush_object_cache filter to also flush the entire object cache.
The replacement keeps the same URL, which can cause browsers and CDNs to continue showing a cached copy of the old file. A replacement version is appended to media URLs on the public site so a new replacement produces a new cache key. It is not added in the admin or in the editor, so it is never saved into your posts.
Only if your site already allows SVG uploads. The plugin then checks the replacement before installing it and rejects SVG files that contain scripts, embedded HTML, event handlers, or references to anything outside the file (external images, links, stylesheets, or imports).
No. The plugin makes no external requests and does not track anything.
It removes the replacement version, date, and user values it stored on media items. Your media files and their details are not touched.
media_switcheroo/replaced, media_switcheroo/cache/purge, and media_switcheroo/flush_object_cache.