Force the user field display_name to be set as the user’s first and last name.

Force First Last Splash Banner

This plugin hides the “Display Name” field on the Edit Profile screen for all users. Instead of allowing users to set this field, the plugin will always set the User field display_name to their first and last name. If these field are empty, display_name will be set to their username.

Display names are set when the user registers as well as when a user’s profile is updated via the WordPress admin.

The plugin includes a batch process to update the display name for existing users. Navigate to Settings > Force First Last in the WordPress admin to run the update.

Paid Memberships Pro Compatibility

This plugin is now compatible with Paid Memberships Pro. The “Display Name” field is hidden from the frontend Member Profile Edit page. Display Name is automatically set when this form is saved. Display Name will also be updated at membership checkout if you are capturing the member’s first and last name via custom user fields or when using the Add Name to Checkout Add On.

Installation Instructions

  1. Upload force-first-last to the /wp-content/plugins/ directory.
  2. Activate the plugin through the ‘Plugins’ menu in WordPress.
  3. Visit Settings > Force First Last to run an initial update for all of your users.

Modify Display Name Format

The plugin supports one filter to modify how the display_name is set. You can use this filter to set the user’s name to just their “First Name” or to reverse the display name as “Last Name First Name”.

Once that’s code is in place, whether through a custom plugin or the Code Snippets plugin, you can run the script to retroactively update all users from the Force First Last admin settings page under “General”.


Screenshots

Display Name field is removed from the User Profile in WordPress admin.
Display Name field is removed from the User Profile in WordPress admin.
Navigate to Settings > Force First Last in the WordPress admin to run a batch update on all users.
Navigate to Settings > Force First Last in the WordPress admin to run a batch update on all users.
Paid Memberships Pro's frontend Member Profile Edit page with Display Name field removed.
Paid Memberships Pro’s frontend Member Profile Edit page with Display Name field removed.