21+ years in hosting · Jaipur, India · INR billing with 18% GST · 24/7 email support
Blog · WebJi® India

How to Clean a Hacked Website

Quick answer

Clean a hacked website by confirming the symptoms, restricting access with the host and preserving the infected files, database and logs. Recover trusted components and confirmed data changes on a safe copy, close the entry point and revoke exposed credentials. Test the whole affected site before reopening or requesting a security review; unfamiliar files alone are not proof.

For website owners recovering a compromise while protecting customer records, preserving evidence and avoiding destructive scanner-based cleanup shortcuts.

✓ In business since 2005
✓ INR + GST billing
✓ 24/7 Email Support — avg reply < 60 min
GuideWebJi®
knowledge
Read time
5 min
Sections
7
Updated
14 Nov 2026
Written by
WebJi® team

How to confirm and isolate a hacked website

Confirm indicators of compromise, preserve the incident evidence and coordinate containment with the host before cleaning a website. Unfamiliar files or account suspension alone do not establish the cause. Restrict access at the hosting layer; a cosmetic maintenance page does not prove malicious code has stopped executing.

  • Google shows a hacked-site or deceptive-site warning.
  • Search or mobile visitors land on another domain.
  • A new administrator is in the user list.
  • The host suspends the account.
  • Ads or odd links appear in the page source but not in your editor.

Unhacking a site is this same job. Do not start by deleting random files. Note what you see, including whether the fault is on one URL or every URL. On cPanel, ask the host which restriction blocks the affected traffic and code execution while you work.

How to back up a hacked website before cleanup

Save a full copy of the infected site before you change a file. That copy is evidence, and a rollback if a delete breaks a shop. It is not a clean restore point.

Use the host backup tool, or download the site files and a database dump, and store them off the server. Record the date you last saw the site looking normal. File dates are clues, not proof of the intrusion timeline; compare logs, backups and known-good copies.

Keep incident copies in restricted storage, not a publicly downloadable archive. The backup and restore guide helps distinguish application files from the database. For WordPress-specific checks, use the WordPress recovery procedure.

When to restore a backup instead of cleaning files

Restore a backup when you have a copy from before the hack and you have scanned that copy. Clean the live files when the only clean backup is so old that you would lose orders, posts, or payments you still need.

When to restore a backup instead of cleaning files
SituationWhat to do
Scanned backup from before the hack, and little new contentRestore that backup, address the entry point and rotate credentials
Backup is old, or new orders exist only on the live siteRecover on an isolated copy and reconcile required new data
Every backup still redirects or contains scripts in uploadsDo not restore it. Clean the live copy

Scan the archive before you trust it. Malware is often older than the day you noticed it. If the restored site still redirects in a private window, the archive was already infected and you go back to a file-by-file clean.

How to scan and remove malware from a hacked website

Delete malware only after the infected backup is stored off the server. A scanner catches known signatures. It misses backdoors in the database and in files you edited, so check the places below even when the scan looks quiet.

  1. Run the host malware scan, or a security plugin if the admin panel still opens. Write down every path it flags.
  2. In WordPress, open wp-content/uploads and review executable files against known-good sources before removing confirmed malicious code. That folder should hold media.
  3. Read .htaccess, index.php, wp-config.php, and the active theme header, footer, and functions files. Preserve suspect content and remove only changes confirmed to be malicious.
  4. In the database, review and revoke unauthorised administrator access after preserving records, and remove injected links from posts and the options table.
  5. Replace wp-admin and wp-includes with a fresh copy of the same WordPress version. Keep your own wp-config.php. Reinstall plugins and themes from the vendor, not from a free copy of a paid zip.
  6. On a site that is not WordPress, replace the application core from the vendor and treat recently changed files outside the content folders as suspect.

Test in a private window after each major delete. If the homepage breaks, you know which change did it. A scanner result, name or timestamp needs investigation against trusted files and logs.

How to patch files and passwords after a website hack

Change every secret after the files are clean. A new admin password does nothing if FTP still accepts the old one and the attacker uploads the malware again.

  • Hosting panel password.
  • FTP and SFTP accounts.
  • Database user, then the password inside the config file.
  • Every CMS administrator.
  • Email accounts that can reset the passwords above.

Update core, plugins, themes, and the PHP version the host still supports. On a shop, update one plugin at a time. A white screen is usually a single plugin: rename its folder in the file manager to turn it off. Delete inactive plugins and themes. Replace the WordPress authentication salts so old login cookies stop working.

How to request blacklist removal for a cleaned website

Request a security review only after all reported issues have been fixed throughout the website and the fixes have been tested. A clean homepage or a private-window check is not enough to demonstrate that every affected page is safe.

  1. In Google Search Console, open the security issue and request a review. Say which files you removed and which passwords you changed.
  2. Clear the site cache and any CDN cache before you decide the public URL is clean.
  3. Leave the site online and clean while you wait. The review is not instant. If a warning remains or returns, investigate residual infection, reinfection and delayed reputation updates.

Other browsers and security tools keep their own lists. Fix Google first. The same clean homepage is what those other checks need to see.

The Search Console Security Issues documentation says example URLs are only samples. Describe the cause, actions and verified outcome in the review request, and wait for the decision rather than submitting repeated requests.

How to prevent hacking of a website after cleanup

Stop the next hack by closing the hole that let this one in. Cleaning files, then leaving the outdated plugin and the old FTP password, is why the site is hacked again.

  • Update core, plugins, and themes, and delete anything abandoned.
  • Use a unique password and two-factor authentication on the admin, the email, and the host.
  • Do not install nulled themes or free copies of paid plugins.
  • Keep off-site backups, and restore one as a test so you know the archive opens.
  • Run a vulnerability check after cleanup so the next outdated plugin is visible before it is used.

WebJi® website security services include a security audit and malware-cleanup consultancy at ₹4,200 a year before 18% GST, read on 30 October 2026. Anything outside that line is quoted before you pay: Contact WebJi® and the desk sends the figure first. A WordPress site can add WordPress security hardening once the files are clean.

FAQ

Frequently asked questions

What should I do first if my website gets hacked?

Take the public site offline or put it in maintenance, then save a full copy of the infected files and the database somewhere that is not on that server. Do not delete files first, and do not pay a ransom note before that copy exists.

Can a hacked website be recovered?

Yes. Restore a backup you have scanned and found clean, or replace the application core and delete injected code while you keep posts and orders. Recovery fails when every backup is infected, or the database was dropped and you have no dump.

How do I clean a hacked WordPress website myself?

Preserve files, database and logs, involve the host and recover trusted application components on an isolated copy. Review suspicious users and database changes without deleting legitimate records. Patch the entry point, revoke exposed access and test the recovered site before reopening.

How do I get my site off Google's blacklist?

Resolve the reported issue across the site, not just its sample URLs. Verify the repair, then use Request Review in Search Console’s Security Issues report and describe what changed. Wait for the pending decision; repeated requests do not speed it up.

How much does professional malware cleanup cost in India?

WebJi® lists Website Security Consultancy at ₹4,200 a year before 18% GST. That price was read on 30 October 2026 from published billing information and covers a security audit plus malware-cleanup consultancy. Cleanup outside that line is quoted by email at support@webji.services before you pay.

Last editorial update: 14 November 2026. Prices follow the dated sources on this page; checkout confirms current charges.

WebJi® since 2005

Ready to get started with WebJi®?

Join 12,000+ businesses across India and overseas. INR pricing, 18% GST shown before payment and 24/7 email support in Hindi and English — average first reply under 60 minutes.