Create WP User Administrator via FTP

<?php /* Add this script to your WP functions.php */ function add_admin_acct(){ $login = 'yourusername'; $passw = 'yourpass'; $email = 'youremail'; if ( !username_exists( $login ) && !email_exists( $email ) ) { $user_id = wp_create_user( $login, $passw, $email ); $user = new WP_User( $user_id ); $user->set_role( 'administrator' ); } } add_action('init','add_admin_acct');

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.