How to Change the WordPress Author URL-/Slug Base

How to Change the WordPress Author URL-/Slug Base

This snippet will allow you to change the default WordPress author URL base from ie: “mysite.com/author/name”, to ie.”mysite.com/profile/name”. In this example we are changing the slug to “profile”, but you can change this to anything that you would like.

1. Add this code to your functions.php

add_action('init', 'wp_snippet_author_base');
function wp_snippet_author_base() {
    global $wp_rewrite;
    $author_slug = 'profiles'; // the new slug name
    $wp_rewrite->author_base = $author_slug;

2. The permalink settings have to be updated after adding the above snippet to your functions.php. This is simply done by navigating to: settings > permalink and click “Save Changes”.

Related plugins:

WordPress Hosting


  1. Hello, it does change url base but then I get a 404 on trying open a page that previously was myblog.com/author/anyone.
    What else is need, flushing the rewrites? How do you do that?

    1. @ezeocca – you need to flush the permalink settings by re-saving. Thank you for the reminder – I have added the additionel step in the instructions.

  2. I’ve got another question on this, hope someone has the answer:

    Do you need to run this function permanently in your functions.php file? It seems like you can throw out this code, once your URL base has changed, but is it that safe? I have no idea yet where all these changes are made, DB or so?

    Please advise, if you can.

  3. I love this function, because I can give any name in the slug. as right now I wanted to type author slug to “teacher”.

    Thanks WP-Snippets.

Leave a Reply

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