Archived topic
How to change author URL to "About Page"?
7 replies · Started by Tom on January 19, 2021
Hi,
I noticed that my author link points to a page (.com/author/author-name) that redirects to the home page. How can I set a custom author link so that I can point it to my About page instead?
Image here: https://drive.google.com/file/d/1gLFU8nsvihb6A1DGRhCDOXXSegXSMUq-/view?usp=sharing
Thank you!
Tom
Hi there,
Do you only have one author?
Let me know :)
Hmm, right now only 1 author (me) but I intended to add additional authors soon.
Really, what I'm concerned with is the SEO impact - if Google is crawling the author link and not finding the about page after.
Preferably, if there's a way to customize the link URL for each author to a specific page, that would be ideal.
You could do something like this:
https://docs.generatepress.com/article/generate_post_author_output/#custom-author-name
Gotcha. Works for a single author. For multiple authors, seems like I could use an IF statement and use the same replacement code to give them a custom URL page. If so, what field should I put in the IF statement?
I believe this should work:
add_filter( 'generate_post_author_output', function( $output ) {
if ( '2' == $author_id ) {
return '<a href="MY CUSTOM URL">My Name</a>';
}
} );
Great thanks, I'll try that for my next author.
No problem :)