If you are wondering how to check if wordpress site is hacked, start with redirects, spam pages, unknown users and warnings from Google rather than guessing from one broken page. This guide gives you a safe order for checking the site, containing the problem, cleaning it or restoring a known-clean copy, and stopping the same entry point from being used again.
You need the website address, access to a WordPress administrator account or your hosting panel, and a clean device for changing passwords. If you have SSH or terminal access, keep your WordPress path ready; otherwise, use the dashboard, file manager and database tools provided by your host.
Also collect the last known-good date, recent update or plugin changes, the first suspicious URL, screenshots of warnings, and any email from Google or your host. Do not delete suspicious files before making a copy of the current site. Even an infected copy can help you understand what happened.
If the site takes payments or collects enquiries, temporarily disable the affected form or checkout while you investigate. If you cannot safely read PHP, server configuration or database content, stop after the evidence-gathering steps and ask a WordPress security professional to handle cleanup.
Why this matters: a hack can be selective, so your homepage may look normal while Google visitors, mobile users or logged-out visitors see something different.
Check these signs in order. One symptom can have another cause, but several together should be treated as a security incident.
site:example.com after replacing example.com with your domain. Add a word you do not use, such as pharmacy, casino or loan, to find injected pages and titles.wp-content/uploads, a theme folder or a plugin folder deserve investigation. An image upload folder normally contains media, not executable PHP files..htaccess, wp-config.php, index.php, the active theme’s functions.php, or wp-content/mu-plugins needs review. Do not remove a line just because it looks technical; first save a copy and identify what it does.If you find only a blank page or a 500 error, that does not prove a hack. Check the error logs and your recent changes as well; a broken update can look similar to an intrusion.
Success looks like this: you have a written list of symptoms, affected URLs, dates and visitor conditions, rather than a general feeling that something is wrong.
Why this matters: external checks can reveal what ordinary visitors, Google and security databases see, while an inside-the-site check can find files and users that a remote scan cannot reach.
Open Security issues in the verified property for your domain. Read the example URLs and issue type instead of relying only on the red warning. Google groups problems such as code injection, content injection, URL injection and deceptive pages differently, and each example gives you a place to start.
If you do not have Search Console access, use Google’s Safe Browsing status check with your full URL. Also run a Google search such as:
site:example.com pharmacy
site:example.com casino Replace example.com and choose terms unrelated to your business. Do not open a suspicious result in your normal browser if it is labelled dangerous. Record the URL and inspect it from Search Console or with a command-line request instead.
This command follows redirects and shows response headers. Run it from a computer with curl, replacing the example URL:
curl -sS -D - -o /dev/null -L --max-redirs 5 \
--referer "https://www.google.com/" \
--user-agent "Mozilla/5.0" \
"https://example.com/" Look for an unexpected Location: header, repeated redirects, a suspicious final domain or different behaviour when the referrer changes. Repeat it for a URL listed in Search Console. A clean result here is useful, but it does not prove the files and database are clean.
If you can still access WordPress, install one established security scanner from the official WordPress directory, update its malware signatures, and run a full scan. Review the file names and reason for each alert; scanners can report modified but legitimate custom files as well as malware.
Run a second check from your hosting panel if one is available. Remote scanners see the public response, while an application-level scanner can inspect more of the WordPress files and database. No single scan is a final certificate of safety.
Success looks like this: you know what Google, a normal visitor and your WordPress installation each report, and you have saved the scan results for comparison after cleanup.
Why this matters: every minute of continued access gives an attacker more time to change files, create users or send spam from your domain.
wp-config.php immediately or the site will lose its database connection.wp-config.php using fresh values from the official WordPress key generator. This signs out sessions that were created with the old keys.Success looks like this: you have a timestamped record, a recoverable copy of the current site, no active unknown sessions, and a temporary path for visitors while you investigate.
Why this matters: a public scan can miss a hidden administrator, a modified plugin or a file that only runs for a particular visitor.
In Users, list every administrator and confirm the name and email with the owner. Remove or downgrade accounts that nobody authorised, but keep your evidence first. In Plugins and Themes, remove software that is unused or came from an unofficial source, then replace required software with a fresh copy from its original vendor.
Check Tools → Site Health for outdated PHP, WordPress, plugins and themes. Update only after you have a backup and a recovery plan. If an update breaks the site, use the backup or staging copy rather than leaving an old vulnerable version online.
Run these read-oriented checks from the WordPress installation directory:
wp core verify-checksums --include-root --version="$(wp core version)"
wp plugin verify-checksums --all --strict
wp user list --role=administrator
find wp-content/uploads -type f -name "*.php" -print
find . -type f -name "*.php" -mtime -30 -print The first command compares WordPress core files with official checksums. The plugin check can warn for premium or custom plugins that do not publish checksums; that warning is a prompt to verify the source, not automatic proof of malware. The user command shows administrator accounts, and the find commands provide leads for files to review.
Inspect .htaccess, wp-config.php, wp-content/mu-plugins, the active theme files and any unfamiliar PHP file. Search for obfuscated code only as an investigation aid:
grep -RInE 'base64_decode|gzinflate|eval[[:space:]]*\(|shell_exec|passthru' \
wp-config.php .htaccess wp-content 2>/dev/null These strings can appear in legitimate software, so do not mass-delete every matching line. Compare the file with a fresh copy from the same vendor and ask a developer if you cannot explain the difference.
Success looks like a documented list of known administrators, plugins, themes and files, plus a short list of items that need replacement, removal or expert review.
Why this matters: restoring or replacing the right layer removes the attacker’s code, but restoring an infected backup or leaving the original vulnerability open can bring the problem back.
Choose a backup made before the first suspicious change, not merely the most recent backup. Restore the files and database together in an isolated or maintenance state, then check the homepage, login, important pages, forms and media.
After the restore, immediately update WordPress core, plugins, themes and PHP where your site supports the newer version. Replace any software that is no longer maintained, remove unused components, rotate every credential again, and run the checks from Step 2 and Step 4.
Use the WordPress backup guide to build a regular database-and-files backup routine. A backup is useful only when you know its date and can restore it.
Keep the current evidence copy. Then work from a fresh WordPress download and clean vendor copies of the active theme and required plugins. Replace core directories such as wp-admin and wp-includes only when you understand the version and have a recovery copy. Preserve uploads carefully, because media folders can contain both genuine images and unwanted files.
Review the database for unknown users, spam posts, injected options and altered URLs. Check .htaccess, wp-config.php, theme files, must-use plugins and scheduled tasks. If the attacker had administrator or hosting access, assume credentials are exposed until they have been changed after cleanup.
If you cannot confidently distinguish application code from malware, do not guess. Keep the site restricted and use an experienced WordPress security professional. The WordPress security checklist is useful for the follow-up hardening work, while this WordPress reinstall guide explains the planning needed before a rebuild.
Success looks like a clean restore or a reviewed fresh set of files, no unknown accounts, no suspicious redirects, and a second scan with no unexplained findings.
Why this matters: a site can look fixed to an administrator while serving different content to Google, mobile visitors or logged-out users.
Test the site from a clean browser in a private window and from a phone. Open the homepage, several old posts, the contact or checkout flow, the WordPress login and any URL reported by Google. Confirm that HTTPS works, forms reach the correct inbox, and no unexpected external requests or redirects appear.
Repeat the site: search with the spam terms you recorded. Re-run the external request with and without a Google referrer, the external scanner, the WordPress scanner and the WP-CLI checksum checks. Review the hosting access log for fresh suspicious requests after you changed the credentials.
In Search Console, fix every example category shown in Security issues, then request a review only when the entire site is clean. Google says reviews can take from a few days to a few weeks, and warning systems can take additional time to update. Keep monitoring while the review is pending.
Success looks like normal content for different visitor types, no new suspicious files or users, clean scan results that you understand, and a submitted Google review where one is required.
Why this matters: cleanup without closing the original access route leaves the same site exposed to a repeat compromise.
Success looks like this: updates, access reviews, backups and monitoring are recurring tasks, not something you remember only after the next warning.
Start with Google Search Console’s Security issues report, a Safe Browsing check, a site:yourdomain.com search for spam terms and a reputable WordPress scanner. Then review administrators, recent files and core checksums if you have terminal access. A free remote scan is helpful, but it cannot prove that the database and private files are clean.
Unexpected redirects, spam pages, unknown admin accounts, strange PHP files, altered content and Google or browser warnings are common signs. Selective redirects that appear only on mobile or after a Google click are also important clues.
Do not delete files before preserving a current backup and evidence. Replace core, plugins and themes with clean copies where appropriate, but inspect custom code and uploads carefully because a matching filename does not prove that a file is malicious.
You can often recover faster with a backup created before the first suspicious change, but you still need to update software, rotate credentials and fix the entry point. If the backup was created after the infection, restoring it may restore the backdoor as well.
Ask for help when you cannot read PHP, server rules or database records, when the site handles payments or personal data, or when files return after removal. Also ask for help if you lose administrator access or Google still reports malware after a careful restore and cleanup.
Compare zoho mail alternatives for Indian businesses by rupee cost, IMAP access and mailbox limits,…
Compare Wix alternatives for Indian small businesses: see 3-year rupee costs, WordPress hosting, migration limits,…
Titan email price in India explained with mailbox costs, features, team totals and a comparison…
HostKarle vs Bluehost compares Indian shared hosting prices, renewal bills, email, SSL, backups, panels and…
Learn how to write blog in hindi with WordPress, Hindi typing tools, domain and hosting…
Compare Google Workspace alternatives in India by yearly rupee cost, email features and migration effort…
This website uses cookies.