Fixing Author Names in Pretty URLs in WordPress

When you activate Pretty URLs in WordPress, the author URLs appear to use the author’s login name. This is not entirely true as it is using a different field in the database, but it defaults to the same value. This is not great for security or for SEO.One option is to go into the database and change the user_nicename field. This is not a sustainable option, though, as it leaves your users unable to handle user creation on their own through the admin panel. They would have to get you to update the database by hand every time they add a new user.

You could write your own script/hook to handle this, but why reinvent the wheel? There is a great plugin that handles this exact thing:

Edit Author Slug

After installing the plugin, go to “Users” and then click “Edit” for the user you want to update. You’ll notice a new section called “Author Slug” where you can now choose the author name variation to be used in the pretty URL.

There is an options area for “Edit Author Slug” as well where you can define a default. I chose not to activate this, though, as it removes some of the flexibility for each user/author to choose their preferred format. Depending on the type of site you are running, you may want to activate this to prevent users from straying from the standard.