How To Change the Author Link in WordPress

by

Hey there! Some links on this page may be affiliate links which means that, if you choose to make a purchase, I may earn a small commission at no extra cost to you. I greatly appreciate your support!

In this quick tutorial, you’ll learn how to change the author link in WordPress. Consequently, you’ll be able to link to any page when a user clicks on the author’s name.

Why Change the Author Link?

In some cases, the author link at the top of a blog post redirects to the home page. This odd redirection is actually not default behavior. In fact, the Yoast SEO plugin is the culprit. You see, when you disable the author archives feature, Yoast sets up a redirect from the author link to your home page.

Yoast SEO configuration wizard multiple authors archivesPin
Disabling author archives in Yoast SEO consequently redirects the author link to the home page

Whether that’s the case for you, or you simply want to link to a specific page, this can be accomplished with a few lines of custom code.

How To Change the Author Permalink in WordPress

Typically, the author permalink in WordPress looks something like this:

https://example.com/author/tony/

While redirecting this link to another page is an option, this isn’t good SEO practice. Instead, let’s add come custom code to link directly to a specific page.

The following code snippet links the author’s name to the about page.

// Link author name to about page
add_filter( 'author_link', 'my_author_link' );
function my_author_link() {
    return home_url( 'about/' );
}

It is recommended that you create your shortcode within a child theme. If you are using GeneratePress, I have a tutorial that walks you through the very easy process of installing a child theme.

Another option is to use a plugin like Code Snippets which allows you to run PHP code on your website. You never want to edit your theme directly as this comes with a risk of breaking things. It’s much safer to use a plugin or work within your child theme instead.

Save your changes and test it out! Now the author link takes you directly to the about page.

The code snippet above can obviously be modified to link to any page replacing the value inside home_url. For example, if your about page is at https://tonyteaches.tech/who-is-tony/ you can make the necessary changes to the code snippet.

YouTube video

If you have any questions about changing the author link in WordPress, let me know in the comments below. I know a lot of times, bloggers are a bit timid to add code to their website. Don’t worry, if you follow the steps above, I assure you that you won’t break anything.

If you found this blog posts valuable, subscribe to my YouTube channel for all my latest WordPress video tutorials and walkthroughs. My goal is to help website owners like you avoid having to pay thousands of dollars to hire a web developer though my free content.


Meet Tony

With a strong software engineering background, Tony is determined to demystify the web. Discover why Tony quit his job to pursue this mission. You can join the Tony Teaches Tech community here.

Leave a Comment


The reCAPTCHA verification period has expired. Please reload the page.