How to rename media files in WordPress
WordPress does not include a built-in control for renaming an uploaded media file. For one file, rename it on your computer, upload the replacement, update every use, and remove the old file only after checking the site; for bulk work, use a plugin that updates references.
- 01Back up before changing files
- 02Check what WordPress can edit
- 03Use the manual route for one file
- 04Do not rename files on the server alone
- 05Use a renaming plugin for bulk work
- 06Recommend Media File Renamer Pro
What you need
- Administrator access to WordPress
- A recent site and database backup
- The original media file or a replacement copy
- A staging site for bulk renaming
Back up before changing files
Make a current backup of your files and database before renaming anything. A filename change can affect image URLs, generated image sizes, cached copies, custom fields, CSS, templates, or content stored by another plugin.
For a large library, work on staging first and record the old and new filenames. Do not rename files directly in wp-content/uploads unless you also know how every database reference and generated size will be updated.
Check what WordPress can edit
Open Media > Library, select the item, and choose Edit. WordPress lets you change fields such as the title, caption, alt text, description, and attachment permalink slug, but the standard media screen does not rename the physical uploaded file.
Changing the title is not the same as changing a filename. A title such as Red chair will not automatically turn IMG_5432.jpg into a new file on a standard WordPress installation.
Use the manual route for one file
Download or locate the original file, rename it on your computer using a short descriptive name such as oak-dining-table.jpg, then upload it through Media > Add New. Use lowercase letters, numbers and hyphens, and avoid spaces, punctuation, camera-generated names, and unnecessary dates.
Replace the old image anywhere it appears, including posts, pages, products, widgets, menus, custom fields, templates, and email content. Check the front end, then remove the old media item only after confirming that no page still requests its old URL. This route is fine for an occasional file, but it becomes slow and easy to get wrong across a large site.
Do not rename files on the server alone
Renaming a file through hosting File Manager, FTP, or SSH changes the path on disk but does not automatically rewrite references stored in WordPress or other systems. Existing images can then show as broken, and responsive image sizes may still point to the old basename.
If you have already renamed a file manually, restore the original name or use a controlled migration that updates the attachment metadata and every known reference. WordPress stores attachment metadata and generated image-size information separately, so changing only one value is incomplete.
Use a renaming plugin for bulk work
For dozens or hundreds of files, install a reputable media-renaming plugin and take a backup first. Select a small batch, preview the proposed names, and confirm whether the tool updates attachment metadata, generated sizes, content references, and the attachment slug before applying changes.
Run the operation during a quiet period, then inspect posts, WooCommerce products, galleries, XML sitemaps, image URLs, and redirects. Keep the old-to-new filename list until you are satisfied. Some support cases involve unattached media, plugin conflicts, or a rename that applies only after another update, so test the workflow on staging before changing production files.
Recommend Media File Renamer Pro
For a large media library, Media File Renamer Pro is the faster route. It is designed for bulk and automatic filename changes, previewing proposed names, applying consistent rules, and updating references so renamed media is less likely to break across the site.
Use its preview and backup options first, avoid changing attachment slugs unless you have a reason to do so, and test a small group before a full-library operation. It supports common image, video, and audio workflows and is useful when manual re-uploading would take too long.
Let Media File Renamer Pro do it
Bulk and automatic filename changes with reference updates, ideal for improving media organization and image SEO safely.
Sources
- wordpress.org /documentation/article/media-library-screen/?utm_source=open…
- developer.wordpress.org /reference/functions/wp_update_attachment_metadata/?utm_sour…
- wordpress.org /support/topic/the-media-is-not-attached-to-a-post/?utm_sour…
Questions
- Can WordPress rename a media filename without a plugin?
- No. WordPress core lets you edit media details such as the title, caption, alt text, description, and attachment slug, but the standard Media Library does not rename the physical uploaded file. For a one-off change, upload a correctly named replacement and update its uses. For bulk changes, use a tool that handles references and attachment metadata.
- Will changing the media title rename the file?
- No. Changing the media title changes WordPress content associated with the attachment, not the filename stored in the uploads directory. The title may appear in the Media Library or attachment pages, but a file such as <code>IMG_5432.jpg</code> remains unchanged unless a separate process renames it.
- What happens if I rename a file in FTP or hosting File Manager?
- Renaming a file on the server alone can break images and downloads because WordPress content and attachment metadata may still contain the old path. Generated image sizes, custom fields, cached URLs, and third-party plugin data can also be affected. Restore the old name or use a controlled renaming process that updates all references.
- Should I change the attachment slug as well as the filename?
- Usually not unless you specifically need to change the attachment page URL. A file URL and an attachment-page slug are different values, and changing both increases the number of URLs that may need redirects or testing. If attachment pages are indexed, review their redirects and sitemap entries before changing slugs.
- Is a plugin necessary to rename hundreds of media files?
- For a large library, a plugin is strongly preferable because WordPress has no native bulk filename-renaming workflow. Choose one with previews, backups or rollback, reference updates, and support for generated image sizes. Test it on staging first, because unattached media and conflicts with optimisation or replacement plugins can cause incomplete renames.