Meow Apps

Media File Renamer: FAQ

If your images or links are broken, there is a special page only about this here: Updating References & Links.

General Issues & Questions

I recommend you the excellent Redirection plugin. And to make your life easier, the Media File Renamer has a little feature. Visit Media > Renamer, and in the Before / After section click on Display Filenames, and once done, on Export as CSV. You can use import this CSV file directly into the Redirection plugin.
You need to have the Pro version activated. Also, in your settings (Meow Apps > Renamer), you need to have Manual Renaming enabled.
Did you migrate your files from one server to another? This might have created an encoding issue between your files (DB and file path has a different encoding). A user found a solution to this issue, here.
Let’s say you modify the titles of your media while editing a post. The plugin cannot rename the files yet, because you are in the process of editing your post and the image links are in there. If that option is checked, when the post is actually saved (drafted, scheduled or published), then the images will be renamed and the links updated. If you don’t check this option, you would have to go to the Media Manager and click on the button “Rename Now” next to that image.

How to trigger the rename process?

If you are using plugins or tools which generate the posts and/or upload the images automatically for you, then Media File Renamer might not be able to rename those files as they are not considered new uploads. You will need to find out how to hook into that process, and then trigger the Media File Renamer manually.

Best is to ask the developer of the plugin you are using to automate your WordPress for the best way how to do it. Once you know where to hook, you simply need to call this function available globally: mfrh_rename( $mediaId ). Media File Renamer will rename this media entry depending on your settings.

How to customize the filenames?

We are all using different languages and our websites have different topics. Therefore, there are unlimited ways of automatically renaming filenames. Media File Renamer does it simply depending on the title you gave you the media. If you want to customize it, the best way is to implement this customization. You will need to be a developer of to get one to do it for you, but this is not too hard. The code below, for instance, will add “renamed-” in front of the filename proposed by the plugin. The $old filename is still accessible, and there is a reference to the attachment through the $post variable.

add_filter( 'mfrh_new_filename', 'my_filter_filename', 10, 3 );

function my_filter_filename( $new, $old, $post ) {
  return "renamed-" . $new;
}

Another filter allows you to do specify rules at the character level (but you can also specify whole strings).

add_filter( 'mfrh_replace_rules', 'replace_s_by_z', 10, 1 );

function replace_s_by_z( $rules ) {
  $rules['s'] = 'z';
  return $rules;
}