How to rename and replace Media attachments using WordPress plugin
Optimole supports renaming and replacing attachment files directly from the media library’s single edit view. This helps you manage and update media more efficiently, especially when keeping URLs, styles, and metadata consistent.
📝 Note: This feature is only available for attachments stored locally. Offloaded or DAM-imported media will not display rename/replace options.
📁 How to Access the Attachment Edit Screen
There are two ways to access the media file editing view where the rename and replace features appear:
- List View: Navigate to
Media > Library
, switch to the list view, then click Edit next to the desired image.
- Grid View: Click on the image in the grid, then click Edit more details in the sidebar.
⚙️ Features and Functionality
- Adds fields to rename and replace attachments.
- Automatically replaces all DB references, including those with
-scaled
suffixes. - It only allows files to be replaced with the same MIME type.
- Automatically sanitizes new file names.
- Automatically clears cached CSS and block cache from Elementor or Otter plugins when changes are made.
🔍 Initial Interface View
When opening the single attachment page, you will see a new section to rename and replace the media file:
📥 Replacing an Attachment
Once you upload a replacement file (with the same MIME type), the new file will replace the original, and all references across the site will update.
⚠️ Warning: Replacing a file is irreversible. The new file will completely replace the old one.
💡 Note: Files will be automatically replaced on the front-end of your website on places where old images were used.