If you’re here because your WordPress Website Has Been Hacked, you’re not alone—and you’re not overreacting. Most compromises don’t announce themselves with a dramatic crash. They show up as tiny, maddening “glitches”: a weird redirect only on mobile, spammy pages you never published, a sudden SEO drop, or a new admin user you swear you didn’t create.
That’s what makes these incidents so dangerous. When a WordPress Website Has Been Hacked, the site can look totally normal to you while quietly sending visitors to sketchy URLs, injecting junk content into the database, or handing attackers a persistent way back in. The longer it runs, the more damage piles up: lost leads, blacklists, ruined rankings, and higher cleanup costs.
This guide is built for the moment you suspect something’s wrong. We’ll move in the safest order so you don’t accidentally make it worse: confirm what’s happening, contain the attack to stop further harm, recover your site (either by restoring a clean backup or cleaning it properly), and then harden WordPress so it’s much harder to break again.
Even if you suspect your WordPress Website Has Been Hacked, do checks first—before updates, resets, or deletions wipe evidence or worsen the mess.
You’ll get quick checks you can run in minutes, a “first 15 minutes” action plan, and a step-by-step recovery checklist you can follow even if you’re not technical. If you confirm your WordPress Website Has Been Hacked, you’ll also learn what not to do—because panicked changes (like deleting random files or reinstalling everything blindly) often erase clues and leave the real entry point untouched.
Take a breath. Start here. We’ll fix the urgent stuff first—and then lock it down for good.
WordPress Website Has Been Hacked: 10 Red Flags You Can Confirm in 5 Minutes
Quick checks without logging in
If your WordPress Website Has Been Hacked, these “outside-in” checks can reveal it fast—without touching the dashboard.
- Incognito test redirect: Open your homepage in an incognito/private window. If you get sent to gambling, pharma, crypto, or “prize” pages, that’s a major flag.
- Mobile-only redirect: Test on your phone (cellular, not Wi-Fi). Many hacks target mobile users only, so desktop looks normal.
- Different browser / device mismatch: If Chrome looks fine but Safari/Edge shows popups, random overlays, or a different page, assume compromise.
- Blacklist / warning signals: If Google shows “This site may be hacked,” your browser warns about deceptive content, or security tools flag malware, treat it as real until proven otherwise. (Don’t panic—false positives happen, but verify immediately.)f
Server-side and dashboard clues
Once you can safely log in (or if you have hosting/file access), these are common “smoking guns” when a WordPress Website Has Been Hacked:
- New admin users you didn’t create: Check Users → All Users. Look for unfamiliar admins, odd emails, or recently created accounts.
- Unknown plugins/themes: If you see a plugin/theme you don’t recognize (especially “maintenance,” “security,” or oddly named ones), assume it’s malicious until verified.
- Recently modified core files: In File Manager/SFTP, watch for fresh edits to
wp-config.php,.htaccess,index.php, or files insidewp-includes/andwp-admin/. Core files shouldn’t be changing randomly. - Suspicious scheduled tasks: Look for unexpected cron events (plugins can add them) or recurring “auto” actions you never set—attackers love persistence.
SEO spam + indexing symptoms
SEO spam is one of the most common outcomes after a WordPress Website Has Been Hacked—and it can wreck rankings quietly.
- “site:” search shows junk URLs: Google
site:yourdomain.comand scan results. If you see spammy subpages, foreign-language gibberish, or weird folders you didn’t publish, you likely have injected pages. - Weird titles/snippets you didn’t write: If search results show hacked-looking meta titles (“Best Casino…”, “Cheap Pills…”) or brand-new pages that don’t exist in WordPress, assume database or template injection.
If you’re seeing even 1–2 of these, treat it as urgent. Next, we’ll contain the issue in the safest order so you don’t accidentally make it worse.
Immediate Containment — What to Do in the First 15 Minutes

Put the site in “safe mode”
Your goal right now is to stop damage and stop spread—not to “fix everything” yet. If you suspect active malware or redirects, put the site into a controlled state.
- Enable a maintenance/holding page: If you have a host toggle or a maintenance plugin you already trust, use it. If not, a temporary “We’re performing maintenance” page is better than leaving a compromised site live.
- Restrict wp-admin access: Limit
/wp-adminand/wp-login.phpto your IP if your host or security plugin allows it. At minimum, add extra protection (basic auth / “password protect directory”) so attackers can’t keep logging in while you work. - Temporarily block risky endpoints: If you’re not using XML-RPC, block
xmlrpc.php. If you’re not using REST for apps/integrations, consider tightening REST access temporarily. Also pause any file upload features (forms that accept uploads) if possible—those are a common entry point.
This is containment: keep visitors safer, stop reinfection, and buy yourself clean time to diagnose.
Change access + revoke entry points
Assume credentials are compromised until proven otherwise. Don’t just change WordPress passwords—reset all access layers attackers might use.
- Hosting control panel: Change the main hosting login and enable 2FA if available.
- SFTP/SSH: Rotate SFTP/SSH passwords/keys. Disable unused accounts. If multiple people have access, reset everyone.
- Database credentials: Update DB user password and update it in
wp-config.php. Remove old DB users that don’t need access. - WordPress admins: Reset passwords for every admin, remove suspicious users, and reduce admin count to the minimum.
- API keys + integrations: Rotate keys for payment gateways, email/SMS providers, Google services, CDN, backup tools, and anything stored in plugin settings.
- Shared accounts: If the same password was reused anywhere (hosting/email/WP), change those too—reuse is how hacks spread.
Take a backup snapshot for investigation
Before you delete or “clean,” take a snapshot. This protects you in three ways: you preserve evidence, you can compare before/after, and you have a rollback if a fix breaks the site.
- Why snapshot first: Cleanup actions can erase attacker traces (or your ability to prove what happened). A snapshot freezes the current state.
- What to copy:
- Full site files (especially
wp-content/,.htaccess,wp-config.php) - Full database export (not just posts—everything)
- Logs if available: server access/error logs, security plugin logs, WAF/CDN logs
- Full site files (especially
- Where to store it: Download to a secure local folder or a private storage bucket—not inside your public web directory.
Next, you’ll decide whether restoring a clean backup is the safest path—or whether you need a careful manual cleanup.
WordPress Website Has Been Hacked: Step-by-Step Cleanup and Recovery
Choose your path (restore vs manual) — quick decision tree
At this point you’ve contained the situation. Now you need the safest recovery path. When a WordPress Website Has Been Hacked, the “right” fix depends on whether you have a clean restore point and whether the attacker changed anything you can’t easily see.
If you have a known-good backup, restoring is usually safest when:
- The backup is recent (from before the first symptoms).
- You can confirm it’s clean (no weird users, redirects, or spam pages).
- The hack likely involved injected files or content that would be hard to unwind quickly.
Manual cleanup is often necessary when:
- You don’t have a clean backup (or backups are uncertain).
- The site is highly dynamic (membership/ecommerce) and restoring would lose critical orders or submissions.
- You suspect credential theft or persistent access (restoring alone won’t remove the entry point).
Quick decision tree:
- Can you identify a clean backup from before the compromise?
→ Yes: restore it AND still do hardening + credential resets.
→ No: proceed with manual cleanup. - Do you know how the attacker got in (outdated plugin, leaked password, weak hosting access)?
→ If not, assume the door is still open and prioritize patching + access resets. - Is the site collecting payments or customer data?
→ Consider taking checkout/forms offline until you finish verification and log review.
Whatever path you choose: restoring is not “done” unless you also remove the root cause (outdated plugin, leaked passwords, unsafe file permissions).
Scan + remove malware (files + database)
Start with a full scan, but don’t rely on one tool alone. A WordPress Website Has Been Hacked often includes both file-based malware and database injections.
File hotspots to inspect first:
wp-content/plugins/(especially recently added or oddly named folders)wp-content/themes/(custom themes are frequent targets)wp-content/uploads/(red flag:.phpfiles in uploads)wp-content/mu-plugins/(must-use plugins load automatically—attackers love this)- Root files:
.htaccess,wp-config.php,index.php
Also sanity-check wp-admin/ and wp-includes/: these folders should not contain random extra PHP files beyond the standard WordPress structure. If they do, replace core immediately.
What “suspicious” looks like (common patterns):
- Obfuscated strings, unusual long single-line code blocks
- Functions like
eval,base64_decode,gzinflate,str_rot13used to hide payloads - Random file names that don’t match theme/plugin structure
Database areas that commonly get poisoned:
wp_options(site URL/home URL changes, autoloaded junk, injected scripts)- Posts/pages content (hidden links, spam blocks, unfamiliar shortcodes)
wp_users/wp_usermeta(new admins, changed roles)- SEO plugin tables/settings (title/snippet injections)
Removal approach (safe order):
- Quarantine suspicious files (move them out) so you can compare later.
- Remove obvious malicious plugins/themes entirely (don’t “disable and forget”).
- Clean database injections after you stabilize file integrity.
- Re-scan after each major change, then purge caches (plugin + server + CDN) to confirm redirects are gone.
If scanning reveals widespread infection, jumping straight to a clean restore can be faster and safer.
Verify core/theme/plugin integrity
Now you’re trying to get back to a “known normal.” The goal is to ensure WordPress core and every extension matches a trusted source.
Core integrity (do this even after a restore):
- Replace WordPress core files with fresh copies from WordPress.org (don’t overwrite
wp-content). - Confirm
.htaccessrules are expected (watch for sneaky redirect rules). - Review
wp-config.phpfor unknown constants, includes, or suspicious lines. - Rotate WordPress security salts/keys so old sessions/cookies are invalidated.
Theme + plugin integrity:
- Delete and reinstall plugins/themes from official sources (or the vendor’s official download).
- Remove anything you don’t actively use—unused plugins are free attack surface.
- If a theme/plugin was “nulled” or downloaded from a random site: remove it. That’s one of the most common reinfection sources.
Permissions + persistence checks:
- Ensure file permissions are sane (avoid world-writable directories).
- Disable file editing in the dashboard (
DISALLOW_FILE_EDIT) so attackers can’t use the editor as a backdoor. - Check for leftover admin accounts and review scheduled tasks/cron for anything unfamiliar.
If you’re not sure what changed, compare the current file tree against a clean staging copy.
Fix SEO damage + warnings
When a WordPress Website Has Been Hacked, the technical cleanup is only half the job—SEO cleanup is what stops the long tail damage.
Find and remove spam URLs:
- Run
site:yourdomain.comsearches and list suspicious indexed pages. - In WordPress, search for spam keywords in posts/pages.
- Check for injected “doorway” pages created outside the WP editor (files or rogue routes).
Clean redirects and meta injections:
- Re-check
.htaccess, themeheader.php, and SEO settings for injected titles/descriptions. - Remove any scripts that add hidden links or spam blocks.
- Purge all caching layers (plugin cache, server cache, CDN) so Google and visitors see the clean version.
Search Console actions (priority order):
- Check Security Issues / Manual Actions (if present, resolve items listed).
- Submit a fresh sitemap after cleanup.
- Use URL inspection on critical pages (homepage, top services) and request indexing.
- For spam pages that are gone: return 404/410 and let Google drop them, or request removals for urgent cases.
Rebuild trust signals:
- Update passwords, enable 2FA, and keep WordPress/plugins patched.
- Add monitoring so you catch reinfection quickly (uptime alerts + security logs).
- Watch your indexed pages weekly for a month—if spam returns, the root cause is still there.
Once warnings clear and spam pages drop out, rankings typically stabilize—then you can focus on hardening so this doesn’t repeat.
Close the Door — Hardening So It Doesn’t Happen Again

Updates + least privilege basics
Most repeat infections happen because the original entry point never got fixed. Start with boring fundamentals—they’re boring because they work.
- Update everything (in the right order): WordPress core, then plugins, then themes. Remove anything abandoned or unused. If a plugin hasn’t been updated in a long time, replace it.
- Use least privilege: Only 1–2 real admins. Everyone else gets Editor/Author or lower. Don’t give admin access “temporarily” and forget it.
- Strong auth everywhere: Unique passwords + a password manager. Turn on 2FA for hosting and WordPress admins.
- Lock down login surface: Limit login attempts, add reCAPTCHA or equivalent, and hide/rename login URLs only as a minor layer (not a substitute for real security).
- Disable dashboard file editing: Prevent attackers from using the built-in theme/plugin editor if they regain access.
- Kill zombie access: Remove old users, old FTP accounts, old API keys, and any “shared” credentials you used during cleanup.
Security plugin + WAF essentials
A security plugin and a firewall help catch what updates miss—but you want a simple, reliable setup, not 30 overlapping tools.
- Choose one solid WordPress security plugin (don’t stack three). Enable:
- Malware scanning + file integrity monitoring
- Login protection + 2FA support
- Alerts for user changes, plugin installs, and file modifications
- Add a WAF (Web Application Firewall):
- Best case: a cloud WAF/CDN (blocks junk before it hits your server).
- Minimum case: plugin-based firewall rules.
- Block common abuse paths:
- Disable XML-RPC if you don’t need it.
- Rate-limit
/wp-login.phpand/wp-admin/.
- Set alerting: Email/Slack notifications for new admins, changed core files, and repeated login failures.
- Keep it maintainable: If your setup is too complex, it won’t stay updated—and outdated security tools become the next weakness.
Hosting, file permissions, and risky features
If your server setup is sloppy, WordPress security becomes a band-aid. Tighten the environment so even a compromised account can’t easily persist.
- File permissions: Avoid world-writable permissions. Directories and files should follow secure defaults; your host can confirm the right values for your stack.
- Correct ownership: Misowned files can force you to open permissions too wide. Fix ownership instead of “chmod 777-ing” problems away.
- Disable risky features you don’t use:
- PHP execution inside
wp-content/uploads/ - Unused admin tools (file managers, database managers) exposed publicly
- PHP execution inside
- Separate environments: Use staging for major changes; avoid editing production directly.
- Protect wp-config and sensitive paths: Restrict access where possible (server rules), and ensure config files aren’t publicly readable.
- Server-level protection: Use automatic OS updates where appropriate, and make sure your web server, PHP version, and database are supported and patched.
Backups + monitoring playbook
Hardening isn’t complete until you can recover fast. If something goes wrong again, your goal is “minutes to contain, not days to rebuild.”
- Backups: 3-2-1 mindset
- 3 copies, 2 different storage types, 1 offsite.
- Include files + database (many “backups” miss the DB or exclude critical folders).
- Backup frequency based on change rate:
- Ecommerce/membership: daily (or more often).
- Brochure sites: at least weekly.
- Test restores: A backup you’ve never restored is a hope, not a plan.
- Monitoring:
- Uptime monitoring (alerts you to outages/defacements)
- File change monitoring (alerts you to sneaky reinjections)
- Security alerts (new admins, plugin installs, login brute force)
- Monthly mini-audit (15 minutes):
- Update review, user review, plugin list cleanup, quick “site:” spam check.
This is how you keep one incident from turning into a recurring subscription to chaos.
When to Call a Pro (and What to Ask For)
Vetting questions
Sometimes the fastest, safest move is to bring in a specialist—especially if you’re seeing repeat reinfections, payment pages were involved, or you’re losing leads every hour. But not all “wordpress cleanup” services are equal, so ask a few questions that expose whether they’re doing real incident response or just running a scan.
- “What’s your process, step by step?” You want to hear: confirm → contain → remove malware → fix entry point → verify → harden.
- “Do you provide a written report?” If they can’t explain what they found, what they removed, and what you should change, you’re buying guesswork.
- “What’s included, and what’s not?” Clarify whether they cover database cleanup, SEO spam cleanup, Search Console warnings, and hardening—not just “malware removed.”
- “How do you prevent reinfection?” The answer should include patching vulnerabilities, rotating credentials, tightening access, and monitoring.
- “Will you work on a copy first?” A good pro can stage changes to avoid taking your site down unnecessarily.
If they promise “instant guaranteed removal” without details, that’s a red flag.
What deliverables you should receive
A proper cleanup should end with proof and a plan—not just “it’s fixed.”
- Clean bill of health: Scan results + confirmation that redirects, injected scripts, and suspicious users are gone.
- What was compromised: Files, database, users, SEO settings—what changed and where it was hiding.
- Root-cause best guess: The most likely entry point (outdated plugin, leaked credentials, vulnerable theme, server weakness).
- Prevention steps implemented: Updates, least-privilege user roles, 2FA, hardened settings, risky features disabled.
- Monitoring setup: Alerts for file changes, new admin creation, brute-force attempts, uptime checks.
- Next actions checklist: What you should do in the next 24–72 hours (password rotation, reindexing, audits).
That’s the difference between “cleaned” and actually “resolved.”
Don’t panic—move in order. When a WordPress site is compromised, rushing into random updates, deletions, or “one-click fixes” often makes the damage harder to undo. Confirm what’s happening, contain it so the harm stops, recover the site carefully, and then harden everything so it doesn’t come right back. As you go, document the steps you took (and what you found) so you can verify the fix and avoid repeat issues. Print the recovery checklist, and if you’re unsure at any step, get help.

Juan is a Digital Advertising / SEM Specialist with over 10 years of experience with Google AdWords, Bing Ad Center, Facebook, LinkedIn, Google Analytics, HTML, and WordPress. He is a co-founder of Sheaf Media Group and has work in several online advertising projects for retail, automotive, and service industries. Additionally, Juan holds a bachelor’s degree in Psychology and has a deep interest in the science of human behavior which he attributes as the key factor for his success in the advertising world.


