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

I have created a page "profile" that when visited with get variable of user id like:


Then it will display the profile details of user id 1. Now I want to rewrite …


… to …


How to accomplish this?

share|improve this question
  1. Create an endpoint for EP_ROOT named profile.
  2. In your callback handler use get_user_by( 'slug', get_query_var( 'profile' ) ) to find the user data.
  3. Create a template file profile.php and use locate_template( 'profile.php', TRUE ) to load it.
  4. In your template show the user data.
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.