• ndjworldnews

    (@ndjworldnews)


    Hi;

    I would like to remove the “author” sub-link when accessing an author page; much like is done in Twitter.

    Example:
    mysite.com/author/author-name change to mysite.com/author-name

    Thus far I am using a plugin that lets me change the ‘author’ sub-link to another name but not remove it. Any suggestions how I can accomplish this?

    Thank you.

    Lode

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter ndjworldnews

    (@ndjworldnews)

    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 4 years ago by ndjworldnews.
    • This reply was modified 4 years ago by Yui.
    corrinarusso

    (@corrinarusso)

    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?

    Thread Starter ndjworldnews

    (@ndjworldnews)

    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

    Thread Starter ndjworldnews

    (@ndjworldnews)

    I forgot to mention:

    I already tried redirect in .htaccess but to no avail.

    Any suggestions you may have are welcome.

    Thank you.

    Lode

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Remove author base’ is closed to new replies.