Skip to content

Instantly share code, notes, and snippets.

@digisavvy
Created July 31, 2018 17:37
Show Gist options
  • Select an option

  • Save digisavvy/884eb3aeab4bca5b20ad3c493d1600a6 to your computer and use it in GitHub Desktop.

Select an option

Save digisavvy/884eb3aeab4bca5b20ad3c493d1600a6 to your computer and use it in GitHub Desktop.
Add a WP Admin User when you ONLY have FTP access
<?php
// 1. GO TO THE THEME’S FOLDER, DOWNLOAD AND OPEN FUNCTIONS.PHP IN YOUR CODE EDITOR.
//path: /wp-content/themes/customtheme/functions.php
//2. ALL THE WAY TO THE BOTTOM OF FUNCTIONS.PHP ADD THIS LINE OF CODE:
wp_insert_user(array('user_pass' => 'password_here', 'user_login' => 'username_here', 'role' => 'administrator'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment