How to Access Your WordPress Site When Locked Out: Step-by-Step Fix Guide

Posted: Mar 23, 2026 | WordPress Troubleshooting

Accessing your WordPress site when locked out is a common challenge—especially when you suddenly can’t log in or your site starts behaving unexpectedly.

If you’re trying to access your WordPress site when locked out, it’s usually caused by login errors, security restrictions, or configuration issues.

Whether you’re seeing login errors, redirects, or even a setup screen, there’s always a way to fix it.

If you’re wondering how to access your WordPress site when locked out, the steps below will help you regain access quickly.

Quick Answer: How to Access WordPress When Locked Out

If you’re locked out of WordPress, try these steps:

  • Reset your password using “Lost your password?”
  • Disable your security plugin (very common issue)
  • Clear browser cache or try incognito mode
  • Disable all plugins via File Manager
  • Check your wp-config.php file for changes
  • Create a new admin user via phpMyAdmin
  • Check your .htaccess file
  • Contact your hosting provider

First: Identify the Type of Lockout

Identifying the issue correctly is the first step to access your WordPress site when locked out without unnecessary troubleshooting.

Before jumping into fixes, identify what you’re seeing:

SituationLikely CauseWhat to Try First
Can’t login (wrong password)Credential issueReset password
Login blocked after attemptsSecurity pluginDisable security plugin
Redirecting to another sitePossible hackCheck wp-config
Seeing setup screenDatabase disconnectedCheck DB details
“Error establishing database connection”DB issueVerify credentials

Identifying the issue first can save you a lot of time.

How to Access Your WordPress Site When Locked Out (Step-by-Step Fixes)

Now that you’ve identified the type of lockout, let’s go through the most effective ways to regain access to your WordPress site.

Start with the simplest fixes first, then move to advanced solutions only if needed. In most cases, you’ll be able to fix the issue within the first few steps.

Fix 1: Reset Your Password (Easiest Method)

Go to your login page:
yourwebsite.com/wp-admin

Click Lost your password? and reset it via email.

Reset your password in WordPress

Fix 2: Disable Security Plugin (Most Common Cause)

Security plugins like Wordfence or iThemes Security can block your IP after multiple login attempts.

How to fix:

  1. Open your hosting panel → File Manager
  2. Go to /wp-content/plugins/
  3. Find your security plugin folder (e.g., wordfence)
  4. Rename it (e.g., wordfence-old)

Disable Security Plugin via File Manager

Now try logging in again.

This is one of the most common reasons users are unable to access their WordPress site when locked out. If this works, your IP was blocked—not a password issue.

If your wp-config.php file has been altered, it’s important to secure it properly to prevent future issues. You can follow this guide: How to Secure wp-config.php in WordPress.

To better understand how WordPress handles security, you can also refer to the official guide.

Fix 3: Clear Cache and Try Again

Sometimes login issues are caused by cached sessions.

  • Clear browser cache
  • Try incognito/private mode
  • Disable browser extensions

Fix 4: Disable All Plugins (WordPress Plugin Conflict Fix)

If you’re still locked out, a plugin conflict may be the cause.

Steps:

  1. Go to File Manager
  2. Open /wp-content/
  3. Rename plugins → plugins-old

Try logging in again.

Disable All Plugins

This is one of the quickest ways to access your WordPress site when locked out, especially if a plugin is blocking your login. If this works, reactivate plugins one by one to find the issue.

Fix 5: Check wp-config.php (Fix Hacked WordPress Site Access Issues)

If your site is:

  • Redirecting to another website
  • Showing WordPress setup screen
  • Showing database errors

Your wp-config.php file may be altered.

What to check:

  1. Open File Manager
  2. Locate wp-config.php
  3. Verify these values:
    • DB_NAME
    • DB_USER
    • DB_PASSWORD
    • DB_HOST

In some cases, attackers modify these values, which can completely break access or redirect your site.

Fixing incorrect configuration details can quickly help you access your WordPress site when locked out, especially in hacked or broken setups.

Fix 6: Create a New Admin User via phpMyAdmin

If you cannot log in at all, you can manually create a new admin user.

Step 1: Add User

  1. Open phpMyAdmin
  2. Select your database
  3. Open wp_users
  4. Click Insert
  5. Add:
    • user_login
    • user_pass → select MD5
    • user_email

Step 2: Assign Admin Role

  1. Open wp_usermeta
  2. Add:
    • meta_key: wp_capabilities
    • meta_value: a:1:{s:13:”administrator”;b:1;}
  3. Add another:
    • meta_key: wp_user_level
    • meta_value: 10

You can now log in using this new admin account.

Important: Check Table Prefix

If this doesn’t work:

  • Check $table_prefix in wp-config.php
  • Make sure it matches your database tables

Fix 7: Check .htaccess File

A corrupted .htaccess file can block access.

Steps:

  1. Go to your root folder
  2. Find .htaccess
  3. Rename it to .htaccess-old

Try logging in again.

After login, regenerate it via
Settings → Permalinks → Save

Fix 8: Error Establishing Database Connection

If you see:

“Error establishing a database connection”

Error Establishing a Database Connection in WordPress

This usually means your website is unable to connect to the database.

Common causes include:

  • Incorrect database credentials in wp-config.php
  • Corrupted database
  • Database server issues
  • Hosting-related problems

This is one of the most common WordPress issues, but it’s usually easy to fix once you identify the cause.

In many cases, this issue is related to incorrect database details in your configuration file. If everything looks correct and the issue still persists, it may be a server-level problem.

If your site recently showed a setup screen or stopped connecting to the database, this is likely the cause.

For a complete step-by-step solution, follow this guide:
How to Fix Error Establishing Database Connection in WordPress

Fix 9: Contact Hosting Support

If none of the above works:

  • Your hosting may have blocked access
  • Firewall restrictions
  • Server-level issues

Good hosting support can usually fix this quickly.

What Causes WordPress Lockouts?

  • Incorrect login attempts
  • Security plugin restrictions
  • Plugin conflicts
  • Corrupted files
  • Hacked site or modified configuration
  • Hosting/server issues

How to Prevent Getting Locked Out Again

  • Use a password manager
  • Limit login attempts carefully
  • Keep plugins and themes updated
  • Avoid installing unnecessary plugins
  • Enable regular backups

If you’re tracking your website performance, it’s also important to understand unusual traffic patterns. Learn more in this guide: Why Does My Website Have So Much Direct Traffic in GA4?

How to Regain Access to Your WordPress Site

Getting locked out of your WordPress site is frustrating—but in most cases, it’s completely fixable.

Start with simple solutions like password reset or disabling security plugins, then move to advanced fixes like checking your configuration file or database.

By following these steps, you can easily access your WordPress site when locked out without needing advanced technical help.

Still locked out of your WordPress site?

Sometimes the issue can be more complex, especially in hacked or server-level cases.

If you’re unable to access your WordPress site when locked out even after trying these steps, it may require deeper troubleshooting.

Get Help Now

FAQs: WordPress Locked Out Issues

Why am I locked out of my WordPress site?

This is usually caused by incorrect login attempts, security plugins blocking access, plugin conflicts, or database issues.

How do I unlock my WordPress admin login?

You can reset your password, disable security plugins, or create a new admin user via phpMyAdmin.

Can a plugin lock me out of WordPress?

Yes, especially security plugins that block IP addresses after multiple login attempts.

What should I do if my site is hacked and I’m locked out?

Check your wp-config.php file, verify database details, and create a new admin user if needed.

Found this useful? Please share it with your network.

More on This Topic

Designing SEO-Friendly Websites That Convert

Sangeetha is a WordPress & SEO specialist sharing practical guides, tutorials, and real-world solutions to help beginners build and grow search-friendly websites.

Share: