WordPress Tricks

How to redirect Author Page URL to Different Page

Change Author Link or Redirect Author URL to different page

Sometimes you may need to change default author url to different page. Here I am sharing you the code which you can use without modifying the theme file.


function modify_author_posts_url( $author_posts_url, $author_id ) {
  // modify the URL here
  $author_posts_url = 'https://www.example.com/';
  return $author_posts_url;
}
add_filter( 'author_link', 'modify_author_posts_url', 10, 2 );

You can use Code Snippet plugins to use the code, here is the screenshot about how you can use the code.

Change Author Link or Redirect Author URL to different page  using Code Snippet

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s