WordPress hacked? Stay calm: WordPress.org’s own guide to hacked sites starts with exactly that advice. This playbook walks you through the first hour, the cleanup and the prevention steps, using only WordPress.org and Google’s official guidance.
Quick answer: WordPress hacked? First, write down what you’re seeing and when. Then contact your host, scan your own computer, back up the site as it is, and change every password: WordPress, SFTP, your hosting panel and the database. Next, clean the site or restore a clean backup, update everything, and change the passwords again. If Google has flagged the site, request a review in Search Console once it’s clean.
If you typed “WordPress hacked” into a search bar because something looks wrong right now, start with the signs below, then work through the steps in order.
Is your WordPress site hacked? The signs to look for
WordPress.org lists these as clear signs of a hack:
- Google, Bing or another service lists your site as dangerous
- Your host has disabled your site
- Your site has been flagged for distributing malware
- Visitors say their antivirus software warns them about your site
- Someone tells you your site is being used to attack other sites
- Things changed that nobody authorized, such as new user accounts
- You can see the hack when you open the site in a browser
If you’re not sure, note exactly what you’re seeing. A “Not secure” label next to your web address, on its own, usually means an HTTPS problem rather than a hack. See why your website says Not secure. A clear description of the symptoms is what your host, a developer or the WordPress.org forums will ask for first.
WordPress hacked? What to do in the first hour
- Document what you see. Take screenshots of anything unusual, including any browser or search warnings. Write down what made you think you’ve been hacked, when you noticed it (with your time zone), and any recent changes, such as a new plugin, a theme edit or a widget change. Add details of your hosting setup. WordPress.org calls this the start of your incident report.
- Contact your host. On shared hosting the hack may affect more than your site, and your host can confirm whether it’s really a hack or a service problem.
- Scan your own computer. WordPress.org notes that many attacks start on the site owner’s computer, where malware captures logins. Run a full antivirus scan, ideally with a second tool as well.
- Back up the site as it is. Even an infected copy is worth keeping as a reference before you start cleaning. Store it somewhere other than the hacked server.
- Change every password. That means WordPress, FTP or SFTP, your hosting control panel and the database, for every user with access. Use long, unique passwords from a password generator.
- Log everyone out. Force a password reset for all users, especially administrators, and replace the secret keys in wp-config.php with a new set from WordPress.org’s key generator. That signs out anyone still logged in.
Cleanup: getting the site back
If you have a clean backup from before the hack, restoring it may be the fastest route. Otherwise, WordPress.org’s guide suggests the following:
- Reinstall WordPress core files over SFTP. Replace the /wp-admin and /wp-includes folders with fresh copies of the same WordPress version you were running. Don’t use the reinstall option inside the dashboard, because it only overwrites existing files and hacks often add new ones.
- Work carefully through wp-content. It holds your themes and plugins, so replace or update them one at a time, reinstalling only from WordPress.org or the company you bought them from.
- Check the files attackers change most. Look at .htaccess, which can sit in more than one folder, and at index.php, header.php, footer.php and functions.php.
- Remove anything you didn’t create, such as unfamiliar administrator accounts.
- Update WordPress, plugins and themes to the latest versions once the site is clean.
- Change the passwords again. Passwords changed while the site was still infected may already be known. WordPress.org also suggests changing the database user and password, then updating wp-config.php to match.
Before telling anyone the site is back, test it: load your key pages, submit your contact forms, run a test checkout if you sell online, and check the site on a phone.
Locked out of the dashboard? Reset your password from the login screen. If that doesn’t work, your host’s database tool (such as phpMyAdmin) lets you change your account’s email address in the users table, so you can then use “Lost your password?”.
If this is beyond what you’re comfortable doing, the WordPress.org support forums have Hacked and Malware tags where volunteers help, or you can bring in a professional.
WordPress hacked and redirecting visitors elsewhere?
A redirect hack sends visitors from your pages to a spam or scam site. Because these hacks often change site-wide files, start with the same files WordPress.org highlights: every .htaccess file on the site, plus index.php, header.php, footer.php and functions.php, since a change to any of them can affect every page.
To check whether the redirect is gone, don’t just type your address into your usual browser. Also open the site from a search result, on a phone and in a private window. Then follow the cleanup steps above, and request a Google review if the site was flagged.
WordPress hacked and flagged by Google?
If your site isn’t in Google Search Console yet, add and verify it now; WordPress.org recommends registering with webmaster tools such as Search Console and Bing Webmaster Tools. If your site is verified in Google Search Console, Google emails you when it suspects a hack, and the details appear in the Security Issues report. Google’s help also tells you to check the Manual Actions report.
Once the site is clean:
- Open the Security Issues report in Search Console.
- Select Request a review and explain what you fixed.
- Watch for the result in Search Console’s Messages.
Google says reviews for sites hacked with spam can take up to several weeks. If the review is approved, the report stops showing the hacked issues.
Other services keep their own blacklists, too. Our guide to blacklist monitoring explains how to keep an eye on them.
After cleanup: watching for a repeat
For the first few days after cleanup, check the Users screen for accounts you didn’t create, watch for pages or files you didn’t change, and keep an eye on Search Console. WordPress’s hardening guide notes that prevention is sometimes not enough, which is why monitoring matters: it helps you react faster.
Prevention: making sure it doesn’t happen again
Once you’re clean, work out how the attacker got in, so the same gap isn’t left open. Then apply WordPress’s hardening advice, which the full security checklist walks through step by step:
- Keep WordPress, plugins and themes updated, and delete plugins you don’t use.
- Use long, unique passwords and two-step login for administrators. Two-step login usually needs a plugin; see security plugins grouped by job.
- Turn off the dashboard file editor and connect to your server with SFTP rather than FTP.
- Keep regular backups of both the database and the files, stored somewhere you trust.
- Ask your developer to tighten file permissions; the handbook’s example uses 755 for folders and 644 for files, with wp-config.php at 400 or 440.
- On shared hosting, ask your host what precautions it takes so one compromised site can’t affect others.
If you’d rather not handle this alone, see how our team keeps WordPress sites secure. If your site is on one of our maintenance plans, hack recovery is included; our WordPress support services page explains how it works.
Frequently asked questions
WordPress hacked? Can I fix it myself?
Often, yes, if you’re comfortable working with files and your hosting panel. WordPress.org’s steps above cover the process, and its support forums can help. How far you get depends on your technical experience and on what the hack changed.
Should I delete everything and start again?
It’s tempting, but WordPress.org says that often isn’t possible. Instead, reinstall what can be replaced safely, such as the /wp-admin and /wp-includes folders, and clean the rest carefully.
Why change the passwords twice?
The first change limits further damage. The second, after the site is clean, makes sure nobody is still using a password captured while the site was infected.
Can a hacked site affect my email?
It can. WordPress.org notes that hacked sites are sometimes used to send spam, which can get the server’s IP address blacklisted, and that often affects email sent from the same server. Ask your host about it.
How long does a Google review take?
Google says reviews for sites hacked with spam can take up to several weeks, and the result appears in Search Console’s Messages.
The bottom line
If “WordPress hacked” is what brought you here, work through it in order: document, contain, clean, update, change the passwords again, then harden the site so the same gap can’t be used twice.