Skip to content

How To Change Your WordPress Username

I was browsing the internet and found that there’s no site who has posted an easy way to change your WordPress username right from your admin panel. In this article, I’ll show how you can easily change your WordPress username right from your admin with just a simple snippet and a plugin as well if you’re not a tech guy.

With A Snippet

Add following code to your theme’s functions.php file after replacing Current-Username & New-Username values in the code:

global $wpdb;

$wpdb->query( "
UPDATE wp_users 
SET user_login = 'New-Username'
WHERE user_login = 'Current-Username';
" );

[alert style=”red”]Note: Please remove this code immediately after saving your functions.php file. You only need to run this code once, there’s no need to keep this code in your theme.[/alert]

With A Plugin

If you’re not a technical money, and don’t wanna mess around with the database values, you can also user a plugin for this task. Username Changer is a perfect plugin for this task.

Leave a Reply

Your email address will not be published. Required fields are marked *