How to hide fields from my user profiles

I want to hide the fields link nick name, first name, last name, etc.

I could not find an answer in the codex and I do not want to touch the core files.
Is there any solution for it?

1 Answer
1

Since there unfortunately indeed is no filter for this part of the profile, you have got two options, a hypothetically existing plugin aside:

1. Remove the fields with js (as is exemplified with the nickname field below)

jQuery(document).ready( function($) {
    $('input#nickname').closest('tr').remove();
});

2. Output buffer the generated markup and modify it before serving

In absence of a filter, if you want to do it cleaner and on the server side, you’d have to rely on output buffering the profile HTML at the time it is generated, modify it and thereafter serve it.

How to do that is excellently laid out in this answer, by example of the biography section.

Leave a Comment