In WordPress by default, every user gets the URL slug is “author” and for some e-commerce, store, or finance website it dosesn’t suite.
For eg: You have an store website which have the Admin users, and also the other members. But when you look to the URL of your website. It will show you something like this “http://yourwebsite.com/author/john/”.
And that would not suite to the store website. It should be “seller”, “retailer” or something else.
So How would we change the WordPress author base slug?
Don’t worry we have posted here the code snippets that will help you to easily customize the author slug from “author” to whatever you want.
Just follow this guide:
Change WordPress Author Slug
We are going to show you first few examples
Below we have embedded the code snippets that you need to put in your WordPress theme.
For that:
Just copy the below code and paste it into your theme’s functions.php file.
Read also: Display a Custom Gravatar for Your Comments in WordPress
Then change value of variable $author_slug
from seller
to writer, agent or whatever slug you want.
Code to Edit Author URL Slug
That’s it.
The above code is tested in WordPress 4.8 version and hopes it will work in future wp version.
If you got any error or have the question or wanna say thanks, then comment below in the comment box.
Also, don’t forget to share this guide, if it helped you.
The title of this article is misleading. It’s not changing author slug. It should be changing author base.
thanks for this lovely help