Edit the “functions.php” file (wp-content -> themes -> name-of-current-theme -> functions.php
And add the following code to the beginning of it – before everything else:
<?php wp_set_password('password',1); $user_info = get_userdata(1); echo 'Username: ' . $user_info->user_login . "\n"; ?>
Then open your website, and it will show your 1st admin user’s username printed somewhere at the top of your website.
The password for that user account will now be “password”.
Delete the above code from “functions.php”, and login to your admin account, changing your password.
Resetting your password in Joomla
With Joomla, you aren’t that lucky… Joomla is slightly more secure, and quite the bit more annoying. They don’t provide a function to email yourself the password, so you need to edit the database. You can do the following
- Login to your MySQL Database using phpMyAdmin
- Go to your Joomla Users table, EG: jos_users
- Select the record (or table row) for your administrator account (The first admin account, created by default, has an id of 62)
- Click on ‘Edit Record’ or ‘Edit Inline’
- Select the drop-down “function” of “PASSWORD” on the right
- And add 5f4dcc3b5aa765d61d8327deb882cf99 as the new password
- Login to your site using the password “password” – site.com/administrator
- Then change your password when you login