Categories: Wordpress

How to Check if Your WordPress Site Is Hacked

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.

What you need before you start

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.

Step 1: Check the 10 signs of a hacked WordPress site

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.

  1. Unexpected redirects: your site sends visitors to a shopping, betting, adult, pharmacy or login-looking page that you did not create. Try the homepage, a blog post and the login page while logged out.
  2. Spam pages in Google: search 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.
  3. A Google or browser warning: Search Console, Google Search or Chrome may show a hacked-site, malware or deceptive-content warning. Treat this as urgent because visitors can be warned before they reach your page.
  4. New administrator accounts: open Users and look for accounts, email addresses or registration dates you do not recognise. A new admin is stronger evidence than an ordinary failed login notification.
  5. Changed content or settings: inspect posts, pages, menus, widgets, theme settings and the site title. Look for links, scripts, users or redirects that no authorised person added.
  6. Strange files: new PHP files in the WordPress root, wp-content/uploads, a theme folder or a plugin folder deserve investigation. An image upload folder normally contains media, not executable PHP files.
  7. Email or hosting alerts: messages about password resets, outgoing spam, a blocked account or unusual logins can indicate that access credentials were exposed.
  8. Cloaked behaviour: the site works when you are logged in but redirects when you arrive from Google, use a phone or open a private browser window. Test from a clean device and a different network where possible.
  9. Sudden search or traffic changes: a sharp fall in normal visits, a new collection of foreign-language pages or unfamiliar search queries can follow an SEO spam injection.
  10. Unknown code in important files: unexpected code in .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.

Step 2: Run free external and WordPress checks

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.

Check Google Search Console

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.

Check the site from the outside

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.

Run an inside scan

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.

Step 3: Contain the site during the first hour

Why this matters: every minute of continued access gives an attacker more time to change files, create users or send spam from your domain.

  1. Record evidence. Save the exact URLs, timestamps with your timezone, screenshots, Search Console examples, scanner output and recent changes. Keep the original report even after the site looks normal.
  2. Create a current backup or snapshot. Save both the database and files before making changes. Label it as the current state, not as a clean backup.
  3. Use a clean device. Update its operating system and run a malware scan before signing in. Do not change passwords from a computer you suspect may have a keylogger.
  4. Put the site in maintenance mode if visitors could see malware, fake forms or unwanted downloads. Keep a simple notice available while you work.
  5. Change exposed credentials. Start with WordPress administrators, the hosting panel, SFTP or FTP, email accounts used for password resets, the database user and any API keys. Use new, unique passwords. If you change the database password, update wp-config.php immediately or the site will lose its database connection.
  6. End existing sessions. Rotate the WordPress authentication keys and salts in wp-config.php using fresh values from the official WordPress key generator. This signs out sessions that were created with the old keys.
  7. Tell the host what you found. Ask for a scan of the whole hosting account and relevant access logs, not just the public homepage. A shared account can contain more than one affected website.

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.

Step 4: Audit files, plugins and users

Why this matters: a public scan can miss a hidden administrator, a modified plugin or a file that only runs for a particular visitor.

Start with the dashboard

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.

Use WP-CLI if you have terminal access

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.

Step 5: Clean the infection or restore a known-clean copy

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.

If you have a known-clean backup

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.

If there is no known-clean backup

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.

Step 6: Verify the repair before going live

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.

Step 7: Prevent the next WordPress hack

Why this matters: cleanup without closing the original access route leaves the same site exposed to a repeat compromise.

  • Keep WordPress core, plugins, themes and the PHP version current. Turn on automatic minor core updates where they fit your workflow, and review major updates before applying them.
  • Delete unused plugins and themes. Never install “nulled” or modified copies of paid software; use the original vendor or the official WordPress directory.
  • Give each person the lowest WordPress role they need. Review administrators monthly and remove old access.
  • Use a long, unique password for every account and add two-factor authentication for administrators.
  • Protect the hosting panel, SFTP or FTP, email recovery accounts and database credentials as carefully as WordPress itself.
  • Keep separate, dated backups of files and the database. Test a restore on a schedule so you know which backup is clean and usable.
  • Review Search Console, login activity, file changes and important pages regularly. Set an external uptime or change alert if your business depends on the site.
  • Keep HTTPS enabled and use a hosting setup with straightforward WordPress installation, a PHP version selector and self-service backup and restore tools. HostKarle’s WordPress hosting uses the DirectAdmin plans, Softaculous one-click installation, free SSL, free migration and INR checkout.

Success looks like this: updates, access reviews, backups and monitoring are recurring tasks, not something you remember only after the next warning.

FAQ

How can I check if my WordPress site is hacked for free?

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.

What are the first signs of a hacked WordPress website?

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.

Should I delete infected WordPress files?

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.

Can I fix a hacked WordPress site by restoring a backup?

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.

When should I ask a professional to clean my WordPress site?

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.

Official references

Samrat Ghosh

Samrat Ghosh writes hands-on guides about web hosting, WordPress, domains and email for Indian small businesses, students and freelancers - the practical documentation he wishes had existed when he set up his first website.

Share
Published by
Samrat Ghosh

Recent Posts

Zoho Mail Alternatives for Indian Businesses (2026)

Compare zoho mail alternatives for Indian businesses by rupee cost, IMAP access and mailbox limits,…

3 hours ago

Best Wix Alternatives in India for Small Businesses

Compare Wix alternatives for Indian small businesses: see 3-year rupee costs, WordPress hosting, migration limits,…

14 hours ago

Titan Email Price in India: Cost per Mailbox Explained

Titan email price in India explained with mailbox costs, features, team totals and a comparison…

20 hours ago

HostKarle vs Bluehost India: Price, Renewal and Panel

HostKarle vs Bluehost compares Indian shared hosting prices, renewal bills, email, SSL, backups, panels and…

1 day ago

Hindi Blog Kaise Banaye: WordPress Step-by-Step Guide

Learn how to write blog in hindi with WordPress, Hindi typing tools, domain and hosting…

2 days ago

Google Workspace Alternatives in India for Small Teams

Compare Google Workspace alternatives in India by yearly rupee cost, email features and migration effort…

2 days ago

This website uses cookies.