Skip to content

Instantly share code, notes, and snippets.

View Artisan-Asad's full-sized avatar
Reverse engineering

Asad Shahbaz Artisan-Asad

Reverse engineering
View GitHub Profile
@Artisan-Asad
Artisan-Asad / create-admin-user.php
Created September 28, 2019 06:40 — forked from meetawahab/create-admin-user.php
Create a new admin user in WordPress through code. You just need to change the variables and drop the file in the mu-plugins directory or add the following code in active theme's functions.php, then reload the homepage in WordPress. The new user will be created. Remove the file/code after that.
<?php
add_action( 'init', 'aw610_create_user' );
function aw610_create_user() {
$username = 'admin';
$password = 'password';
$email_address = 'email@domain.com';
if ( ! username_exists( $username ) ) {