0

There are several questions here on wordpress.SE that explain how you can change the author slug in the author permalink URL, e.g. from http://your.blog.tld/author/author_slug/ to http://your.blog.tld/author/whatever-you-want-it-to-be/.

But I do not want to change the author slug. I want to:

Change the whole author permalink to point to an external site

For example, I might have a blog at http://my.blog.tld/, of which I am the only author, and I want my author name under my posts to link to http://www.my-site.tld.

How can I implement this?

I would prefer to do this as a plugin, that is, without changing any other files, but if that is not possible I will edit whichever file is necessary.

I know that there is the Google+ Author Information in Search Results plugin, but this is a bit more complex than I know how to adapt, and out of the box it does not work with my latest WP installation.

1

You can override the author link via the author_link filter:

function wpd_author_link( $link, $author_id, $author_nicename ){
    return 'http://my.blog.tld/';
}
add_filter( 'author_link', 'wpd_author_link', 20, 3 );

$author_id and $author_nicename are available to the filter so you can fetch whatever data you need to generate the correct link.

Your Answer

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