Change user’s display name programmatically

Just pasted your code into my functions.php with a different ID and checked the user’s page in /wp-admin/user-edit.php – it works, the value in Display name publicly as field is updated.

Most likely something is wrong with your output on the user page. Check your template file. Or, if you can’t find the problem, edit the question and update it by pasting only the relevant code from your template – not the entire template.

Leave a Comment