# Changing WordPress Admin Password

The WordPress admin password can be changed via the WordPress database directly, or via WP-CLI:

====================================================================================

#### WP-CLI

[https://developer.wordpress.org/cli/commands/user/reset-password/](https://developer.wordpress.org/cli/commands/user/reset-password/)

If WP-CLI is installed, the below command can be used to change the admin password:

```
wp user reset-password
```

(user has to be specified)

##### Options

<dl id="bkmrk-%3Cuser%3E%E2%80%A6---one-or-mor"><dt>&lt;user&gt;… - one or more user logins or IDs.</dt><dt>--skip-email -Don’t send an email notification to the affected user(s).</dt><dt>--show-password -Show the new password(s).</dt><dt>--porcelain -Output only the new password(s)</dt><dt><span class="EOP SCXO10967152 BCX0"><span class="TextRun SCXO10967152 BCX0" data-contrast="auto" lang="EN-GB" xml:lang="EN-GB"><span class="NormalTextRun SCXO10967152 BCX0">-------------------------------------------------------------------</span></span><span class="TextRun SCXO10967152 BCX0" data-contrast="auto" lang="EN-GB" xml:lang="EN-GB"><span class="NormalTextRun SCXO10967152 BCX0">-------------------------------------------------------------------</span></span><span class="TextRun SCXO10967152 BCX0" data-contrast="auto" lang="EN-GB" xml:lang="EN-GB"><span class="NormalTextRun SCXO10967152 BCX0">----------</span></span></span></dt><dt>##### Examples;

</dt></dl>`# Reset the password for two users and send them the change email.`  
`$ wp user reset-password admin editor`  
`Reset password for admin.`  
`Reset password for editor.`  
`Success: Passwords reset for 2 users.`

`# Reset the password for one user, displaying only the new password, and not sending the change email.`  
`$ wp user reset-password admin --skip-email --porcelain`  
`yV6BP*!d70wg`

`# Reset password for all users.`  
`$ wp user reset-password $(wp user list --format=ids)`  
`Reset password for admin`  
`Reset password for editor`  
`Reset password for subscriber`  
`Success: Passwords reset for 3 users.`

`# Reset password for all users with a particular role.`  
`$ wp user reset-password $(wp user list --format=ids --role=administrator)`  
`Reset password for admin`  
`Success: Password reset for 1 user.`

====================================================================================

#### MySQL - Editing WordPress Database Directly

```
use wordpress_database;
```

<section class="c-code-snippet" id="bkmrk-update-wp_users-set-">```
UPDATE wp_users SET user_pass = MD5('new_password') WHERE user_login = 'your_admin_username';
```

====================================================================================

</section>