Website Hacked? A Step-by-Step Recovery Plan for Business Owners

Quick summary
A calm, practical hacked website recovery plan for Indian business owners: how to contain the damage, clean files and database, remove Google warnings and stop the hack from coming back.
Summarise this article with AI
It usually starts with a phone call. A customer says your website is redirecting to a gambling page, Google shows a “This site may be hacked” warning, or your hosting provider emails to say your account has been suspended for sending spam. Panic follows, and panic leads to rushed decisions that make the problem worse.
This guide is a calm, structured plan for hacked website recovery, written for business owners and marketing managers rather than security specialists. Whether you run a WordPress site, a custom PHP website or an ecommerce store, the stages are broadly the same: contain, investigate, clean, restore trust and harden.
You will learn what to do in the first hour, how to clean files and databases properly, how to get Google warnings removed, what legal and customer obligations to think about, and how to make sure the same hack does not return next month.
Signs Your Website Has Been Hacked
Not every hack is obvious. Some attackers want visibility, others want to stay hidden for as long as possible. Watch for these signs:
- Redirects to unrelated sites, often only on mobile or only for visitors arriving from Google
- Strange pages in Google results, frequently in Japanese, pharma or betting keywords
- Browser or Google Search warnings about malware or deceptive content
- New admin users you did not create, or passwords that suddenly stop working
- Hosting suspension, unusual CPU usage or outgoing spam from your domain
- Unknown files in your server, especially PHP files in upload folders
- Pop-ups, injected links in the footer or scripts you did not add
Attackers often hide content from logged-in admins, so check your site from a private browser window on a phone, and search Google for site:yourdomain.com to see what has been indexed.
Step 1: Contain the Damage in the First Hour
The goal of the first hour is to stop further harm, not to fix everything.
- Do not delete everything in a hurry. You need evidence to find out how the attacker got in.
- Take a full backup of the hacked site, files and database, and label it clearly as infected. It is your forensic copy.
- Put the site in maintenance mode if it is actively harming visitors, for example redirecting to malware.
- Change critical passwords from a clean device: hosting control panel, FTP or SFTP, database, CMS admins, domain registrar and business email.
- Inform your hosting provider. Many hosts can share logs and scan reports, and some will lift a suspension once cleaning is under way.
- Pause paid ads pointing to the site so you do not pay to send customers to a compromised page.
Step 2: Investigate How the Attacker Got In
Cleaning without finding the entry point is like mopping the floor while the tap is still running. Common entry points we see on Indian business sites include:
- Outdated WordPress core, themes or plugins, especially “nulled” premium plugins downloaded from unofficial sites
- Weak or reused admin and FTP passwords
- Vulnerable file upload forms in custom PHP code that accept executable files
- SQL injection in old custom code that does not use prepared statements
- Shared hosting accounts where one infected site spreads to others in the same account
- Former developers or agencies whose access was never removed
Check server access logs for suspicious POST requests, look at file modification dates around when problems began, and list all admin users and their last login times. If the site has payment or customer data, consider bringing in a security professional at this stage.
Step 3: Clean Files and Database Thoroughly
Files
For a CMS such as WordPress, the most reliable approach is to replace core files with fresh copies from the official source, reinstall themes and plugins from trusted sources, and only carry over your own uploads and custom code after inspecting them. Look for:
- PHP files inside upload or image folders
- Obfuscated code using functions like eval, base64_decode or long encoded strings
- Modified .htaccess files with redirect rules you did not write
- Unfamiliar files with innocent-sounding names placed in the root folder
For custom PHP sites, compare the live code against your last known clean version in version control or a trusted backup. This is one strong reason to keep custom code in a repository.
Database
Attackers frequently inject spam links, hidden scripts or rogue admin accounts into the database. Search posts, options and settings tables for script tags, iframes and unknown domains, and remove unauthorised users. Export a cleaned copy once you are confident.
Restoring from backup: when it works
Restoring an old backup is quick, but only safe if you know the backup predates the infection and you fix the entry point before going live. Otherwise the site will be reinfected, sometimes within hours.
Step 4: Restore Trust with Google, Visitors and Customers
Google Search Console
If Google has flagged your site, check the Security Issues report in Google Search Console. Once the site is clean, request a review, explaining briefly what you found and fixed. Also use the Pages report and URL removal tools to deal with spam pages that were indexed, and make sure those URLs now return a proper “not found” or “gone” response.
Hosting, email and blocklists
If your domain was used to send spam, your business email may land in junk folders for a while. Check common email blocklists and request delisting after cleaning. Review email authentication records such as SPF, DKIM and DMARC with your IT person or provider.
Customers and legal obligations
If personal data such as names, phone numbers, addresses or order details may have been accessed, think carefully about your obligations. India’s Digital Personal Data Protection Act, 2023 and its rules include breach notification duties, and CERT-In has issued directions requiring certain cyber incidents to be reported within short time frames. Which rules apply depends on your business and the data involved, so take advice from a qualified professional rather than guessing.
Step 5: Harden the Site So It Does Not Happen Again
Sites that are cleaned but not hardened are often hacked again through the same gap. Recovery is incomplete until you close the gaps.
| Area | What to do | How often |
|---|---|---|
| Updates | Update CMS core, themes and plugins; remove unused ones | Weekly or monthly |
| Access | Unique strong passwords, two-factor login, remove old users | Review quarterly |
| Backups | Automated off-server backups of files and database; test restores | Daily or weekly |
| Code | Validate uploads, use prepared statements, restrict file permissions | On every change |
| Monitoring | Uptime checks, file change alerts, malware scans | Continuous |
| Firewall | Web application firewall at host, CDN or plugin level | Always on |
Our website security checklist goes deeper into each area. If nobody in your team owns these tasks, a monthly website maintenance plan is usually cheaper than another emergency clean-up.
DIY or Professional Help? How to Decide
Some simple infections can be cleaned in-house by a technically comfortable team member. Bring in professionals when:
- The site handles payments, customer accounts or sensitive personal data.
- The infection keeps returning after you clean it.
- Google has flagged the site and enquiries or sales have dropped.
- You cannot identify the entry point.
- The site is custom-built and you no longer have access to the original developer.
A good recovery partner should give you a clear report: what was found, what was cleaned, how the attacker got in and what was changed to prevent a repeat. Ask for a cleaned database export and a full site backup after the work is done, so you have a known-good starting point.
From our work at Lionic Digital: on the hacked sites we have cleaned, including a client's custom PHP website and our own former WordPress site, the same order worked every time: copy the hacked state first, hunt for every injected file rather than only the obvious one, remove unknown admin users, change every password and key, and rebuild from clean code where possible. We hand the client two files at the end: one full cleaned database and one full website zip.
Frequently Asked Questions
How long does hacked website recovery take?
A straightforward infection on a small site can often be cleaned within a day or two. Complex or repeated infections, large ecommerce sites and Google review requests can take longer. The timeline depends on the size of the site, the type of malware and access to clean backups.
Will a hack affect my Google rankings?
It can. Security warnings reduce clicks, spam pages can dilute your site’s relevance, and malicious redirects may lead Google to show warnings or reduce visibility. Rankings usually recover after a thorough clean-up and review, though not always instantly.
Is a security plugin enough to clean my WordPress site?
Security plugins help detect and block threats, but they can miss well-hidden backdoors. Treat scan results as a starting point, and combine them with manual checks and fresh core, theme and plugin files.
Should I move to a new host after a hack?
Not automatically. If the entry point was your code or passwords, moving hosts will not help. Consider moving if the host is outdated, offers no isolation between sites or provides poor support and backups.
Can I recover if I have no backup at all?
Usually yes, by cleaning the infected copy carefully. It takes longer and needs more expertise, which is why setting up automated off-site backups is one of the first hardening steps we recommend.
Recover Calmly, Then Prevent the Next One
Successful hacked website recovery follows a clear sequence: contain the damage, find the entry point, clean files and database thoroughly, restore trust with Google and customers, and harden the site with updates, access controls, backups and monitoring. Skip a step and the hack often returns.
If your site is compromised right now or you want ongoing protection, explore our website support and maintenance services or contact our team in Ahmedabad for a recovery assessment.
Found this useful? Share it with your team.


