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

So I have many custom user profile fields.

When I use do_action( 'show_user_profile', $profileuser ); hook it displays all custom user profile fields..

But I would like to show only certain fields.

For example

add_action('show_user_profile', 'add_extra_profile_fields1');

function add_extra_profile_fields1() {
    // add extra profile fields to user edit page

add_action('show_user_profile', 'add_extra_profile_fields2');

function add_extra_profile_fields2() {
    // add extra profile fields to user edit page

Now is there a way to display only add_extra_profile_fields2 using show_user_profile hook?

share|improve this question
up vote 0 down vote accepted

You could either find the hook that is outputting all those extra fields and use remove_action on it.

Or you can just create your own hook:

do_action( 'my_theme_show_user_profile', $profile_user );
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.