change wordpress author slug

how to change wordpress author slug or URL base

Every custom them has option, Managing or change wordpress author slug is common in wordpress sites. you can use our come snippet for this for change author URL base. Some times you want to change the worpdress author URL slug then you can use the following code:
You need to add code into functions.php of your wordpress theme.

how to change wordpress author slug or URL base

That will change the default yoursite.com/author/authorname to yoursite.com/author-profile/authorname.
So you can change this to user or anything that you would like.

add_action('init', 'change_wp_author_base');
function change_wp_author_base() {
global $wp_rewrite;
$author_slug = 'author-profile'; // change author slug name
$wp_rewrite->author_base = $author_slug;
}

If you are facing any issue then write to me.

change wordpress author slug
change wordpress author slug

Published by

Purab

I am Purab from India, Software development is my profession and teaching is my passion. Programmers blog dedicated to the JAVA, Python, PHP, DevOps and Opensource Frameworks. Purab's Github Repo Youtube Chanel Video Tutorials Connect to on LinkedIn

Leave a Reply

Your email address will not be published.