My HP

13th July, 2015 | Troubleshooting |

Changing your WordPress Admin Password

If you need to change your WordPress admin password but you do not have access to the WordPress admin section, you can change it via either three methods - Softaculous, phpMyAdmin or by editing the WordPress functions.php file.

Change the Password via Softaculous

If you installed your WordPress website via Softaculous, you can change the admin password by editing the installation information.

Log into your cPanel account. If you are unsure on how to do this, please view the following help article - 'How to log into cPanel'.

alt

Scroll down to the 'Softaculous Apps Installer' section. Select 'WordPress' from the available scripts list.

alt

Scroll down to the 'Current Installations section. Where your installation is shown, choose the 'Edit pencil icon'.

alt

The installation information will now all be shown. Scroll down to the 'Admin Account' section. Enter your preferred admin username and your new admin password into the respective boxes.

alt

Scroll to the bottom of the page and confirm the WordPress admin password change by selecting 'Save Installation Details'.

alt

Your WordPresss admin password has now been changed through Softaculous.


Change the Password via phpMyAdmin

Log into your cPanel account. If you are unsure on how to do this, please view the following help article - 'How to log into cPanel'.

Scroll down to the 'Databases' section and choose 'phpMyAdmin'.

alt

Once phpMyAdmin has loaded, from the left hand side, you should see your account name. Click on the '+' icon to expand the available databases on your account.

alt

Select your WordPress database.

alt

Select the '_users' table from the table list.

alt

Locate the 'admin' user record and select the 'Edit' option.

alt

For the 'user_pass' field, choose from the function dropdown menu 'MD5'. This will encrypt the plain new text password that you are about to type.

alt

Type in the new admin password into the 'Value' field.

alt

Save the new password change by selecting 'Go' at the bottom.

alt

Your WordPress admin password has now been changed through phpMyAdmin.


Change the Password by editing WordPress functions.php file

You can hardcode the WordPress admin password by editing the functions.php file.

Log into your cPanel account. If you are unsure on how to do this, please view the following help article - 'How to log into cPanel'.

In cPanel, scroll down to the 'Files' section and choose 'File Manager'.

alt text

The file manager has access to all of the files on your server, including your WordPress files which is where we need to edit the wp-config.php file.

Using the left directory listing, open the 'public_html' folder and then click onto the folder that contains your WordPress installation.

alt text

Again using the left directory, click to open the 'wp-includes' folder.

alt text

Locate the functions.php file in the files listing and mouse click onto it to highlight it.

alt text

Choose 'Edit' from the top menu.

alt text

Confirm that you would like to edit the file in the text editor by selecting 'Edit'.

alt text

Add the following line to the top of the functions.php by below the opening <?php tag, replacing the example 'yournewpassword123' with something more suitable as your new WordPress admin password.

wp_set_password( &#039;yournewpassword123&#039;, 1 );

Save the changes by selecting the 'Save Changes' option.

alt text

Changing by your WordPress admin password by editing the functions.php file is now complete. However please note that once you have access, you may wish to delete the line added to avoid complications in the future.


Comments