How To Manually Add User in WordPress

I recently dealt with a pretty unfortunate situation in which I needed to do a website handoff with the former developer of one of my clients.  I’ve done this before with no issue, but this development group in particular was extremely withholding of crucial levels of access I needed to do this simply — commonly known as “holding a site hostage.”

Once I was able to get the site migrated from a zipped file package, I was stuck with the users they had created, which they wouldn’t give me access to.  So, I had to figure out a way to do this manually, by way of MySQL.  This is done in PHPMyAdmin, so you’ll need to have your site files migrated to your own server to do this (or at least have server access).

Instructions:

  • Navigate to your cPanel
  • Under the Databases heading, find “PHPMyAdmin” — click on it
  • Select the database you wish to edit.  After it loads, click on the menu item that says “SQL”
  • There, you will see an editor in which you can add your SQL code.  You will ad this & click “Go”:

INSERT INTO `wp_users` (`user_login`, `user_pass`, `user_nicename`, `user_email`, `user_status`)
VALUES ('testadmin', MD5('testpass'), 'first last', 'email@test.com', '0');
INSERT INTO `wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`)
VALUES (NULL, (Select max(id) FROM wp_users), 'wp_capabilities', 'a:1:{s:13:"administrator";s:1:"1";}');
INSERT INTO `wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`)
VALUES (NULL, (Select max(id) FROM wp_users), 'wp_user_level', '10');

Please note: Replace the following fields in the code with your own desired credentials: testadmin, testpass, first last, email@test.com

Unless you get any error messages, you should be able to log into your site with the newly set credentials.

One common issue I found:

  • This code happens to assume you are using the standard WP database prefix, which is “WP_” — If you are not using this you will have to amend your code to reflect the proper titles ofwp_users and wp_usermeta

My 20 Favorite Albums of 2016

Devandra Banhart - Ape in Pink Marble
20. Devandra Banhart – Ape in Pink Marble

spotify-badge

19. Porches – Pool

spotify-badge

18. Banks – The Altar

spotify-badge

17. Kendrick Lamar – untitled unmastered.

spotify-badge

16. Dusky – Outer

spotify-badge

15. Anderson Paak – Malibu

spotify-badge

14. J. Cole – 4 Your Eyez Only

spotify-badge

13. Kanye West – The Life of Pablo

spotify-badge

12. Weval – Weval

spotify-badge

11. Roosevelt – Roosevelt

spotify-badge

10. Tycho – Epoch

spotify-badge

9. Kevin Morby – Singing Saw

spotify-badge

8. RÜFÜS DU SOL – Bloom

spotify-badge

7. James Blake – The Colour in Anything

spotify-badge

6. James Vincent McMorrow – We Move

spotify-badge

5. slenderbodies – sotto voce

spotify-badge

4. Jim James – Eternally Even

spotify-badge

3. Humans – Noontide

**NOTE** Sam rudely pointed out an error that this was released in 2015, but I listened to it pretty much every day for the past six months so we’re going to let it slide.
spotify-badge

2. Cubicolor – Brainsugar

spotify-badge

1. Frank Ocean – Blonde

spotify-badge

pumpgirl

See you in 2017!

sig

Thoughts on Turning 24

So many people have reached out to me today to wish me well as I turn 24, I feel very lucky. I have an amazing group of friends and family, and every year I get a quantifiable affirmation of those connections — not that it’s necessary.  23 was undoubtedly the year in which I felt the greatest highs and the toughest lows, both of which bring with them lessons that I’m getting better at using as tools to shape myself into a better person.  Thanks to everyone who reached out today, and continues to be apart of my life.  Here’s some photos and things I’ve done in the past year:

Read More