Articles · Website upkeep
What to do if your website gets hacked
By Armstrong Websites. Published . Updated .
If your website has been hacked, limit the damage first: put the site into maintenance mode or ask your host to take it offline, then change your passwords. After that, restore a clean backup or have the site cleaned, update all the software, and ask Google to review it. Work through the steps below in order, and write down what you do as you go.
Signs that a site has been hacked
Some hacks are obvious. Many are not. Watch for these:
- Visitors are sent to a different website, often one selling pills or gambling.
- Google shows a warning such as “This site may be hacked,” or the browser shows a red warning page.
- Pages or links appear that you did not create.
- Your site shows up in Google with text in another language or with odd page titles.
- You cannot log in, or there are admin users you do not recognize.
- Your host suspends the account or emails you about malware or spam.
One of these alone does not prove a hack, but treat any of them as a reason to check.
Limit the damage first
A hacked site can harm your visitors. It may send them to scam pages or try to install harmful software. Stop that before you start fixing.
If you can still log in, switch on maintenance mode. If you cannot, ask your host to take the site offline or block public access.
Do not delete the site. You or your host may need the files to find out how the attacker got in.
Take screenshots of what you see, and note the date and time. This record helps your host.
Contact your host
Call or message your hosting company’s support team early. They see hacked sites often, and many have a set process.
Ask them:
- Can you scan the account for malware?
- Do you have clean backups, and from which dates?
- Can you see when and how the attacker got in?
- Do you offer a cleanup service, and what does it cost?
If your site is on Squarespace, Wix, or Shopify, the platform runs the hosting and the software. A break-in there almost always means someone got your password. Contact the platform’s support and go straight to the password steps below.
Change every password
Assume the attacker has your passwords. Change them from a computer you trust, not one that may be infected.
Start with your business email. Password resets for other accounts go there, so it has to be secure first. Then change:
- Hosting account.
- Website admin logins, for every user.
- Database password and FTP or SFTP passwords. Your host can help with these.
- Domain registrar.
- Any connected tools, such as payment, booking, or newsletter accounts.
Use a new, long, different password for each one. Turn on two-step verification where it is offered. How to keep your website logins safe explains how to set that up.
Check users and access
Open the list of users on your website. Delete any account you did not create. On WordPress, look closely at the Administrator accounts.
Do the same at your host, at your registrar, and in Google Search Console. Attackers sometimes add themselves as a user or an owner so they can get back in later.
Restore a clean backup, or clean the site
There are two ways to get a clean site. A backup is the faster and safer one.
Restore from backup. Pick a backup from before the hack began. The date you first saw the problem may be later than the date the attacker got in, so go back further if you can. Your host or your backup tool can restore it. You will lose changes made after that backup, such as new posts or orders. Write down what needs to be added again.
Clean the site. With no clean backup, the bad code has to be found and removed. For WordPress, that means replacing the core files, themes, and plugins with fresh copies from their official sources, then checking the uploads folder and the database for anything added. Security plugins such as Wordfence can scan for known malware. A partial cleanup leads to a second hack. If you are not sure of the work, pay your host or a specialist to do it.
Once the site is clean, take a fresh backup and store a copy off the server. How to back up your small business website shows how.
Fix the weakness the attacker used
A restored site has the same weakness the attacker used the first time. Fix it before you reopen.
- Update the website software, the theme, and every plugin.
- Delete plugins and themes you do not use. An inactive plugin can still be attacked.
- Remove any plugin or theme that came from an unofficial source.
- Confirm the passwords are all changed.
- Ask your host if the server software, such as PHP, is on a supported version.
Old, unpatched plugins and weak or reused passwords are the two most common ways in.
Ask Google to review the site
If Google flagged your site, the warning stays until Google checks it again.
Open Google Search Console and look for the Security issues report. It lists what Google found. After the site is clean, use the option there to request a review, and describe what you fixed. Menu labels change, so search the Search Console help pages if you cannot find it. How to set up Google Search Console for your website explains how to get access if you have never used it.
Check if customer information was exposed
Think about what the site stores. A simple brochure site with a contact form holds little. A site with customer accounts, orders, or a mailing list holds more.
If personal information may have been accessed, privacy law may require you to report the breach and tell the people affected. In Canada, the federal law is PIPEDA, and BC has its own Personal Information Protection Act. Which rules apply depends on your business. This article is general information, not legal advice. Read the guidance from the Office of the Privacy Commissioner of Canada and the Office of the Information and Privacy Commissioner for British Columbia, and talk to a lawyer.
If you take payments through Square, Stripe, or Shopify, card details are normally held by that provider and not on your site. Contact the provider and ask them to check your account for unusual activity.
Be direct with customers. If visitors were sent to a harmful page, or if their information may have been exposed, tell them what happened, what you did, and what they can do, such as changing a password. Do not guess at details you have not confirmed.
Make a repeat less likely
These habits make a second hack less likely:
- Keep software, themes, and plugins updated. Check at least once a month.
- Keep automatic backups, with copies stored away from the host.
- Use two-step verification on every account that offers it.
What is website maintenance and what does it include? describes what a regular upkeep routine covers.
If your site has been hacked and you want help working through these steps, reach us through the contact page.
Read next
How often should you update your business website?
Update facts the day they change, check the site once a month, and review every page once a year. Here is a simple schedule a small business can keep.
How to check your website for broken links
Check a small site by clicking each link by hand, then use Google Search Console or a link checker to find the rest. Fix each one with an edit or a redirect.
How to keep your business email out of the spam folder
Send from your own domain, add SPF, DKIM, and DMARC records, and email only people who expect to hear from you. Here is how to set each one up.