WordPress is one of the most popular CMS (Content Management System) used by so many big companies and professionals but sometimes with default settings, the site is open for hackers through which the number of attacking chances are more if you use default configuration.
Also Read: Change Default WordPress Table Prefix Name (Before and After Installation)
By default, username is set as a display name which can be seen in author URL and posts page. Using the username as a display name is something useful for hackers and spammers because it can be further exploited with some bruteforce attacks.
To change that, you need to edit your User’s profile page and change the default Display name from “username” to “First Name Last Name” format as shown in below screen.
Suppose you’ve a open registration page and you want to change the default display name to full name, then you can embed the following code in your theme’s functions.php file. (Pastebin Link)
function change_display_name( $user_id ) {
$info = get_userdata( $user_id );
$args = array(
‘ID’ => $user_id,
‘display_name’ => $info->first_name . ‘ ‘ . $info->last_name
);
wp_update_user( $args );
}
add_action(‘user_register’,’change_display_name’);
Once the above code is added in your theme’s functions.php file then try to create a new user and you should see “First Name Last Name” as a display name as shown below:
You may also like:- Most Common DNS Record Types and Their Roles
- Top Skills Needed to Become a Cybersecurity Analyst
- Mastering Windows Management with WMIC Commands – Top 20 Examples
- Edit and Compile Code with the Best 5 Code Editors
- 50+ Top DevSecOps Tools You Need To Know
- Learn How to Add Proxy and Multiple Accounts in MoreLogin
- Some Useful PowerShell Cmdlets
- Create Free SSL Certificate – ZEROSSL.COM [2020 Tutorial]
- Generate Self-Signed SSL Certificate with OPENSSL in Kali Linux
- RDP – CredSSP Encryption Oracle Remediation Solution 2020