WordPress is a fantastic platform, but sometimes it sets things up in a way that isn’t ideal for SEO or branding. One common area of concern for many site owners is the author URL slug. By default, WordPress uses the author’s username to create the slug for their archive page (e.g., yourwebsite.com/author/john-doe
). While functional, this might not always be what you want.
Perhaps your username isn’t very professional, or you’ve got a personal username that you don’t want publicly displayed. Maybe you simply want to optimize your author URLs for better search engine visibility. Whatever your reason, changing the author URL slug in WordPress is definitely possible!
In this post, we’ll explore a couple of methods to achieve this, from simple plugin solutions to a bit of code for those who prefer a more hands-on approach.
Why Change Author URLs?
Before we dive into the “how,” let’s quickly touch on the “why”:
- SEO Optimization: A clean, keyword-rich URL slug can contribute to better search engine rankings. If your username is generic, changing it to something more descriptive of your content or brand can be beneficial.
- Branding and Professionalism: Your public-facing author URL should reflect your brand or professional persona. A username like “supergamer123” might not be ideal for a professional blog.
- Privacy: Many people use their real name or a variation as their WordPress username. If you prefer to keep that private, changing the author URL slug allows you to do so without changing your login credentials.
- Consistency: If you’re rebranding or have a specific URL structure in mind, modifying author slugs helps maintain consistency across your site.
Advanced: Code-Based Method (No Plugin)
Prefer not to use a plugin? Add this to your theme’s functions.php:
add_action('init','custom_author_base');
function custom_author_base(){
global $wp_rewrite;
$wp_rewrite->author_base = 'members'; // replace with your desired base
}
Flush rewrite rules by visiting Settings → Permalinks → Save Changes. This method changes only the base—not slugs per user.
Advanced: Working Code-Based Method (for Custom Author Base)
when changing the author base via code and using a different base (like team
, writers
, or anything other than author
), WordPress won’t automatically generate proper rewrite rules unless you manually register them.
Let’s fix that by properly registering a rewrite rule and flushing permalinks the correct way.
function custom_author_base() {
global $wp_rewrite;
$wp_rewrite->author_base = 'members'; // Change 'profile' to any slug you want
$wp_rewrite->author_structure = '/members/%author%';
}
add_action('init', 'custom_author_base');
function flush_rewrite_once() {
remove_action('init', 'flush_rewrite_once');
flush_rewrite_rules();
}
add_action('after_switch_theme', 'flush_rewrite_once');
Important: Don’t keep flush_rewrite_rules() running on every load. It should be used once after changes (manually by saving permalinks, or during plugin activation)
Step 1: Install “Edit Author Slug” Plugin
- In your WordPress dashboard, navigate to Plugins → Add New.
- Search for Edit Author Slug by Brandon Allen.
- Click Install Now, then Activate.
This lightweight plugin gives you full control over the author base and individual slug without coding.
Step 2: Customize Each Author’s Slug
- Go to Users → All Users, then click Edit under a username.
- Scroll to the Edit Author Slug section:
- Choose from name-based options, role-specific slugs, or enter a Custom Slug.
- Click Update User to save.
- Head to Settings → Permalinks and click Save Changes to flush rewrite rules.
Visit their profile page to verify the new URL slug—e.g. https://your-site.com/team/jane/
.
Step 3: Change the Author Base Site-Wide
- Still in your dashboard, go to Settings → Edit Author Slug (added by the plugin).
- Enter a new global base, such as
team
,contributors
, orwriters
. - Optionally, assign custom bases by user role (e.g.
staff
,guest
). - Save your settings, then refresh permalink rules via Settings → Permalinks → Save Changes.
You’ve now revamped the URL structure across your site—for example, https://your-site.com/staff/john/
.
Step 4: Redirect Old Author URLs (SEO-Friendly)
Changing URLs without redirects can cause 404 errors and hurt your SEO. To avoid this:
Option A: Redirection plugin
- Install and activate Redirection.
- Go to Tools → Redirection and add a redirect:
- Source URL:
/author/(.*)
- Target URL: e.g.
/team/$1
- Source URL:
- Enable logging for future redirect needs.
Option B: Use an SEO plugin
If you use AIOSEO or Rank Math Pro, their redirect managers can automatically handle author URL changes. wpbeginner.com
What You Need to Do
Paste the code into your theme’s functions.php file.
Go to Settings → Permalinks and click Save Changes (to flush rewrite rules).
Your author URLs should now load from /team/username/.
Leave a Reply