Most website compromises are not personal. Automated tools scan the web around the clock for known weaknesses: reused passwords, unpatched software, exposed admin pages, forgotten test installs. Fixing those weaknesses before a scanner finds them is most of website security.
This checklist covers the protections that apply to any business website, whatever it runs on, and the accounts around it. If your site runs on WordPress, our WordPress security hardening guide adds the platform-specific steps, configuration and code.
What you are defending against
- Credential attacks: automated password guessing, and passwords leaked from other services tried against your logins.
- Exploits of known vulnerabilities: attacks on software that has a published fix you have not applied.
- Injection: SQL injection and cross-site scripting (XSS), where input is treated as code.
- Malware: malicious files planted on the server, often to send spam or redirect your visitors.
- Denial of service: traffic floods meant to take the site offline.
Size is no protection. Small sites are easy targets, and large sites are valuable ones.
The checklist
1. HTTPS everywhere
HTTPS encrypts traffic between visitors and your site. Free certificates from Let’s Encrypt, usually provisioned automatically by your host, are standard.
- Redirect every
http://request tohttps://. - Turn on HSTS (see security headers below) once HTTPS works everywhere.
- Check a few pages for mixed-content warnings, where images or scripts still load over plain HTTP.
2. Long, unique passwords
Password reuse is one of the most common ways accounts are taken over: a password leaked from an unrelated service gets tried against your logins.
- Use a password manager, so every account has its own password.
- Prefer length over complexity rules. A long passphrase beats a short string of symbols.
- Use passkeys where a service supports them.
3. Two-factor authentication
A password alone is not enough for any account that can change your site.
- Best: hardware security keys or passkeys.
- Good: an authenticator app.
- Better than nothing: SMS codes, which are vulnerable to SIM-swap attacks.
Turn it on for the site’s admin accounts, the hosting account, the domain registrar, your DNS or CDN provider, your code repository, and the email accounts that can reset all of the above. If the registrar account sits in someone else’s name, fix that first; our domain ownership guide explains why.
4. Updates
Many successful attacks use known vulnerabilities that already have a published fix, and attackers move quickly once a fix is public, because the fix tells them where to look.
Keep these current:
- The CMS core.
- Plugins, extensions and themes.
- Code dependencies.
- Server software and language runtimes (PHP, Node.js).
Check for updates at least weekly, and apply security releases as soon as they ship. Automate what you safely can.
5. Hosting with security built in
Your host is part of your defense. Look for isolation between customer accounts, a web application firewall, malware scanning, DDoS protection, automatic backups and prompt patching of the server itself. Our guide to web hosting covers the types.
6. Backups you have tested
Backups are the recovery option when everything else fails.
- Back up files and database at least daily, or as often as content changes.
- Store copies off the server, ideally with a different provider.
- Keep several versions, so you can go back to before a compromise you discovered late.
- Test a restore regularly. An untested backup is a hope, not a plan.
7. Limit login attempts
Rate-limit logins and lock accounts out temporarily after a handful of failures, with longer lockouts for repeat offenders. Alert an administrator when lockouts spike.
8. Change the defaults
- Do not use “admin” or the site’s name as a username.
- Remove default and sample content, test pages and demo accounts.
- Moving the login URL cuts automated noise in your logs, but it is not a defense on its own.
9. Least privilege
- Give each person the lowest role that lets them do their job, and remove accounts when people leave.
- Set file permissions so the web server can read what it needs and write only where it must. A common baseline is 755 for directories and 644 for files, with configuration files as restrictive as your host allows.
- Give the site’s database user only the permissions it needs, keep the database unreachable from the public internet, and encrypt connections to it.
10. Security headers
Security headers tell browsers how to protect your visitors. A sensible modern set:
Strict-Transport-Security: max-age=31536000; includeSubDomains
Content-Security-Policy: [a policy written for your site, including frame-ancestors]
X-Content-Type-Options: nosniff
Referrer-Policy: strict-origin-when-cross-origin
Permissions-Policy: camera=(), microphone=(), geolocation=()
X-Frame-Options: SAMEORIGIN
The Content Security Policy does the most work and takes the most care, because a policy that is too strict breaks the site and one that is too loose protects nothing. X-Frame-Options covers older browsers; frame-ancestors in the CSP replaces it in current ones. Drop X-XSS-Protection if you still send it: current browsers ignore it.
Mozilla’s HTTP Observatory checks your headers for free.
11. Remove what you do not use
Every component is attack surface, whether or not it is switched on.
- Delete inactive plugins, extensions and themes.
- Remove old test and staging installs from public servers.
- Close accounts nobody uses.
12. Monitoring
You want to know about a problem before your customers do. Monitor:
- Uptime, from an external service.
- File changes on the server.
- Failed and successful logins, and new admin accounts.
- Malware scan results.
- Google Search Console’s Security Issues report, which tells you if Google has detected a hack.
13. A web application firewall
A WAF filters malicious requests before they reach your site. Options include CDN-level firewalls such as Cloudflare (which has a free tier), security services such as Sucuri, and firewalls provided by your host. A WAF reduces exposure; it does not replace updates.
14. Regular security reviews
Review the site at least once a year and after any major change: vulnerability scanning, a configuration review and, for sites that handle payments or sensitive data, a penetration test by someone independent.
Fewer moving parts, fewer risks
Architecture changes the checklist. A static site has no database, admin login or server-side code on its public server, so items such as login limits and database hardening no longer apply to the live site. The accounts behind it (hosting, code repository, DNS and registrar) still need every protection above.
If you are hacked
- Act quickly and calmly. Every hour an attacker keeps access, the damage can grow.
- Contain it. Put the site into maintenance mode or take it offline.
- Preserve evidence. Copy server and access logs before you clean anything.
- Change every password and revoke sessions for the site, hosting, database, FTP or SFTP, and CDN, from a device you trust. Rotate API keys.
- Find the entry point. Check the logs and recently modified files.
- Restore from a clean backup taken before the compromise, or clean the site and reinstall software from fresh sources.
- Close the hole. Update everything and fix whatever let the attacker in.
- Request a review in Google Search Console if your site was flagged.
- Check your obligations. If personal data may have been exposed, you may have legal duties to notify people. Talk to a lawyer.
- Watch closely for the following weeks. Attackers often leave a way back in.
Have this ready before you need it
- Who has access to the hosting account, registrar, DNS and code repository, with every credential stored in a password manager rather than a document.
- Where the backups are, and how to restore them.
- Who to call for help, with their details somewhere you can reach if the site and its email are down.
Monthly security check
- Run a malware scan.
- Apply outstanding updates.
- Review user accounts and roles.
- Confirm the latest backup completed, and test a restore each quarter.
- Review security and login logs.
- Check that two-factor authentication is still on for every admin.
- Confirm the certificate is valid and renewing automatically.
The bottom line
Most of this checklist costs time, not money, and cleaning up after a compromise almost always costs more than preventing one. If you do only three things this week, turn on two-factor authentication everywhere, apply every outstanding update, and test a restore from your backups.