For whatever reason, you’ve found yourself locked out of your own site.  Without a user attached to your email address, you can’t even use the Forgot Password feature to get in.  But, you own the site, so surely there must be some way to get in.

Good news, there is!  Better news, it’s easy!

In this post, I’ll show you how to quickly gain access to your WordPress admin area by having access to either the files or the database.

If You Have Access to the Files

This requires knowing the site’s current theme and editing the functions.php  file.  Simply add the following to the bottom of that file:

Once you’re in go ahead and remove this code since it will be running for every page load unnecessarily.

If You Have Access to the Database

Or, with phpMyAdmin access, you can run these SQL statements…

Login to Your New Admin Account

Whichever method you chose, you should now be able to login using username: myadmin and password: test1234!@#$ (at least if you used this code without changing it).

Now, time to reset your password to something more secure.

Leave a Reply

avatar
  Subscribe  
Notify of