I am actively working on this page based on users’ request, issues, and questions. I am sorry if it seems a bit messy; I will make it clearer and better.
There are many themes and plugins available. Some of them manage images their own way, create their own metadata, hide important information in your database. Of course, Media File Renamer detects most of it and works perfectly on standard installs, but it can’t cover 100% of the WordPress installs, especially if they are a bit… exotic :) In those cases, the reference to the file might not be renamed and appear broken.
Before using the plugin, backup! That’s what you should do anyway, every day, or once a week, and before using a plugin that deletes/modifies files or database entries. Keep in mind that the plugin also has an Undo feature, you can enable it in the settings, then rollback a specific file to its original filename.
Timeouts, Big Installs, Slow servers
If you have a big install and/or a slow server, then you might experience timeouts. The plugin runs 2 to 4 queries on your database. Those queries replace the old filenames by the new filenames.
Here are a few workarounds:
- Disable Updating References in the plugin’s options (if you don’t need those updates)
- Increase the time before it timeouts (Increase limits)
- Optimize the SQL queries specifically for your install (that should be done by a good developer around you); have a look at the action_update_posts and action_update_postmeta functions in the plugin
- Any other idea? Please let a comment :)
I have been thinking of an alternative that could work: making the renaming asynchronous and renaming the files in the posts, parsing them one by one. Of course, that would be a bad alternative for those with no such issues as the plugin would become slower. Unfortunately, there are no other alternatives. I don’t think it’s an issue in the long run, installs are getting better, and hosting services faster.
Have you moved your WordPress to a new hosting service?
This is a really annoying issue as it is very technical, and difficult to resolve. It also impacts your WordPress install dramatically, even though… at first, everything seems to work perfectly.
Impacted WordPress installs are the ones using a lot of UTF-8 files. It means they contain a lot of non-ASCII characters, such as commas, quotes, accents, special characters, etc. Many of my clients had issues related to that.
How to resolve it? It’s best to ask your hosting service. But here is a quick idea for you: remove all the content of your /uploads folder, and re-upload the content of this folder from your previous hosting service by FTP using an option that enforces the usage of UTF-8.
My install is broken; how to debug?
- Take a screenshot and share the link to the page where the image is used on your website.
- Take a screenshot of the page where the image is used in your WordPress admin (we need to see the logical/technical link between what we see on the website and where the image is being set-up in the admin). For example, that image could be used in a simple post, so I need to see that image used in the post editor.
- In the case the image is used in one post, please share the HTML where the link to this photo appears.
- From what to what did you rename that image? Using which settings?
- You can enable the log in the File Renamer settings and try to rename that image to something else. Have a look at those logs, there might be something interesting in it.
- Last but not least, check your PHP error logs. Maybe an error happens and that breaks the renaming process.
Maybe it is not broken: The Cache Issue
WordPress installs are very cached nowadays. By plugins, by hosting services, CDN, etc. After renaming your files, you need to clear your cache. Not only your browser cache, but also your hosting service’s cache. And if you are using plugins to make your website faster, they will also have an option to reset your cache.
Sometimes the cache is cleared automatically, and you might know that. But for example, a plugin like WP Rocket (that does cache) doesn’t react when the meta for a post is updated, it does only clear its cache when the post itself is updated. So this is important: don’t believe the caching plugins are perfect, and clear your cache regularly.
Repair your WordPress
If there is no backup, then there are two things you can try:
- Un-Rename those files (= undo). There is an Undo option in the Advanced Settings of the plugin. Enable it and visit your Media Library. In the Rename column, you will notice a red arrow to come back, to undo. Click on it. You can bulk Undo in the Renamer dashboard.
- Install the Regenerate Thumbnails plugin and run it on those images (or all your images).
Using The Renamer’s Actions & Filters
If you have a developer working for you, then he/she will be able to understand how your install work, and to teach Media File Renamer how to update those references. You can use the mfrh_url_renamed (if you want to handle the new URL for this filename) or the mfrh_media_renamed (if you want to handle the filename on your server) actions. Have a look at the examples in the plugins/custom.php file in the plugin directory.