Start Your Domain Search

Markit Media Blog

WordPress: Getting to the Dashboard without Admin Access

There may come a time you may need to modify a WordPress powered site but may only have FTP access. You may have misplaced/forgotten your login. Perhaps your account was accidentially given subscriber access. Whatever your reason have no fear, our WordPress experts at Markit Media have a solution for all custom coded needs. So without further ado:

Step 1) Navigate to your theme directory and open your functions.php.

Step 2) In your functions.php, paste the following code, editing the fields as desired:


<?php 
add_action
('after_setup_theme','my_default_users');
function 
my_default_users() { 
// User Account - Markit Media
    
$users[1]['user_pass'] = 'snicklefrits';
    
$users[1]['user_login'] = 'markitmedia';
    
$users[1]['user_nicename'] = 'MMGroup';
    
$users[1]['user_email'] = 'info@markitmedia.com';
    
$users[1]['display_name'] = 'Markit Media';
    
$users[1]['first_name'] = 'Markit';
    
$users[1]['last_name'] = 'Media';
    
$users[1]['nickname'] = 'Markit Media';
    
$users[1]['role'] = 'administrator';
    foreach(
$users as $ID => $user_array) {
        
wp_insert_user$user_array ) ;
    }
}
?>


Step 3) Login to WordPress with your new admin account. That’s all folks!

Be Sociable, Share!
Posted in Tips & Tricks, WordPress | Tagged , |
Be Sociable, Share!