Skip to content

McGuire Technology

  • 🔐 How to Reset Your WordPress Admin Password (Step-by-Step Guide)

    🔐 How to Reset Your WordPress Admin Password (Step-by-Step Guide)

    Losing access to your WordPress admin account is frustrating—but it’s also very fixable. Whether your email reset isn’t working or you’re locked out entirely, there are several reliable ways to regain access.

    This guide walks through the most practical methods, starting with the easiest and moving to more advanced options.

    🔁 Method 1: Use the Built-In Password Reset

    https://images.openai.com/static-rsc-4/rDpgf4UW0wfxHba_bc9jvX9nqB9Il1ofamEgLwCRcM4q4VMtFc8vnxo42aBOCHHPBouf8t95wmkxqduL1wmr2x-0rVSSAYizuISOtqrGcR_uAcBo5Oqsqa1u8c375luvVwQjtXTL9nBdz-zlfSUztBsvtc5oV_md2scsa6XIMhx5e-qwinA5mlzycmt-0-R1?purpose=fullsize

    If your email system is working correctly, this is the fastest method.

    Steps:

    1. Go to your login page: https://yourdomain.com/wp-login.php
    2. Click “Lost your password?”
    3. Enter your username or email
    4. Check your email and follow the reset link

    ⚠️ Common Issue:

    Many self-hosted WordPress sites do not have email configured properly. If you don’t receive the email, move on to the next method.

    🛠️ Method 2: Reset Password via Database (Most Reliable)

    This method works even when everything else fails.

    Step 1: Access your database

    Use:

    • phpMyAdmin (via hosting panel)
    • MySQL CLI
    • Admin tools like Adminer

    Step 2: Locate the users table

    Look for:

    wp_users

    ⚠️ Your table prefix may not be wp_. Check your wp-config.php file for:

    $table_prefix = 'yourprefix_';

    Step 3: Run the reset query

    UPDATE wp_users 
    SET user_pass = MD5('NewStrongPassword123!')
    WHERE user_login = 'admin';

    Step 4: Log in

    Use your username and the new password.

    WordPress will automatically rehash the password securely after login.

    🖥️ Method 3: Reset Using WP-CLI (Best for SSH Access)

    If you have SSH access, this is the cleanest method.

    List users:

    wp user list

    Reset password:

    wp user update admin --user_pass="NewStrongPassword123!"

    Use this only if other methods are not available.

    Create a file (e.g., reset-password.php):

    <?php
    require_once('wp-load.php');
    wp_set_password('NewStrongPassword123!', 1);
    echo "Password reset.";

    Steps:

    1. Upload the file to your WordPress root directory
    2. Visit: https://yourdomain.com/reset-password.php
    3. Log in with the new password
    4. Delete the file immediately

    ⚠️ User ID 1 is usually the main admin account—verify if unsure.

    ⚠️ Troubleshooting Tips

    • Wrong table name? Check $table_prefix in wp-config.php
    • Multiple admins? Make sure you’re resetting the correct user
    • Login loop? Clear:
      • Browser cache
      • WordPress cache plugins
      • CDN cache (e.g., Cloudflare)

    🧠 Best Practice Going Forward

    • Configure SMTP so email resets work reliably
    • Use a password manager
    • Enable multi-factor authentication (MFA)
    • Avoid using the default admin username

    ✅ Recommendation

    • Have SSH access? Use WP-CLI
    • No SSH? Use the database method
    • Email working? Use built-in reset

    Avoid relying solely on email unless you’ve confirmed it’s properly configured.

    If you manage multiple WordPress sites, it’s worth standardizing on WP-CLI and proper SMTP configuration to prevent future lockouts.

    April 22, 2026
←Previous Page
1 2 3 4 5 6 … 12
Next Page→

McGuire Technology

  • Blog
  • RĂŠsumĂŠ
  • Contact
  • Privacy Policy
Log in

Archives

  • June 2026
  • April 2026
  • April 2025
  • February 2025
  • January 2025

Categories

  • Career
  • Email
  • Hosting
  • macOS
  • Network & Service Monitoring
  • Operating Systems
  • Python
  • SQL
  • Terminal
  • Uncategorized
  • Windows Administration
  • Wordpress

Tags

Account Recovery APIs Automation Bash BEGIN TRANSACTION Career Growth cli CMS Command Line COMMIT TRANSACTION Database Administration Database Management Data Integrity dd Developer Experience Developer Tools Disk Utility DKIM DMARC DNS Domain Domain Security Electronic Health Records (EHR) Email Email Authentication Email Deliverability Email Spoofing Error Handling Headless CMS Healthcare IT HIPAA vs FERPA ISO IT Career Change IT in Education IT in Healthcare IT Security IT Tips K-12 IT Locking and Blocking Login Issues Mac macOS Catalina macOS Terminal Mail Servers MX MySQL Network Security NLA Oh My Zsh Password Reset Phishing Prevention phpMyAdmin Platform Evaluation Plugin Management PowerShell Productivity Tools Product Review Programming Python RDP Remote Desktop ROLLBACK TRANSACTION Scripting Shell Comparison Small Business Websites SMTP Software Development SPF SQL Best Practices SQL Performance SQL Scripts SQL Server Static Site Generators System Administration Systems Administration T-SQL Tech Tips Terminal Terminal Customization Tradeoffs Transactions TRY CATCH Unix Shells USB Website Administration Website Maintenance Website Performance Windows Windows Administration Windows Firewall Wordpress WordPress Review Wordpress Security Wordpress Troubleshooting WP-CLI Zsh