Changing the base of author links in the url

In WordPress the author’s page is usually linked to at the url /author/. We can easily change the author base in the link to anything we want using the wp_rewrite object. Simply add the following to functions.php.

add_action( 'init', 'change_author_url' );
function change_author_url()
	global $wp_rewrite;
	$wp_rewrite->author_base = 'writer';

After adding this function and action hook, the author links look like /author/. It should be noted that this will require updating the permalink settings in wp-admin by going to “Settings/Permalinks” and then clicking “Save Changes”. You don’t need to change the permalink settings, saving them updates the .htaccess file to update our permalink setting.

Changing the author slug in the url

Changing the author slug in the url requires a bit of doing. WordPress refers to the user’s nicename in the url which defaults to the user’s username. Add a function to update the nicename of a user to change the url. You can also use a plugin such as Edit Author Slug to change the user’s nicename that appears in the url and change the base of the url as well.