How to change author url base on your WordPress site

Pasting the following code on your functions.php file will change the default yoursite.com/author/name to yoursite.com/profile/name.
Replace profile on line 4 by any slug you want.

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

Thanks to Kevin Chard for the cool tip!

Leave a Reply

Your email address will not be published. Required fields are marked *