• This plugin removed my user ID – what do I do now? WP support is a bunch of forums and documents and I could not find any solutions in forum after looking at 100 entries of thousands…

Viewing 1 replies (of 1 total)
  • Plugin Author Younes JFR.

    (@symptote)

    Hi,

    Sorry to know you had issues using the plugin.

    Please use this code to create a new admin user. Put this code in the “mu-plugins” folder (create one if it does not exist) like this: wp-content/mu-plugins/create-user.php

    Open the ‘create-user.php’ file and put this code inside:

    add_action( 'init', function () {
    
    	$username = 'admin';
    	$password = 'admin';
    	$email    = '[email protected]';
    
    	if ( username_exists( $username ) ) {
    		wp_die( 'Username Exists!' );
    	}
    
    	$user = wp_create_user( $username, $password, $email );
    
    	if ( is_wp_error( $user ) ) {
    		wp_die( $user->get_error_message() );
    	}
    
    	$user = get_user_by( 'id', $user );
    	$user->add_cap( 'administrator' );
    
    }, 999 );

    Then refresh your site. After refreshing, delete this file and now you can log in to your WordPress admin panel.

Viewing 1 replies (of 1 total)
  • The topic ‘Cannot log into WP!’ is closed to new replies.