Hi;
I found a ‘solution’ to my problem as far as renaming the author link by applying this snippet.
add_filter( 'author_link', 'modify_author_link', 10, 1 );
function modify_author_link( $link ) {
$authorName = get_the_author_meta( 'display_name' );
$link = 'https://my-site-name.com/@/' . $authorName;
return $link;
}
My only problem now is that it shows the author link correctly in posts but when I click on it I get a ‘not found’ error.
Redirection problem perhaps? How would I solve that?
Thank you
Lode
-
This reply was modified 5 years, 4 months ago by
ndjworldnews.
-
This reply was modified 5 years, 4 months ago by
Yui.
Change author base plugin?
https://www.wpbeginner.com/plugins/how-to-change-author-url-slug-and-base-in-wordpress/
The problem removing the /author/ section of the site is that WordPress not know that it wasn’t a Page.
If anything, you could probably use the mod_rewrite rules from Apache :
https://httpd.apache.org/docs/current/mod/mod_rewrite.html
Or even a mod_alias :
https://httpd.apache.org/docs/2.4/mod/mod_alias.html
It’s not a great idea.
What’s your requirement for this ? You just don’t like it in the URL?
Hi
Thank you for the super fast response; A+ service.
I am using the edit author slug plugin which works but it won’t let me use a symbol or remove the sub-link all together.
What I am trying to accomplish is a more ‘direct’ feel to the link, like is done with Twitter, Facebook, Instagram and other social sites.
Example: twitter.com/user-name or instagram.com/@user-name route directly to the user page. It’s easy to type and remember for people.
Unlike my-site.com/author/user-name.
Thanks again for the fast response. Much appreciated.
Lode
I forgot to mention:
I already tried redirect in .htaccess but to no avail.
Any suggestions you may have are welcome.
Thank you.
Lode