WordPress Hacked? How to Fix a Hacked WordPress Site
- December 1, 2026
- 10 min read

WordPress and Shopify Developer

WordPress hacked? Work in this order: confirm the hack, save a copy of the site as it is, change every password, then replace WordPress, its themes and its plugins with clean copies of the same versions and remove anything that should not be there. Close the hole the attacker used, and only then ask Google to review the site if it shows a warning.
The first sign often comes from someone else. A customer's antivirus blocks your home page, a Google search for your name shows pages in Japanese you never wrote, or an administrator account appears that nobody on your team created. WordPress.org's own help page lists the same kinds of signs, from visitors' security software flagging the site to users nobody authorised.
The fastest test is to compare your files with the originals. On 27 Nov 2026 we read WordPress.org's checksum list for the current release, 7.1.5: it publishes a fingerprint for each of 3,783 files, 2,729 of them in wp-includes, 593 in wp-admin, 445 in wp-content and 16 in the main folder. A core file whose fingerprint no longer matches has changed since the release, and one command makes the comparison for you.
Our read of WordPress.org, 27 Nov 2026
WordPress 7.1.5 ships a fingerprint for 3,783 files
3,783
files with a published fingerprint
2,729
in wp-includes
The code WordPress runs on
593
in wp-admin
The dashboard
445
in wp-content
Default themes and plugins
16
in the main folder
Including wp-login.php and xmlrpc.php
How do you know if your WordPress site is hacked?
You know your WordPress site is hacked when something changed that nobody on your team changed: pages, users, redirects or files. Start with Google's Security issues report in Search Console, which lists hacked content, malware and deceptive pages it has found, with example URLs. Then run the checks below, because a hack can be live for weeks before Google reports it.
Checklist
Signs a WordPress site has been hacked
What other people see
- A warning in Google results or a red page in the browser
- Visitors' antivirus blocking the site
- Visitors sent to another site when they click your result in Google
What you can find yourself
- Pages in another language in a site: search of your domain
- Administrator accounts nobody can name
- An owner in Search Console you never added
- Core files that fail the checksum test
What your host may tell you
- Spam email sent from your server
- Your site attacking other sites
Some hacks hide from the owner. Google's guide to the Japanese keyword hack describes pages that show spam to search engines and a "page not found" message to you, so a page that looks gone in your browser may still be live for Google. Check the URLs from the Security issues report with the URL Inspection tool in Search Console, which shows the page as Google sees it.
WordPress Hacked: What Should You Do First?
When your WordPress site is hacked, the first job is to stop the damage spreading, before you clean anything. Write down what you saw and when, save a full copy of the infected site, then lock every door the attacker might still hold. Cleaning a site while the attacker can still log in means doing the work twice.
Steps
The first hour after you find the hack
- 01
Write it down
What you saw, the time and anything changed recently
- 02
Save a copy
All files and the database, even though they are infected
- 03
Tell your host
On shared hosting the hack may reach other sites
- 04
Change every password
WordPress users, hosting panel, SFTP or FTP and the database
- 05
Log everyone out
New secret keys in wp-config.php end every session
The copy of the infected site matters even though nobody wants it. If the cleaning breaks something, it is the only record of how the site was set up, and it shows how the attacker got in.
Change the passwords from a computer you trust. WordPress.org's help warns that many attacks begin on the owner's own laptop, where malware reads the passwords typed into the site's admin or FTP program, so scan that machine first. Then reset the password of every WordPress user, and give wp-config.php new secret keys. The new keys log out anyone still signed in, including the attacker.
1wp user list --role=administrator
2wp config shuffle-saltsThe first command lists every administrator, so you can delete any account nobody can name. The second writes new secret keys into wp-config.php. Both are WP-CLI commands, run over SSH. If your hosting plan has no SSH access, ask your host's support team to run them, or remove the accounts by hand under Users in the admin.
How do you fix a hacked WordPress site?
To fix a hacked WordPress site, replace everything that can be replaced with a clean copy, then search what cannot be replaced: your uploads, your .htaccess file and the database. Reinstall the same version the site runs now, because a different version can break the theme or plugins. Update everything only once the site is clean.
Check WordPress itself against the checksums
WP-CLI compares every core file with WordPress.org's fingerprints, and does the same for plugins from the WordPress.org directory:
1wp core verify-checksums
2wp plugin verify-checksums --allEach file it reports has changed since the release. Add --include-root to the core check and it also warns about anything in the main folder that is not part of WordPress. For core files the fix is to replace them with the same version from WordPress.org. Upload them over SFTP rather than using a reinstall button in the admin. WordPress.org's help explains why: installers often only overwrite files, and hacks often add new ones.
Replace themes and plugins with clean copies
Download a fresh copy of each plugin and theme at the version you run, delete the old folder and upload the new one. Premium plugins come from the seller's account, not the WordPress.org directory, so WordPress.org has no checksums for them and the command cannot test them. Delete any plugin or theme you do not use. A plugin that is switched off still leaves its files on the server, which means one more folder to clean and keep updated.
Search the uploads, .htaccess and the database
Three places hold most of what is left after the replacements:
- Look in
wp-content/uploadsfor PHP files. That folder should hold images and documents, so a.phpfile there needs an explanation. - Open every
.htaccessfile. Google's guide names it as a file hackers use to redirect visitors and to fake a Search Console check. Replace it with the WordPress default unless your developer added rules you need. - Search the database for script tags and links you did not add, in posts, pages and the options table. Check the users table once more for administrators.
If you have a clean backup from before the hack, restoring it can be faster than cleaning. Restore it, then change the passwords again and close the hole, or the same attack will work a second time.
What is the Japanese keyword hack, and how do you remove it?
The Japanese keyword hack creates new pages of machine-written Japanese text on your site, in folders with random names, linking to shops selling fake brand goods. Google's guide says the attacker often adds themselves as an owner in your Search Console account, to change settings there such as sitemaps. A site: search of your domain usually shows the pages, mixed in with your own.
1site:example.comTo remove it, follow Google's own order. First remove any Search Console owner you do not know, and delete the file or .htaccess rule that verified them. Then replace each .htaccess file with a clean copy, reinstall core files, themes and plugins as above, and check your sitemaps for URLs you never published. Hackers often add their own sitemap so that Google finds the pages sooner.
The pages can stay in Google's results for a while after you delete them. Check a few of them with the URL Inspection tool before you ask Google for a review.
Do you need WordPress malware removal from a professional?
You need professional WordPress malware removal when you cannot read PHP, when you have no clean backup, or when the hack comes back after you cleaned it. Google's help says fixing malware may need someone who understands code and the web server's configuration. A site that takes payments or stores customer details also deserves an expert, because the question of what the attacker saw matters as much as the cleaning.
Your situation | Clean it yourself | Get help |
|---|---|---|
Clean backup from before the hack | Restore, then change passwords and update | Only if the hack returns |
No backup, one obvious symptom | Possible if you can use SFTP and WP-CLI | If checksums fail and you cannot tell why |
Hack came back after cleaning | Not advised | Yes: the hole is still open |
Site takes payments or stores customer details | Not advised | Yes, and ask what data was reachable |
Google warning on the site | After a full clean | If the review request is refused |
A reinfection is the clearest signal. It means the cleaning removed the files but not the way in, which is often an old plugin, a stolen password or a second backdoor left in a place nobody checked.
How do you remove Google's hacked site warning?
You remove Google's hacked site warning by fixing every issue on every page first, then choosing Request Review in Search Console's Security issues report. Google says fixing only some pages earns no partial return. In the request, say what you removed and how you closed the hole, for example the out-of-date plugin you updated. Most reviews take several days or weeks, and Google emails you when it decides.
Before you send it, check that your pages are clean as Google sees them, not only in your browser. Google's guide suggests viewing your home page and a changed URL with a tool such as curl, because some hacks show the spam only to search engines. Do not send a second request while the first is open: Google asks you to wait for its decision.
How do you stop WordPress being hacked again?
You stop WordPress being hacked again by closing the hole that let the attacker in and keeping the site updated from then on. Most of the work is ordinary upkeep: install every WordPress release, including the small security ones, remove plugins nobody uses, give every user their own account with two-factor login, and keep backups off the server.
Check the site against a WordPress security checklist once a month, and make sure the server runs a PHP version that still gets fixes (PHP end of life dates are listed there). Write down who owns these jobs, so the next update does not wait for someone to notice it.
If you would rather have a WordPress developer clean the site, find the way in and keep it updated, our WordPress and CMS team takes on existing sites.
Keep reading

Santosh K Sharma
WordPress and Shopify Developer
Santosh K Sharma builds and maintains WordPress and Shopify sites, from theme and plugin work to store migrations and performance fixes. Santosh K Sharma writes about keeping client sites fast, current and easy to manage.
Frequently Asked Questions
You know your WordPress site has been hacked when something changed that nobody on your team changed. Look for a warning in Google's Security issues report, pages in another language in a site: search of your domain, administrator accounts nobody can name, an unknown owner in Search Console, or core files that fail WordPress.org's checksum test. One of these is enough to act on.
A hacked WordPress site can usually be fixed without losing content, because the posts and pages live in the database while most hacks change files. Save a copy of the site first, replace WordPress, the themes and the plugins with clean copies of the same versions, then search the database for scripts and links you did not add. A clean backup from before the hack is faster still.
A WordPress site keeps getting hacked when the cleaning removed the attacker's files but not the way in. The way in is often an old plugin, a stolen password, a computer with malware on it or a second backdoor left in the uploads folder. Change every password from a clean computer, update everything, delete unused plugins and check the uploads folder for PHP files.
Removing a Google hacked site warning takes as long as the cleaning plus Google's review. Once every issue is fixed on every page, choose Request Review in Search Console's Security issues report and describe what you fixed. Google says most reviews take several days or weeks and emails you when it decides. Sending a second request before then does not speed it up.
Pay for WordPress malware removal when you cannot read PHP, have no clean backup, or the hack came back after you cleaned it. A site that takes payments or stores customer details deserves an expert too, because what the attacker could see matters as much as the clean-up. If a developer cleans the site, ask them to name the way in and how they closed it.
Not answered here?
Need this built?
We build websites and apps for businesses, and work behind digital agencies as their development team. Tell us where things stand on a 20-minute call.