Easily Reset Your Wordpress’s Admin Pasword

You may want to read our latest article Best posts on Bloghonour from Dec 2008

How often are you change your Wordpress admin’s password? What happen if you forgot your Wordpress admin account password? Do you need to delete the databse and recreate it?

Although you cannot recover your current admin’s password, but it is not neccessary to delete the database and recreate it. You can simply replace it with a new password. Here, i will show you a very simple method to replace the password.

First of all, open your favorite code editor, or simply Notepad if you don’t have any. Then, place these code into the file and save it as reset.php.

<?php
require('./wp-blog-header.php');

global $wpdb;
$password = '12345';    //change this to your desired password.
$admin_login = 'admin';        //your Wordpress admin username.

$wpdb->query("UPDATE $wpdb->users SET user_pass = MD5('$password') WHERE user_login = '$admin_login'");
?>

You can replace the ‘12345‘ with your desired password and ‘admin’ with your admin account username. After that, upload the reset.php file to your Wordpress root folder.

Then, go to your browser and type “http://your-domain.com/reset.php“. Done! You can now login with your new admin password.

Note: Please delete the reset.php file from the server after you reset your password.

Tags: , , , ,

You may be interested in reading these articles

2 Comments so far...

  1. rize

    That is a cool trick, aside from above you can also reset the password thru phpmyadmin, changing user pass with MD5.

  2. dicky

    Although i prefer using phpMyAdmin to reset the password, but there are some people who not familiar with phpMyAdmin and request me to create a reset file for them. So i guess this tutorial may help them.

Leave a Reply