WordPress.org

Support

Support » Plugins and Hacks » Set a display name format as default

Set a display name format as default

  • Is there a way to set the display name format with a line of PHP in functions.php or the registration process?

    There are plenty hacks to get ‘Firstname Lastname’ into the display_name field in the database. This question is about setting the format -> ‘Display name publicly as’ in the dashboard.

    How can you set that format programmatically as a default for every user across the site/network? It now seems to default to the username.

    I think this query sets the format to first_name as default:

    UPDATE wp_users, wp_usermeta
    SET display_name = meta_value
    WHERE ID = user_id
    AND meta_key = 'first_name'

    So I would need a variation of this? Does it really require a database change? Won’t this create other problems?

  • The topic ‘Set a display name format as default’ is closed to new replies.