Phoenix Media Rename is a plugin that adds to WordPress the ability to rename files uploaded to the site, even if they have already been used within pages, posts or custom posts.
Just rename the file and Phoenix Media Rename will take care of updating all the contents of the site that use that file, so that everything continues to work as before.
Phoenix Media Rename is compatible with WPML and Polylang for managing the localization of multimedia files and with the most used content management plugins.
Phoenix Media Rename integrates AltText.ai, allowing you to automatically generate filenames during the upload or when editing alt tex.
How to use Phoenix Media Rename with WPML
How to rename multiple media files at once
How to retitle multiple media files at once
How to rename media files by taking the file name from the title of the post they are attached to
How to retitle media files by taking the title from the title of the post they are attached to
Options: how to avoid removing accents in file names
Options: how to avoid processing revisions
Options: how to automatically create 301 redirects
Options: how to serialize file names
Options: set constants at the beginning or end of the file name
Options: enable AltText.ai integration
How to use the plugin via code
How to integrate Phoenix Media Rename and third-party plugins
Where to Download Phoenix Media Rename
How to use Phoenix Media Rename with WPML
Make sure the WPML Multilingual CMS and WPML Media Translation plugins are active (you can find more information about WPML at WML official website).
Add one or more images to your media library, WPML Media Translation will add the localized version to the library.
Go to WPML -> Media Translation and edit the localized version of your media files, you can change both the title of the image and the file attached to the localized version.
Go to your media library, select the “rename” operation, select all the files you want to rename, change the filenames and confirm the operation, Phoenix Media Rename and WPML will do the rest!
Allows you to rename one or more files
How to rename a single file
To rename a file, go to the Media section of the admin panel and open the file of your choice. You will see a new field named “File Name” containing the name of the current file. Change the name as you like and press the “Update” button.
How to rename multiple media files at once
To go to the Media section of the admin panel, select the mass action “Rename” or “Rename and edit title” (if you want the media to also be retouched) from the drop-down menu, select the media you want to rename and edit the file names using the “File name” fields in the last column.
When you’re done press the “Apply” button and let the plugin do its magic!
How to retitle multiple media files at once
To go to the Media section of the admin panel, select the mass action “Retitle” from the drop-down menu, select the media you want to retitle and edit the titles using the “File name” fields in the last column.
The text you enter will be used for both the file name and the title, but the file name will be sanitized (if the “sanitize file name” option is enabled), while the title will not be sanitized.
When you’re done press the “Apply”!
How to serialize file names
You can serialize filenames by enclosing the variable part between { and }, this will cause Phoenix Media Rename to generate a sequence of filenames.
The variable part must be an integer, but can start with 0 (ex: 0023).
Please Note: Select all the files you want to serialize and write the name for the first one, see the screenshot below as a reference.
How to rename media files by taking the file name from the title of the post they are attached to
To use the title of the post linked to the media file as the file name, go to the Media section of the admin panel, select the mass action “Rename from post” or “Rename and retitle from post” (if you want the media to also be retitled) from the drop-down menu, select the files you want to rename and press the “Apply” button.
The title of the post will be used for both the file name and the title, but the file name will be sanitized (if the “sanitize file name” option is enabled), while the file title will not be sanitized.
How to retitle media files by taking the title from the title of the post they are attached to
To use the name of the post linked to the media file as the file title, go to the Media section of the admin panel, select the mass action “Retitle from post” from the drop-down menu, select the files you want to rename and press the “Apply” button.
How to avoid removing accents in file names
Adva to the Phoenix Media Rename settings page and uncheck the “Remove Accents” option, this will avoid removing accents from file names.
NB: Avoiding accent removal can cause incorrect URLs on some hosting.
How to avoid processing revisions
Phoenix Media Rename allows you to avoid updating page and article revisions by updating only the current version, to speed up the process of updating data.
To disable revision update, go to the Phoenix Media Rename settings page and uncheck the “Update Revisions” option, this will avoid updating revisions.
NB: Preventing revisions from updating will speed up the process of renaming files, but it can cause broken links if you re-send a post back to a previous version.
How to automatically create 301 redirects
When you rename a file, Phoenix Media Rename automatically creates 301 redirects, so you can redirect traffic from the old file name to the new one and you don’t lose links pointing to the old file name.
To create a 301 redirect simply enable the “Create 301 redirects” option on the settings page.
Please Note: to create and manage 301 redirections you need to install and activate the free Redirection plugin
How to serialize filenames
The “Serialize file name if file exists” option automatically generates a serialized file name when a file with the name you are trying to use already exists.
If the option is enabled and you try to rename a file by giving it the name of a file already present in the destination folder (eg: phoenix.png), Phoenix Media Rename will automatically create a new name by adding a progressive number to the one chosen by the user (eg: phoenix1.png).
Set constants at the beginning or end of the file name
The “Filename header” and “Filename trailer” options allow you to specify constants to add to the beginning or end of the name of each file that is renamed.
Eg: by setting “phoenix-” in the “Filename header” field, every time you rename a file Phoenix Media Rename will automatically add “phoenix-” before the file name.
The options “Use category as filename header” and “Use category as filename trailer” gets the filename header or trailer from the category of the post the file is attached to.
Enable AltText.ai integration
To enable AltText.ai integration simply check the AltText.ai option.
How to use the plugin via code
The authors of themes and plugins can use Phoenix Media Rename via code, to rename media files efficiently and without user intervention.
The static “do_rename” function, present in class Phoenix_Media_Rename allows you to rename files from themes or plugins, The prototype is: do_rename($attachment_id, $new_filename, $retitle = 0, $title_from_post = 0, $name_from_post = 0, $check_post_parent = true ).
The function do_rename is a static method wrapped inside the Phoenix_Media_Rename class: call it using Phoenix_Media_Rename::do_rename
Is successful, the function returns 1, in the event of an error, it returns the error message.
How to integrate Phoenix Media Rename and third-party plugins
Phoenix Media Rename can be integrated in a very simple way with other plugins: the “pmr_renaming_successful” event that triggers when the renaming process is finished, returns the old and new filename.
Example:
/**
* my_callback
*
* @param [string] $old_filename
* @param [string] $new_filename
*/
function my_callback( $old_filename, $new_filename ) {
your code
}
add_action( 'pmr_renaming_successful', 'my_callback', 10, 2 );
If you need more custom actions write on the Phoenix Media Rename support forum or send an email to support@eurosoftlab.com
How to get help
For assistance use the official Phoenix Media Rename forum on the WordPress Web site.
Beas posting a request, make sure that there isn’t already a similar request that contains the answer to your problem.
Where to Download Phoenix Media Rename
Phoenix Media Rename is a free software, you can download the latest version from the page dedicated to Phoenix Media Rename on the WordPress website
Phoenix Media Rename updates itself through the WordPress plugin update mechanism, keeping it updated allows you to have access to all the new features and correction of any errors present in the installed version.