{codevo}

Website hacked? What to do right now

Updated · 4 min read · by the Codevo team

Short answer

Change every password first: hosting, WordPress admin, FTP, database and email. Take a full backup of the infected site for investigation, tell your host, then remove the malware, update or replace every plugin and theme, and close the hole the attacker used. Finally, request a review in Google Search Console under Security issues.

What you might be seeing

  • ✗When I open my site from Google it redirects to a betting, pharma or adult site.
  • ✗Google shows "This site may be hacked" under my site in search results.
  • ✗Chrome shows a red "Dangerous site" or "Deceptive site ahead" screen.
  • ✗Searching site:mydomain.com shows Japanese or Chinese pages I never made.
  • ✗There are new admin users in WordPress that nobody on my team created.
  • ✗My host suspended the account or emailed me about malware or spam being sent.

Common causes

Roughly in order of how often we see them.

  1. 01

    Outdated plugins, themes or WordPress core

    Most WordPress hacks come through a plugin or theme with a known, published vulnerability. Bots scan the internet for sites running that exact version and exploit them automatically, usually within days of the flaw going public.

  2. 02

    Nulled (pirated) themes and plugins

    "Free" copies of paid themes from download sites often ship with a backdoor already inside. The site can look fine for weeks before the attacker uses it.

  3. 03

    Weak, reused or leaked passwords

    Admin logins like admin/admin123, or a password reused from an account that appeared in a data breach, get guessed by brute-force bots. The same applies to FTP, cPanel and email passwords.

  4. 04

    Compromised hosting account or neighbouring site

    On shared hosting, one infected site in the same account (an old test install, a forgotten subdomain) can infect every other site in that account. A stolen cPanel or hPanel login gives the attacker everything.

  5. 05

    Injected redirects and spam pages

    Attackers add code to .htaccess, wp-config.php, theme files or the database that redirects visitors coming from Google or mobile phones, while showing the normal site to you as a logged-in admin. That is why owners often cannot see the problem themselves.

  6. 06

    Japanese keyword hack

    Thousands of auto-generated pages in Japanese selling fake brand goods are created on your domain, and sometimes the attacker adds their own account to your Search Console as an owner so they can submit sitemaps for those pages.

What you can check yourself

Safe steps you can try before calling anyone. Take a backup before changing anything.

  1. 1

    Change all passwords from a clean device

    Change your hosting panel (cPanel, hPanel, Plesk), WordPress admin, FTP/SFTP, database and domain registrar passwords. Use a different, long password for each. If your own computer might have malware, do this from another device.

  2. 2

    Take a backup before anything is deleted

    Download a full copy of the files and an export of the database from your hosting panel, even though it is infected. Label it clearly as infected. A developer needs it to find how the attacker got in, and it is your fallback if a cleanup goes wrong.

  3. 3

    Contact your hosting provider

    Tell them the site is hacked and ask if they have malware scan results, access logs and clean backups from before the infection. Many hosts keep daily backups for a few days to a few weeks.

  4. 4

    Check Search Console and Safe Browsing

    In Google Search Console open Security & Manual Actions → Security issues to see what Google found and sample URLs. Also check Settings → Users and permissions and remove any owner you do not recognise. You can check your domain at transparencyreport.google.com/safe-browsing/search.

  5. 5

    Look for unknown admin users

    In WordPress go to Users → All Users and filter by Administrator. Note any account you do not recognise. Do not just delete it yet: take the backup first, then remove it, as it is evidence of the entry point.

  6. 6

    Test from a logged-out phone

    Open a Google search for your business on your mobile data, in an incognito tab, and click your result. Many redirect hacks only trigger for visitors coming from Google on mobile, not for you as a logged-in admin.

When to call a developer

  • →The redirects or spam pages come back after you deleted them or restored a backup.
  • →You cannot tell which files are original and which were added by the attacker.
  • →Your host has suspended the account and wants the site cleaned before reactivating it.
  • →The site handles customer data or payments and you need to know what was accessed.
  • →Google still shows the hacked warning and your review request was rejected.

How we fix it

  1. [1]We take a forensic copy of the files, database and server access logs before changing anything, then lock down every login and remove unknown users and SSH keys.
  2. [2]We compare WordPress core, plugins and themes against clean copies from the official sources, so modified or extra files show up, and search the database for injected scripts, spam posts and rogue options.
  3. [3]We replace core, plugins and themes with fresh copies instead of trying to clean infected ones, remove nulled software, and clean .htaccess, wp-config.php, the uploads folder and cron jobs where backdoors usually hide.
  4. [4]We find the entry point from the logs and file dates, whether that is a vulnerable plugin, a stolen password or another site in the same hosting account, and close it.
  5. [5]We remove the spam URLs (returning 404 or 410), clear the Security issues in Search Console, submit a review request with notes on what was fixed, and check the Safe Browsing status until the warning is lifted.
  6. [6]We set up automatic updates where safe, off-server backups, two-factor login and file change monitoring so a repeat is caught early.

Want the details on how we handle bug fixes and maintenance? See our bug fixing service.

Questions people ask

Q.01How do I know if my website is hacked?

Common signs are redirects to spam sites, a "This site may be hacked" note in Google results, a red browser warning, strange pages in a site: search, or unknown admin users. Check Security issues in Google Search Console. Also test from a phone in incognito mode, because many hacks hide from logged-in admins.

Q.02Can I just restore a backup to fix a hacked website?

A clean backup from before the infection helps, but on its own it usually leads to the same hack again because the hole is still open. You also need to update everything, change all passwords and find how the attacker got in. Make sure the backup is actually clean, as some infections sit unnoticed for weeks.

Q.03How long does it take Google to remove the hacked warning?

After you fix the site and request a review in Search Console, Google says hacked-site reviews can take several days. Malware and phishing reviews for Safe Browsing are often quicker. If the review is rejected, Google lists what it still found.

Q.04Why does my website redirect to another site only on mobile?

Attackers often add conditional redirects that only fire for mobile visitors, visitors coming from Google, or people who are not logged in. This keeps the owner from noticing. The code usually sits in .htaccess, a theme file, a plugin or the database.

Q.05Is a security plugin enough to remove malware from WordPress?

Scanners like Wordfence or Sucuri are good at finding known malware, but they can miss custom backdoors and database injections. They also do not tell you how the attacker got in. Use them as one tool, not the whole cleanup.

Q.06How do I remove Japanese keyword spam from Google search?

First remove the spam pages and the code that creates them, and remove any unknown owners from Search Console. Make the spam URLs return 404 or 410 so Google drops them over time. The Removals tool in Search Console can hide the worst URLs temporarily while that happens.

→/Next step

Still stuck? Send it to us and we'll take a look.

Tell us about your project or the issue you're facing. We'll reply with next steps and a free consultation.

support@thecodevo.com