To find out whether your WordPress site has been hacked, opening it in your browser is not enough: most infections hide from a logged-in administrator. You have to look for them where they live: in Google’s index, in certain files, in the database and in scheduled tasks. This guide walks through the eight most common infections and, for each one, the symptom, the command or tool that confirms it and the false positives to know about.
If you first want a quick triage of the warning signs, start with the signs of a hacked WordPress site, then come back here to confirm infection by infection.
Why a hack goes unnoticed
An attacker has every reason to stay quiet: a site that works normally for its owner keeps serving the attacker’s interests for months. So the malicious code checks who is asking. A logged-in administrator sees the normal page, a mobile visitor coming from Google is redirected, and Google’s crawler gets spam pages. In April 2026, the backdoor hidden in more than 30 acquired plugins (the EssentialPlugin suite) only showed its spam to Googlebot, which made it invisible to site owners.
In practice: always test from a point of view other than your own (private window, mobile network, Google’s URL Inspection tool, command line), and search the files and the database rather than the pages.
The eight infections and how to spot them
1. SEO spam: Japanese keywords, pharma, casino
This is the most widespread infection. The attacker creates thousands of pages (often in randomly named folders) full of Japanese text, medicines or gambling, to ride on your domain’s reputation. Google describes this “Japanese keyword hack” in detail. To spot it, search Google for:
site:yourdomain.com casino
site:yourdomain.com viagra OR cialis OR pharmacy
site:yourdomain.com 激安
site:yourdomain.com inurl:.html
The third search targets a Japanese word that is very common in this spam (“rock-bottom price”). The last one brings up .html pages that WordPress does not normally produce. In Search Console, the Performance report also shows queries in a language you do not use.
2. Unknown pages in the index and an extra owner
In Search Console, open Settings, then “Users and permissions”: an owner you do not know is a strong sign, because attackers add themselves to get their pages indexed. Then check the Sitemaps report: a sitemap you never submitted, or an exploding number of discovered pages, confirms the injection. The URL Inspection tool shows what Google actually received, even if the page seems to return a 404 error to you.
3. Redirects aimed only at mobiles or visitors coming from Google
Your customers complain about landing on a scam site and you cannot reproduce it? The redirect often targets only mobiles, visitors coming from a search engine, or a single visit per IP address. Test from the command line by imitating these visitors:
curl -sI -A "Mozilla/5.0 (iPhone; CPU iPhone OS 18_0 like Mac OS X) Mobile" \
-e "https://www.google.com/" https://yourdomain.com/
A Location header pointing to another domain means a server-side redirect. If nothing shows up, the redirect may be done in JavaScript: open the site on a smartphone over the mobile network, in a private window, by clicking a Google result. Then look for rules added at the top of the .htaccess file.
4. Suspicious files on the server
Connect over SFTP or SSH. A few searches are enough to bring out the usual hiding places:
# PHP in the media folder: there should be none
find wp-content/uploads -type f -name "*.php"
# .ico files that are not favicons, and @include lines that load them
find . -type f -name "*.ico" ! -name "favicon.ico"
grep -rlE --include=*.php "@include.*\.ico" .
# Files renamed .suspected by a hosting scanner
find . -name "*.suspected"
# Functions often used to hide code (many false positives)
grep -rlE --include=*.php "eval\(|base64_decode\(|gzinflate\(|str_rot13\(" wp-content
# PHP files modified in the last 14 days, newest first
find . -type f -name "*.php" -mtime -14 -printf "%TY-%Tm-%Td %p\n" | sort -r | head -40
An .ico file containing PHP, a name like wp-user.php in the root folder or a PHP file in uploads are strong clues. .suspected files mean a scanner has already found an infection: the code that created them may still be there. Also remember that a modification date can be faked with one command: a file dated 2019 is not necessarily clean.
5. Modified core files
WP-CLI compares your files with the checksums published by WordPress.org. It is the most reliable test for core and free plugins:
wp core verify-checksums --include-root
wp plugin verify-checksums --all
These commands cover neither themes, nor premium plugins, nor wp-config.php. So open that file and read the end: nothing should follow the line require_once ABSPATH . 'wp-settings.php';. That is exactly where the EssentialPlugin backdoor injected its code.
6. Unknown administrator accounts
Some backdoors hide their account from the user list in the Dashboard. Query the database directly (replace wp_ with your table prefix):
wp user list --role=administrator --fields=ID,user_login,user_email,user_registered
wp db query "SELECT u.ID, u.user_login, u.user_email, u.user_registered
FROM wp_users u JOIN wp_usermeta m ON m.user_id = u.ID
WHERE m.meta_key = 'wp_capabilities' AND m.meta_value LIKE '%administrator%'"
If the SQL query returns more accounts than wp user list or the Users screen, an account is hidden. A registration date on which nobody worked on the site, or a disposable e-mail address, is enough to treat the account as hostile.
7. Scheduled tasks and hidden plugins that reinfect
You deleted a file and it is back the next day? A scheduled task or a “must-use” plugin (the mu-plugins folder, loaded automatically and invisible in the usual list) recreates it.
wp cron event list --fields=hook,next_run_relative,recurrence
wp plugin list --status=must-use
wp plugin list --status=dropin
A hook with a random name, or one that matches no installed plugin, deserves a search in the code. Also check the server crontab and the scheduled tasks in your hosting control panel. Our definition of cron explains the difference between the two.
8. Injections in the database
Some infections touch no file at all: they live in the database. Three checks cover the common cases:
# Site address: a foreign value redirects the whole site
wp option get siteurl
wp option get home
# Scripts injected into content
wp db query "SELECT ID, post_title, post_status FROM wp_posts
WHERE post_content LIKE '%
Legitimate results are possible (a widget with an analytics snippet, a post that shows code): review each line. On a WooCommerce store, an unknown script on the checkout page should make you think of card skimming and calls for an immediate response.
External signals: Search Console and blocklists
- Search Console, “Security issues” and “Manual actions”: Google reports hacked content there, with sample URLs.
- Google Transparency Report (Safe Browsing): it shows whether your domain is currently considered dangerous. If it is, follow our guide to getting off the Safe Browsing list.
- Remote scanners (Sucuri SiteCheck, VirusTotal): they see the public pages and blocklists, nothing of what happens on the server.
- E-mail: messages landing in your customers’ spam folders or mass “undeliverable” bounces can point to a spam-sending script.
Summary table
| Infection | Symptom | Confirmation | Common false positive |
|---|---|---|---|
| SEO spam | Foreign titles in Google | site: searches, Search Console | Old deleted pages still cached |
| Targeted redirect | Complaints from mobile visitors | curl with mobile User-Agent and Referer | Legitimate language or app redirect |
| Backdoor | Often none | File searches, checksums | Encoded code from a commercial plugin |
| Hidden account | None in the Dashboard | SQL query on roles | Technical account of the host |
| Reinfection | Files that come back | Cron, mu-plugins, server crontab | Tasks of a cache or backup plugin |
| Database injection | Unknown scripts in pages | Queries on content and options | Analytics snippets |
Get alerted instead of searching
These checks take an hour; nobody runs them every week. WP Feint Pro automates part of the detection, without pretending to be something it is not:
- Integrity check: every day, core files are compared with the official WordPress.org list; modified and missing files and unknown PHP files in
wp-adminorwp-includesare reported by e-mail. - Activity log: a new administrator, a role change, a plugin installed in the middle of the night, an account e-mail changed.
- Alerts: an administrator logging in from an unknown device, a new known vulnerability in an installed plugin, a report every Monday.
Limits to know: the integrity check covers core, not plugins, themes, media or the database; the log does not see what goes through FTP. WP Feint is not an antivirus: to scan wp-content and the database, add a scanner such as those covered in Wordfence and WP Feint or MalCare and WP Feint.
If you find something
Do not delete anything in a hurry. Copy the suspicious files and the server logs (they date the intrusion), put the site in maintenance mode, then follow the step-by-step cleanup procedure. After the cleanup, apply the method to secure WordPress to prevent reinfection, and request a review from Google if spam pages were indexed.
Frequently asked questions
My site looks normal: can it still be hacked?
Yes. Many infections only show themselves to search engine crawlers, mobile visitors or people who are not logged in. A backdoor can also stay silent until it is activated.
How can I check without SSH access?
Run the external checks (site: searches, Search Console, Transparency Report), browse the folders over SFTP sorted by date, and use phpMyAdmin for the SQL queries. A scanner installed in WordPress completes these checks.
Does a base64_decode match mean the site is hacked?
Not necessarily: legitimate plugins use it. It is the combination that raises the alarm: an encoding function, a file in an unusual location, a recent date and a name that imitates a WordPress file.
Does WP Feint detect malware?
Pro detects changes to core files and suspicious account actions, and alerts you. It is not an antivirus: it does not scan the code of plugins, themes or the database.
Key takeaways
- Infections hide from the administrator: test like Google, like a mobile and from the command line.
- site: searches and Search Console reveal SEO spam and added owners.
- Files: PHP in uploads, .ico files containing PHP, .suspected files, the end of wp-config.php.
- Accounts and persistence: compare SQL with the Dashboard, read cron and mu-plugins.
- Database: siteurl, scripts in content and options.
Find out before your customers do
WP Feint Pro checks core integrity every day, logs administrator actions and alerts you by e-mail. The free version already reduces what bots can see of your site.
Sources
- web.dev: Fix the Japanese keyword hack (external link, opens in a new tab)
- WP-CLI: wp core verify-checksums (external link, opens in a new tab)
- Google: Safe Browsing Transparency Report (external link, opens in a new tab)
- BleepingComputer: WordPress plugin suite hacked to push malware (external link, opens in a new tab)


