Why WordPress sites get hacked
WordPress runs about 43% of all websites according to W3Techs, so attackers automate their tools around it. Most attacks are not personal: bots scan millions of sites for known weaknesses and try leaked passwords around the clock. Security researchers at Patchstack, who publish yearly reports on WordPress vulnerabilities, consistently find that the vast majority of new vulnerabilities — well over 90% — are in plugins, with only a tiny share in WordPress core itself.
In practice almost every hacked site we see falls into one of four causes: an outdated plugin or theme with a known hole, a nulled (pirated) premium plugin that came with a backdoor built in, a weak or reused admin password, or files left in public folders — old backups, database dumps and copies of wp-config.php — that hand attackers the keys.
Signs your WordPress site is hacked
Some hacks are loud; the dangerous ones are quiet. Check for these:
- Visitors (especially on mobile or from Google) are redirected to gambling, pharmacy, adult or 'you won a prize' pages.
- Google shows strange titles for your site — Japanese or Indonesian text, casino or loan keywords — when you search site:yourdomain.com.
- Chrome or Google Search shows 'This site may be hacked' or a red 'Deceptive site ahead' warning.
- New admin users you did not create, or your own admin password suddenly stops working.
- Unknown PHP files with random names in the site folders (for example wp-util-x7k2.php or files inside wp-content/uploads).
- Your host suspends the site, or your mail is suddenly refused because the server sent spam.
- The site becomes very slow, with server load far above normal while visitor numbers have not changed.
Free SEO & GEO audit — check what Google sees →
Real cases: what we found on hacked sites in 2026
In October 2026 we moved dozens of websites to Cloud Ninza from another hosting company and checked every file before going live. Several sites had been compromised for months without their owners knowing. These cases show what hacks really look like (client names left out):
DDoS protection for website hosting →
Case 1: Googlebot cloaking to a gambling page
A doctor's WordPress site looked perfectly normal to visitors. But when Google's crawler visited, the server showed it a gambling page instead — a trick called cloaking, done through a fake wp-admin/index.html file and a hidden folder of spam pages. The owner only noticed because the site's search results looked wrong. We copied only clean files, replaced WordPress core, removed a dropper file named like a WordPress utility, deleted exposed wp-config backup files and set new admin passwords.
Case 2: a remote-code loader in a static site
A dental clinic's simple HTML site carried an upload.php file that let anyone on the internet run code on the server, plus an abandoned WordPress install in a subfolder full of SEO-spam scripts and fake Google verification files. The live site was static, so we moved only those static pages and left the abandoned WordPress and its database out entirely.
Case 3: planted droppers and a web shell
Across the sites we moved, we quarantined 21 planted PHP backdoors — files with random suffixes, fake cache files that accepted commands from the internet, and droppers hidden in upload folders. A rule we now follow on every move: never copy a PHP file with a random-looking name without reading it first.
Case 4: a brute-force attack that slowed every site
In November 2026 a botnet hammered xmlrpc.php and wp-login.php on WordPress sites we host, pushing one server's load far above normal. We blocked xmlrpc.php at the web server for every site, added per-visitor rate limits and automatic 24-hour bans for repeated failed logins, and turned on a page cache for every WordPress site. Load returned to normal, and every WordPress customer is protected by those rules today.
First hour: what to do immediately
Stay calm and work in this order. Speed matters, but deleting things in panic destroys the evidence you need to find how they got in.
- 1. Take a full backup of files and database as they are now, and keep it separately — it is evidence, not something to restore.
- 2. Put the site in maintenance mode, or ask your host to restrict it, if visitors are being redirected to harmful pages.
- 3. Change passwords from a clean device: hosting account, every WordPress administrator, database user, SFTP/SSH and email accounts on the domain.
- 4. Check Users in wp-admin and delete any administrator you do not recognise.
- 5. Tell your host. A good host can see server logs, which files changed and when, and whether other sites were affected.
Step-by-step: how to clean a hacked WordPress site
Cleaning means replacing everything that should not change and inspecting everything that should. Follow these steps:
- 1. Note the exact WordPress, theme and plugin versions, then download a fresh copy of the same WordPress version from wordpress.org.
- 2. Replace wp-admin and wp-includes completely with the fresh copies, and replace the root WordPress files except wp-config.php.
- 3. Delete every plugin and theme folder and reinstall them from wordpress.org or the vendor. Delete any nulled premium plugin for good.
- 4. Search wp-content (especially uploads) for .php files — uploads should contain images and documents, not code. Remove anything you cannot explain.
- 5. Open wp-config.php and .htaccess and remove anything unusual: long encoded strings, eval(), base64_decode(), or redirect rules you did not add.
- 6. In the database, check wp_options (siteurl, home and active_plugins) and search posts for injected <script> tags or hidden links.
- 7. Generate new WordPress security keys (salts) in wp-config.php, which signs every user out everywhere.
- 8. Delete old backups, .sql dumps, .zip archives and wp-config copies from public folders.
- 9. Scan again, then watch the site's files and traffic for a week to make sure nothing comes back.
If you have a clean backup from before the hack, restoring it can be faster — but only if you know when the hack happened, and you must still update everything and change every password, or the attacker walks back in through the same hole. On Cloud Ninza you can restore any of the last 30 days' backups yourself (files, database or both) and keep the current version saved alongside for comparison.
Recover your Google rankings after a hack
Hacks hurt rankings in two ways: Google may show a warning on your results, and spam pages created by the attacker may still be indexed. To recover:
- Open Google Search Console → Security & Manual Actions. If there is a security issue, fix it, then click Request review and describe what you cleaned.
- Search site:yourdomain.com to find spam pages. Make sure they now return 404 or 410, then use Removals for the worst ones.
- Submit a fresh sitemap so Google recrawls your real pages.
- Check Bing Webmaster Tools too — Bing powers ChatGPT search and Copilot.
- Watch Performance in Search Console for two to four weeks; rankings usually return once the warning is lifted.
How to stop WordPress being hacked again
Prevention is mostly habits plus the right hosting. Compare a typical unprotected setup with a protected one:
| Risk | Unprotected site | Protected site |
|---|---|---|
| Outdated plugins and themes | Updated 'when someone remembers' | Updated weekly; unused ones deleted |
| Nulled premium plugins | Installed to save money | Never — only official sources |
| Admin passwords | Short, reused, shared by email | Long, unique, in a password manager, two-step login |
| Brute-force on login and xmlrpc.php | Unlimited attempts | xmlrpc blocked, rate limits, automatic bans |
| Backups and dumps in public folders | Downloadable by anyone | Blocked from the web, stored off-site |
| File editing in wp-admin | Enabled | DISALLOW_FILE_EDIT turned on |
| Isolation between sites | One hacked site infects its neighbours | Each account isolated from the others |
| Backups | None, or only on the same server | Twice a day, off-site, restorable in minutes |
How Cloud Ninza protects WordPress sites
Everything we learned from cleaning hacked sites is built into our WordPress hosting, on every plan:
- xmlrpc.php blocked, per-visitor rate limits and automatic bans for brute-force logins and vulnerability scanners.
- Downloads of backups, database dumps, archives, logs and wp-config copies blocked on every site.
- Each hosting account isolated from the others — one account cannot read another's files, apps or database.
- DDoS protection at the network and web-server level, plus a page cache on every WordPress site.
- Off-site backups twice a day, kept for 30 days, which you restore yourself from the dashboard.
- Free SSL, one-click WordPress sign-in from your dashboard, and a password vault for your logins.
- Help moving an existing WordPress site — we check every file for planted code before it goes live.
WordPress hosting →Move my site — request a migration →WordPress security checklist →
Key takeaways
The short version, for anyone skimming:
- Most WordPress hacks come from outdated plugins, nulled plugins, weak passwords or files left in public folders.
- Signs include redirects, spam pages in Google, unknown admins, random PHP files and sudden server load.
- Back up first, change every password, replace core and plugins with fresh copies and remove unknown files.
- Clean the database, rotate security keys, delete public backups, then request a review in Search Console.
- Prevent repeats with updates, strong passwords, blocked xmlrpc.php, isolation and off-site backups.
- Cloud Ninza WordPress hosting from ₹1,788 a year includes these protections and restorable backups.
WordPress Hosting from ₹1,788/year
WordPress on India-hosted cloud servers, installed for you — the latest release or the version your site needs. Latest WordPress or your chosen version · PHP 8.3, 8.4 or 8.5 · Free SSL certificate.
Hosting from ₹149 a month on servers in India
WordPress, static HTML, PHP, Node.js, Python and Java plans with free SSL and your choice of version. Create your account, pick a plan and pay by UPI, card or netbanking; your hosting is created automatically and you get your login by email, usually within minutes.