WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I hover over the comment author link on my comments, it shows a link like http://mysitenameeeee.com/?author=24

After I click it, it gets me to /author/authorname, which is fine, but I don't want the link to be author=24 when I hover it. If I hover the post author link, it shows me the correct link to author.php. What is the difference, why and how can I solve it?

Here is the snippet:

<a rel="author" href ="<?php bloginfo('url'); ?>/?author=<?php echo $comment->user_id ?>"><?php echo $comment->comment_author?></a>
share|improve this question
How to fix it? Idk if you can change that. Wordpress assigns the user id number to users who have not posted, and uses the user name for users who have posted. (posted ie: written a post). – Ronburgundy Jul 20 '13 at 14:44
I think this is a duplicate of wordpress.stackexchange.com/questions/94565/… – do you agree? – toscho Jul 20 '13 at 15:07
up vote 0 down vote accepted

Use get_comment_author_link() instead of <a href … </a>:

echo get_comment_author_link();
share|improve this answer
Edit. Got it to work by adding /author/ in the href. Thanks mate! – Johan Jul 20 '13 at 15:31

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.