Author URL gives 404 if username has a dot (7 posts)

  1. nandanjha
    Posted 4 years ago #

    If a username has a dot then I do not see his profile page.

    Please see -

    Where it seems to be working for other usernames (regular, spaces etc)

  2. When I created a user on my test blog, the posts for author "user.name" showed up here:

    Which custom permalink setting are you using? What happens if you switch it to something else, and switch it back to the current setting?

  3. Sergey Biryukov
    WordPress Dev
    Posted 4 years ago #

  4. nandanjha
    Posted 4 years ago #

    @Naoko - Strange. It doesn't for me. I am not latest WP.

    I have a stage.ghumakkar as well. I am using "Day and Name" preset as the permalink. On stage.ghumakkar, I changed it to "Month and Name" and tried. If again gave me 404. Then I moved it back to 'Day and Name", still no luck.

    @ Sergey - Yeah, Thanks. At least for these particular users, I can ask them to use the workaround (use without dot) in their 'website' field of their profile. I utilize it to get the 'href' for their names, which is shown right below their posts.

    But this workaround wont help for my 'Authors' (ghumakkar.com/authors) page.

  5. Sergey Biryukov
    WordPress Dev
    Posted 4 years ago #

    What code do you use to display the profile links on the Authors page? I guess the_author_posts_link() or get_author_posts_url() should return correct results. If there's some custom code to build an URL, perhaps you need to replace display_name field with user_nicename.

  6. karrikas
    Posted 4 years ago #

    Hi all,

    I have the same problem. When users name has a dot gives a 404 error.

    I using the get_author_posts_url() to generate the url. I clean the .htaccess file using only the generated code and nothing. And with twentyeleven template give me the same error.

    Page with get_author_posts_url() function:

  7. karrikas
    Posted 4 years ago #


    I see the root of problem but I don't see the solution.

    On page /wp-includes/query.php line 2285
    $q['author_name'] = sanitize_title_for_query( $q['author_name'] );

    This function convert the user name
    before: i.larra
    after: i-larra

    If I comment this line the author.php page work fine.

    Any suggestion to solve the problem?


Topic Closed

This topic has been closed to new replies.

About this Topic