User Management

Is it just me that hasn’t been using the right search terms, or is is very messy to remove sections from the user profile?
Is there any way that this could be improved?

1 Like

It’s been awhile since I’ve mod’d the user profile, but, from what I recall, it was (almost) all done with filters… and a sprinkle of CSS. If you enumerate the items you’re wanting to remove, it’s likely someone will come up with a simple snip for you.

This is from an old question from Stackexchange, but the updated answers have not really changed significantly.

There is no dedicated hook – user management is a low priority in WordPress. You have to use output buffering (yes, not nice).

I could not imagine that there wouldn’t be filters for this by now, which is why I thought it may eventually need a petition.

I would be very happy to have been mistaken about this.

To remove the Bio field…since this is in the admin area, you’ll need to enqueue a custom style sheet for the back end. Since it’s only needed on one single screen, a check for that makes sure your style isn’t loaded needlessly.

If you have a utility plugin for the site, create a /styles/ (or whatever) directory within and save the following line there in a file called custom.css (or whatever).

tr.user-description-wrap {display:none;}

Next, drop the following few lines into your utility plugin’s PHP file.

function add_css_to_hide_user_bio() {
    $screen = get_current_screen();
    if ($screen->base === 'profile') {
        wp_enqueue_style('remove-user-bio', plugin_dir_url(__FILE__).'styles/custom.css');
    }
}
add_action('admin_enqueue_scripts', 'add_css_to_hide_user_bio');
2 Likes

I’ve expanded on the above to show how to remove any element from the profile page with CSS.

1 Like

Posting here to document some discussions to make it easier to find for future reference.

We need to talk about the standard meta keys in the user meta table.

1 Like