
Replace an existing WordPress attachment without creating another Media Library item or selecting a new attachment on every page.
A product photograph appears on a product page and two articles. If it needs correcting everywhere, open the existing Media Library item and choose Replace File. The pages continue to use the same attachment ID.
If one page must keep the old photograph, upload a separate attachment instead. Replacement changes a shared source; it does not create a per-page variation.
WordPress regenerates attachment metadata and available image sizes. A smaller replacement may not recreate an old thumbnail size. Fixed thumbnail URLs in page HTML, CSS, external messages or exported pages are not rewritten automatically.
Use the Media Library list, Edit Media screen or supported WordPress media dialogs. Elementor attachment details provide another entry point when Elementor is active. The normal Media Library workflow does not require Elementor or an AI client.
Save a separate copy of the old file if you may need it again. Replacement does not provide a permanent revision history or an Undo button.
Prefer the same file format and prepare dimensions suitable for every placement. Although an allowed replacement type updates the recorded MIME type, a web server can infer the served type from the retained filename extension. A different format under an old extension is not a dependable conversion workflow.
A changing v parameter is added to attachment and responsive image URLs produced through the supported WordPress filters. Each replacement gets a newer value, including repeated edits in the same second.
This does not purge every browser, page cache or CDN. Hard-coded URLs are not rewritten. Check representative pages and direct download links; clear the relevant cache or rebuild exported pages when needed.
When WordPress Abilities API is available, two operations are registered:
The account must have upload_files and permission to edit the selected attachment. Both operations use the same replacement function as the editor. A successful response includes the attachment ID, URL, MIME type, dimensions, version and message. A failed ability returns success: false with a message.
An MCP client needs a compatible connection to WordPress Abilities API. Automation is optional; replacing files through the Media Library works without it.
Read the product guide and WordPress documentation for image-size generation.