WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

As of now i'm using this code to echo user's profile url.

<?php echo esc_url( home_url( '/' ) ); ?>user/<?php echo $current_user->user_login ?>"><?php echo $current_user->user_login ?></a>

This link uses author base as "user". So when i change author base this link will be broken.

IS there any function available like current_user_profile_link() ?

share|improve this question
up vote 4 down vote accepted

Choosing the right template

As your "User Profile"-Page is something completely custom and not the admin UI user profile page, I'd suggest to take the uthor posts page instead:

get_author_link( true, get_current_user_id() );

Then modify this template.

Pretty URls

No need to go outside the WP template hierarchy. If you want something like ~/user, then use the Rewrite API.

share|improve this answer
Excellent solution. Thanks kaiser – Giri Apr 3 '12 at 19:13

From Kaiser answer, get_author_link function is deprecated

get_author_link is deprecated since version 2.1! Use get_author_posts_url() instead

So please try to use get_author_posts_url()

share|improve this answer

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.