1

I'm kind of new to WP and am starting to delve into the WP codex and don't know how to figure out how to change a default slug. Say I have a url to an individual author like so:

https://www.website.com/author/authors-name/

How would I change /'author'/ to something else like 'people' or 'agents' ?

2

You can add the code below to your theme's function.php or in your own custom plugin...

function custom_author_slug() {  
    global $wp_rewrite;  
    $new_slug = 'people';
    $wp_rewrite->author_base = $new_slug;  
}
add_action('init', 'custom_author_slug');  

After you do it go to your admin then to Settings > Permalinks and click "Save Changes" which will trigger a flush of the WordPress rewrite rules (or you can flush rewrite rules programmatically).

There is also an Edit Author Slug plugin that you could use, but I'd recommend going the code route when possible since it's unlikely something you will need to change again and it's such a small change.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.