Title: Media Switcheroo
Author: idesolutions
Published: <strong>November 6, 2026</strong>
Last modified: November 6, 2026

---

Search plugins

![](https://ps.w.org/media-switcheroo/assets/banner-772x250.png?rev=3788088)

![](https://ps.w.org/media-switcheroo/assets/icon-256x256.png?rev=3788088)

# Media Switcheroo

 By [idesolutions](https://profiles.wordpress.org/idesolutions/)

[Download](https://downloads.wordpress.org/plugin/media-switcheroo.1.0.0.zip)

 * [Details](https://wordpress.org/plugins/media-switcheroo/#description)
 * [Reviews](https://wordpress.org/plugins/media-switcheroo/#reviews)
 *  [Installation](https://wordpress.org/plugins/media-switcheroo/#installation)
 * [Development](https://wordpress.org/plugins/media-switcheroo/#developers)

 [Support](https://wordpress.org/support/plugin/media-switcheroo/)

## Description

Media Switcheroo is a WordPress plugin for replacing files already stored in the
Media Library without changing the attachment ID or existing media URL.

It is designed for common maintenance tasks such as replacing an updated image, 
PDF, document, download, or other WordPress-supported attachment while keeping existing
references intact.

#### Features

 * Replace Media Library files in place.
 * Preserve the attachment ID and existing URL.
 * Preserve title, alt text, caption, description, and attachment relationships.
 * Support images, PDFs, documents, and other WordPress-supported media types.
 * Require the same file extension to avoid breaking existing links.
 * Regenerate image sizes and attachment metadata after replacement.
 * Regenerate supported PDF preview metadata through WordPress core.
 * Clear the cached data WordPress holds for the replaced file.
 * Purge supported cache and optimization plugins when detected.
 * Purge supported hosting caches when detected.
 * Clear Elementor generated-file cache when available.
 * Add a version value to media URLs on the public site after replacement to help
   defeat stale browser and CDN caches.
 * Add Replace File actions directly to Media Library workflows.
 * Check replacement files before they are installed, and restore the original if
   anything goes wrong.
 * Responsive WordPress admin interface.
 * No external service or tracking required.

#### Who can use it

Users who can upload files and edit the media item (or manage the site) can replace
it. Replacement files are checked against the file types your site already allows.

## Screenshots

[⌊Media Switcheroo screen and media selector.⌉⌊Media Switcheroo screen and media
selector.⌉[

Media Switcheroo screen and media selector.

[⌊Current media and replacement-file interface.⌉⌊Current media and replacement-file
interface.⌉[

Current media and replacement-file interface.

[⌊Replace File action in the Media Library.⌉⌊Replace File action in the Media Library
.⌉[

Replace File action in the Media Library.

[⌊Replace Media File option in Attachment Details.⌉⌊Replace Media File option in
Attachment Details.⌉[

Replace Media File option in Attachment Details.

## Installation

 1. Upload the `media-switcheroo` folder to `/wp-content/plugins/` or install the ZIP
    through Plugins > Add New > Upload Plugin.
 2. Activate Media Switcheroo.
 3. Go to Media > Media Switcheroo or use the Replace File action for an existing Media
    Library item.
 4. Select a replacement file with the same file extension.
 5. Select Replace Media.

## FAQ

### Why must the replacement use the same extension?

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.

### Will the attachment ID change?

No. The existing WordPress attachment record is preserved.

### Will my alt text, title, caption, and description stay?

Yes. The plugin changes the underlying file, not the attachment’s editorial information.

### Are image thumbnails regenerated?

Yes. WordPress attachment metadata and registered image sizes are regenerated after
replacement, and image sizes that no longer apply are removed.

### Does it clear caches?

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.

### Why does the plugin add a query string to replaced images?

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.

### Can I replace SVG files?

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).

### Does it send any data anywhere?

No. The plugin makes no external requests and does not track anything.

### What does it do when the plugin is deleted?

It removes the replacement version, date, and user values it stored on media items.
Your media files and their details are not touched.

## Reviews

There are no reviews for this plugin.

## Contributors & Developers

“Media Switcheroo” is open source software. The following people have contributed
to this plugin.

Contributors

 *   [ idesolutions ](https://profiles.wordpress.org/idesolutions/)

[Translate “Media Switcheroo” into your language.](https://translate.wordpress.org/projects/wp-plugins/media-switcheroo)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/media-switcheroo/),
check out the [SVN repository](https://plugins.svn.wordpress.org/media-switcheroo/),
or subscribe to the [development log](https://plugins.trac.wordpress.org/log/media-switcheroo/)
by [RSS](https://plugins.trac.wordpress.org/log/media-switcheroo/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 1.0.0

 * Initial release.
 * Replace Media Library files in place while keeping the attachment ID and URL.
 * Regenerate image and PDF metadata and remove stale image sizes.
 * Staged installation with rollback, uploads-directory and symlink protection, 
   and server-side size, type, and image validation.
 * Validation of SVG replacements that blocks scripts, embedded HTML, event handlers,
   and external references.
 * Clear the replaced file’s cached data and purge supported cache plugins, hosting
   caches, and Elementor generated files.
 * Add a replacement version to public media URLs (including resized images) to 
   defeat stale browser and CDN caches.
 * Replace File actions in the Media Library and Attachment Details.
 * Developer hooks: `media_switcheroo/replaced`, `media_switcheroo/cache/purge`,
   and `media_switcheroo/flush_object_cache`.

## Meta

 *  Version **1.0.0**
 *  Last updated **1 day ago**
 *  Active installations **Fewer than 10**
 *  WordPress version ** 6.8 or higher **
 *  Tested up to **7.1.4**
 *  PHP version ** 8.0 or higher **
 * Tags
 * [cache clear](https://wordpress.org/plugins/tags/cache-clear/)[media library](https://wordpress.org/plugins/tags/media-library/)
   [media replace](https://wordpress.org/plugins/tags/media-replace/)[replace image](https://wordpress.org/plugins/tags/replace-image/)
   [replace pdf](https://wordpress.org/plugins/tags/replace-pdf/)
 *  [Advanced View](https://wordpress.org/plugins/media-switcheroo/advanced/)

## Ratings

No reviews have been submitted yet.

[Your review](https://wordpress.org/support/plugin/media-switcheroo/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/media-switcheroo/reviews/)

## Contributors

 *   [ idesolutions ](https://profiles.wordpress.org/idesolutions/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/media-switcheroo/)