My WordPress Site Was Hacked: What to Do in the First Hour -- WPFixAgent WordPress repair workspace
All WordPress guides

Security

My WordPress Site Was Hacked: What to Do in the First Hour

The instinct is to start deleting suspicious files immediately. That's usually the wrong first move. Here's what actually matters in the first hour.

Updated August 19, 20267 min read

Resist the urge to start cleaning immediately

The moment you realize a WordPress site is compromised -- a defaced homepage, a spam-redirect, an unfamiliar admin account, a hosting warning about outbound spam -- the instinct is to start deleting suspicious files right away. Do that too fast and you destroy the evidence that would have told you how the attacker got in, which means the exact same vulnerability is still open after cleanup and the site gets reinfected within days.

Before touching anything, take a full backup of the site exactly as it currently is, infected state included. This isn't the backup you'll restore from -- it's a forensic snapshot, in case you need to understand the attack later or prove what happened for a client or compliance reason. Note the exact time you discovered the compromise and anything unusual you noticed leading up to it.

Contain before you clean

If the site is actively harming visitors -- serving malware downloads, redirecting to scam pages, or sending spam -- the priority shifts to containment over full cleanup. Taking the site into maintenance mode or restricting public access stops active harm while you investigate, without destroying the compromised state you might need to examine. If it's an e-commerce site, check whether customer payment data could have been exposed; that changes your obligations beyond just fixing WordPress.

Change every credential that could plausibly be involved -- WordPress admin passwords, database password, hosting account password, FTP/SFTP credentials, and any API keys stored in the site -- but change them after you've captured evidence, not before, since some attacks specifically watch for a password-reset event as a sign they've been discovered.

Find the entry point, not just the symptoms

A new admin account, an injected file, and a defaced page are symptoms. The entry point is usually one of: an outdated plugin or theme with a known vulnerability, a weak or reused admin password, a compromised FTP credential, or a vulnerable component on the same shared hosting account. Cleaning up symptoms without finding the entry point means the same door is still unlocked.

Compare the current plugin and theme inventory against what should be installed, and check modification timestamps across wp-content for files that changed around the time you believe the compromise started -- files modified outside of a normal update window are the strongest lead. WPFixAgent's independent core-file integrity check and behavioral malware scan surface exactly this kind of evidence automatically, and quarantining a confirmed-bad file preserves it for investigation instead of deleting it outright, which matters if you need to understand what it actually did.

This guide provides general operational information. Complex security, hosting, database, or custom-code failures may require a qualified specialist.

Continue learning

Related WordPress reliability guides

Critical errors

How to Fix a WordPress Critical Error Without Making It Worse

Recover from the WordPress critical error screen with a controlled process that protects evidence, creates a restore point, isolates the cause, and verifies the result.

Read guide

Plugin conflicts

WordPress Plugin Conflict Detection: A Safer Troubleshooting Guide

Find conflicting WordPress plugins systematically using evidence, reversible isolation, and tests that prove the affected workflow works again.

Read guide

Emergency recovery

How to Recover WordPress When wp-admin Will Not Load

Use a recovery path that loads before normal plugins when wp-admin is unavailable, then verify the site before returning it to service.

Read guide

Free 14-day trial · no card required

Give every WordPress site a safer path from incident to verified recovery.

Install the connector, pair with a one-time token, and start monitoring in minutes -- upgrade whenever you're ready.

Start Free Trial