The preserved attachment
What remains on the existing attachment
These four facts show which parts of a published placement remain usable afterwards.
Attachment identity
The existing attachment ID and established URL stay in place.
Media metadata
The title, caption, alt text, and description remain attached to the same media record.
Content relationships
Posts, pages, and templates continue using the same record.
Image sizes
WordPress regenerates the image sizes for the replacement.
Replace File workflow
Complete the correction through the editor
The order matters because the final check should test the item opened at the start.
1
Find the media item
Start in the Media Library list, attachment details, a standard WordPress media modal, or Elementor attachment details when active.
2
Select Replace File
Open the replacement form for that item.
3
Choose and submit the replacement
Choose the one file that should take over, then send it through the form.
4
Confirm the established URL
Use the address that already appears in the content and confirm its response now serves the new file.
Automation inputs
Automation input choices
One route fetches a source; the other accepts encoded file data. Both update the selected media record.
media/replace-from-url
Pass one HTTP or HTTPS source. WordPress validates the address before download, then updates the selected attachment in place, so its identifier, metadata, and content links remain usable.
media/replace-base64
Give base64 file content when the bytes are already in hand. Inputs over 20 MB are rejected; accepted content changes the file behind the chosen record while its attachment identity and relationships stay attached.
Replacement boundaries
Checks before the operation changes storage
The selected attachment and replacement source determine whether the change can proceed and how the current file is protected.
Permission
The account must be allowed to upload files and edit the item selected for replacement.
Remote source
A remote replacement accepts only HTTP or HTTPS sources that pass WordPress URL validation.
Staging
Stage the new content first, then move the current file to a backup.
Rollback
If placement fails, restore the backup to the original path.
Runtime and integrations
Dependencies
Use these named requirements for the editor, runtime, and optional automation surfaces described above.
5.7 or later
WordPress 5.7Owns attachments, media metadata, permissions, and the Media Library replacement surfaces.
7.4 or later
PHP 7.4Runs Devenia Replace Media.
Automation clients
WordPress Abilities APIProvides the two registered media replacement operations to an automation client.
MCP clients
WordPress MCP AdapterExposes registered WordPress abilities to an MCP client.
Optional
ElementorAdds Elementor as an additional place to reach the replacement action.
The practical decision
Is the next edit for a record your site already uses?
Choose this download when continuity matters more than creating a second media item. Install it, then go to the relevant media surface and use the control provided there.
