In this article
Discovering that your website has been hacked is stressful. Customers may see spam, Google may show a red warning, and your search rankings can drop quickly. The good news is that most hacks on small business websites follow familiar patterns and can be cleaned up methodically. This hacked website fix guide walks you through how to confirm a hack, clean your site step by step, clear Google's warnings and make sure it does not happen again.
Signs your website has been hacked
Hacks are often designed to stay hidden from the owner. Here are the most common warning signs.
Spam pages appearing in Google
Search Google for site:yourdomain.com. If you see pages you never created, often in Japanese, or about pharmacy, gambling, loans or fake products, your site has likely been injected with spam. This is sometimes called the Japanese keyword hack or a pharma hack.
Strange redirects
Visitors land on your site and get sent to a scam, adult or "you won a prize" page. These redirects often only trigger for mobile users, first-time visitors or people coming from Google, so you may not see it when you visit directly.
Google or browser warnings
A full-page red warning such as "Deceptive site ahead" or "This site may harm your computer", or a "This site may be hacked" label under your result in Google search.
Spam sitemaps and Search Console alerts
Look in Google Search Console for:
- New sitemaps you did not submit
- New owners or users you did not add
- A sudden jump in indexed pages
- Messages under Security & Manual Actions
Other signs
- New admin users in your CMS
- Unknown files or folders on the server, often with random names
- Your host suspending the account or warning about malware
- Emails from your domain landing in spam, or a mail server being blacklisted
- The site suddenly becoming very slow or using unusual server resources
| Symptom | What it usually means |
|---|---|
| Unknown pages in Google | Spam content injected or generated by malicious code |
| Redirects to other sites | Malicious code in files, database or server config |
| Red browser warning | Google has flagged malware or phishing |
| Unknown sitemap in Search Console | Attacker added verification to promote spam pages |
| New admin users | Attacker created a backdoor login |
| Host suspension | Malware detected or server abuse |
Before you start: don't panic, but act quickly
- Do not delete everything immediately. You may destroy evidence that shows how the attacker got in.
- Take a full backup of the hacked site (files and database). It sounds odd, but it helps with investigation and protects against accidental data loss during cleanup.
- Inform your host. They may have logs, scanners or a clean snapshot.
- Consider a maintenance page if visitors are being redirected to harmful sites.
Step-by-step hacked website fix
Step 1: Lock down access
Change every password connected to the site, from a clean, malware-free computer:
- Hosting and control panel
- FTP and SFTP accounts
- Database users (and update the website config file to match)
- CMS admin accounts
- Domain registrar and DNS provider
- Google Search Console, Analytics and email accounts
Remove any users you do not recognise, and turn on two-factor authentication wherever possible.
Step 2: Find out what was changed
Look for:
- Recently modified files, especially PHP and JavaScript files
- Unknown files in upload folders, where scripts should never be
- Changes to
.htaccess,index.phpor server config files (common places for redirects) - Suspicious code such as long encoded strings,
eval,base64_decodeor unfamiliar external script URLs - Unknown cron jobs or scheduled tasks
- Database content with hidden links, scripts or spam posts
Server access logs can show which file or login was used to get in.
Step 3: Clean or replace the files
The safest approach is usually to replace rather than repair:
- Download fresh copies of your CMS core, theme and plugins from their official sources
- Replace the existing core files completely
- Reinstall themes and plugins from clean copies; delete any you do not use
- Keep only your genuine uploaded media, after checking that folder for scripts
- Carefully review custom code and config files line by line
If you have a backup from before the hack, restoring it can save time, but you must still complete the remaining steps.
Step 4: Clean the database
Search for injected scripts, hidden links, spam posts and unknown admin users. Check site settings such as the site URL, which attackers sometimes change to cause redirects.
Step 5: Fix the original weakness
This is the step most people skip, and why many sites get hacked again within weeks. Common entry points include:
- Outdated CMS, plugins or themes with known vulnerabilities
- Nulled or pirated themes and plugins, which often contain backdoors
- Weak or reused passwords
- Old, forgotten installations or test sites on the same hosting account
- Incorrect file permissions
- Outdated server software
Update everything, remove what you do not need and tighten permissions.
Step 6: Scan and test
- Run a malware scan on the server and with an external scanner
- Test the site on mobile, in a private window and by clicking through from Google search, since many redirects only trigger in those situations
- Search
site:yourdomain.comagain to check for remaining spam pages
Cleaning up in Google Search Console
Once the site is clean, you need to tell Google.
Check the Security Issues report
In Search Console, go to Security & Manual Actions > Security issues. It lists the problems Google found and sample affected URLs. Make sure each one is resolved.
Remove unauthorised owners and sitemaps
Under Settings > Users and permissions, remove any owners you do not recognise. Also remove the verification method they used (often a file or meta tag on your site). Then delete unfamiliar sitemaps under Sitemaps.
Deal with spam URLs
Spam pages you have removed should return a 404 or 410 status so Google drops them over time. You can use the Removals tool to temporarily hide the most visible ones from search results while that happens. Submit your clean, genuine sitemap.
Request a review
When everything is fixed, click Request Review in the Security issues report. Explain clearly:
- What the problem was
- What you removed or replaced
- How you closed the security hole
Google reviews the site and removes the warning if it is clean. If you also received a Manual Action for spam, request reconsideration from the Manual Actions report with similar details.
| Search Console area | What to do |
|---|---|
| Security issues | Fix listed issues, then request review |
| Manual actions | Fix spam problems, then request reconsideration |
| Users and permissions | Remove unknown owners and their verification |
| Sitemaps | Delete spam sitemaps, resubmit your real one |
| Removals | Temporarily hide prominent spam URLs |
| Pages (indexing) | Monitor spam URLs dropping out over time |
How to prevent your website from being hacked again
- Keep everything updated. CMS core, themes, plugins and server software.
- Use fewer plugins from reputable, actively maintained sources. Never use nulled software.
- Strong, unique passwords and two-factor login for every admin, hosting and registrar account.
- Limit admin access. Give people only the roles they need and remove old accounts.
- Use secure hosting. Isolated environments, firewalls and up-to-date software. Our comparison of VPS vs shared hosting explains the security trade-offs, and our managed hosting plans include server-level protection.
- Automated off-site backups with several versions kept and restores tested.
- Web application firewall and login protection to block common attacks and brute-force attempts.
- Monitor regularly. Check Search Console, uptime alerts and security scans.
A proper website maintenance plan covers most of this every month. Our article on website maintenance services in Bangalore has a full checklist.
When to clean up and when to rebuild
Cleaning is usually the right first step. But if the site runs on an old, unsupported platform, uses abandoned plugins, or keeps getting reinfected, a website redesign on a modern, secure foundation can be the better long-term option.
Conclusion
A hacked website fix follows a clear sequence: confirm the hack, lock down access, replace infected files, clean the database, close the original weakness, and then clear Google's warnings through Search Console. Prevention is far easier than recovery, so keep software updated, limit access, and keep tested off-site backups.
If your website has been hacked or Google is showing a warning, contact JST Click. Our team in J. P. Nagar, Bangalore can help clean up your site, close the security gaps and set up ongoing protection.
Frequently asked questions
How do I know if my website has been hacked?
Common signs include unfamiliar pages in Google search results (often in Japanese or about pharmacy or gambling), visitors being redirected to other sites, a Google or browser warning, new admin users you did not create, unexpected files on the server, or a warning email from your host or Search Console.
Can I just restore a backup to fix a hacked website?
Restoring a clean backup can help, but only if it was taken before the hack and you also fix the original weakness. Otherwise the attacker often gets back in. You also need to change all passwords and check for spam URLs that Google has already indexed.
How long does it take Google to remove a hacked site warning?
After you fix the problem and request a review in Search Console, Google usually processes it within days, though it can take longer. Spam URLs already indexed may take more time to drop out of search results.
Why does my site redirect to spam only on mobile or from Google?
Many hacks use conditional redirects that only trigger for mobile visitors, first-time visitors or people arriving from search engines. This hides the hack from the site owner, who usually visits directly while logged in.
How can I prevent my website from being hacked again?
Keep the CMS, themes and plugins updated, remove unused plugins and users, use strong unique passwords with two-factor login, keep secure hosting, run regular off-site backups, and monitor Search Console and security alerts.
- Website Security
- Malware Removal
- Search Console
- WordPress

Written by
Founder & CEO, JST CLICK
Shreyas Gowda founded JST CLICK in Bengaluru in 2022 after working as a senior software developer. With six years of experience in software development, he leads the team that builds websites, Android and iOS apps and custom software, and reviews the guides on this blog.






