WordPress functions for creating new users does not check wheather the usernames are valid (for having in URL:s etc.) So, if you have a wordpress site with some plugin that creates users with “funny characters” (such as spaces, national characters, etc.), this plugin will clean up the mess. (Yes, this is a real world scenario that did happen.)
This plugin will rename all your user’s usernames to something valid, still allowing your users to continue logging in with their old invalid username, so you do not have to instruct all your users to login in with the new valid username. This plugin will map old invalid usernames to the new valid ones.
Overall, what is considered a “valid” username is a bit of a mess in WordPress. You would expect the sanitize_user() function to return a username that works, but it does accept spaces, wildcard and at (@), which all will fuck up your authors’ archives URLs in WordPress. However, when creating new users in the wordpress admin, those characters are NOT valid. So, wordpress itself is not consistent on what is valid.
This plugin will only accept lower case a-z and 0-9. All other usernames will be rewritten.
The plugin also handles potential username conflicts, so you do not have to worry about dupes in the database after installing this plugin.
- Put the plugin in the WordPress
- Activate the plugin through the ‘Plugins’ menu in WordPress.
- If you have a lot of invalid users (like hundreds or thousands, then the first requests to your server after activating this plugin might take some time). You might have to reload a couple of times if your site is timing out. However, when the fist batch is converted, this will not happen again.
- Will this plugin work in WordPress MU environments?
Yes. It works great on MU!
- Where do I report bugs?
Report any issues at the Google Code issue tracker:
- What about the license?
Read more about GPLv3 here:
- Do you like beer?
If we meet some day, and you think this stuff is worth it, you may buy
me a beer in return. (GPLv3 still applies.)
This plugin gets the job done. Maybe appending a number to the end is not the most elegant solution, but it works out of the box.
There are improvements that can be done; if you have some wordpress experience, please help.
Contributors & Developers
“wp-valid-username-normalizer” is open source software. The following people have contributed to this plugin.Contributors
Interested in development?
- The first public release.