Website Security: The Checklist That Stops 90% of Attacks
HTTPS, security headers, CSP, patching, backups and form protection. The baseline a site needs before it gets found — plus what to do after a breach.
A small-business site rarely gets hacked the way owners imagine. Nobody guesses your password by hand or takes an interest in your price list. A bot walks millions of domains, checks a dozen known holes and moves on — and your site becomes a phishing host, a spam relay or a hiding place for somebody else’s links. What follows is a five-block checklist that closes most automated scenarios, a sample server configuration, and the order of actions if you are already inside an incident.
90%
of attacks on small sites are automated, not targeted
48h
from a disclosed vulnerability to mass scanning
3-2-1
the rule your backup routine should follow
$0
cost of the baseline security layer
How small business sites actually get compromised
"Who would bother with me?" is the most expensive assumption in this field. Bots do not care what you sell — they are looking for a plugin version, an exposed admin panel or a forgotten subdomain. The owner usually hears about the breach from Google rather than the host: the search snippet turns into a malware warning and organic traffic drops to zero inside a day.
- Known vulnerabilities in plugins and themes — the most common entry point. One to two days pass between disclosure and mass scanning, while the average site is updated twice a year.
- Weak or reused admin passwords — with no login rate limit, a bot works through the ten thousand most common passwords in a few hours.
- Forms with no validation or rate limiting — from ordinary spam to an executable uploaded under an image extension.
- Forgotten access points — a staging subdomain, an old copy in
/old, an exposed database manager, an API key that ended up in a public repository. - A compromised contractor machine — malware steals passwords saved in an FTP client, and in the logs the intrusion looks entirely legitimate.
None of the five requires skill. It is an assembly line, which is exactly why basic hygiene pays off so disproportionately: you do not need to be unbreakable, only more expensive than the next domain in the queue. If you suspect something is already inside, it usually surfaces during a technical site audit — injected scripts and rewritten meta tags show up first.
Transport: HTTPS and the headers your server should send
Certificates are free and renew themselves, so the question is not whether to enable HTTPS but whether plain HTTP is fully switched off. A surprising number of sites still answer on http:// and on the www variant with no redirect — both a hole and a duplication problem for search. The next layer is headers: the server should tell the browser explicitly what it may do with your page.
# Baseline security headers for nginx
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
add_header Permissions-Policy "camera=(), microphone=(), geolocation=()" always;
add_header Content-Security-Policy "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; frame-ancestors 'self'" always;The hardest line there is Content-Security-Policy, and it earns the most. A tuned policy makes cross-site scripting pointless: even if a foreign script reaches the page, the browser refuses to run it. It is also the header most likely to break analytics, chat widgets and embedded video if you switch it on blind on a Friday evening.
Patching, accounts and least privilege
After plugins, the second most common way in is accounts. Nothing here is technically hard; it needs organisational discipline, which is usually the missing part. The five rules below go into the support agreement on every project we run.
- 1
Patch on a schedule, not when something breaks
Monthly updates to the core, plugins and dependencies, applied to a copy of the site first. Critical security patches within 48 hours. One to two hours a month closes the largest single class of risk.
- 2
Delete everything you do not use
Every inactive plugin, old theme, staging subdomain and copy sitting in
/backupis a live vulnerability nobody updates. Delete rather than deactivate — deactivated code stays on disk and is often still reachable. - 3
Two-factor authentication for every administrator
No exceptions, contractors and yourself included. It is the only item here that still saves you after a password leaks, and passwords leak more often than people assume.
- 4
One account per person
A shared login across five people means you cannot tell who changed what, and cannot revoke access when someone leaves. Use named accounts and close them on the person’s last day.
- 5
Minimum privileges by default
A content manager does not need to install plugins; an external copywriter does not need database access. An editor-level role covers almost every real task and lowers the cost of a mistake.
Forms, uploads and everything the user sends you
Any field a visitor can type into is an entrance to your system: search, catalogue filters, the contact form, CV uploads, comments. The defensive logic is identical everywhere — trust nothing that arrives from a browser, and check it on the server.
| Vector | What the attacker does | What closes it |
|---|---|---|
| Spam bots | Flood the form with link-stuffed enquiries | Hidden honeypot field, per-IP rate limit, submission-time check |
| SQL injection | Pushes SQL through a search field or filter | Parameterised queries, never string concatenation in SQL |
| XSS | Stores a script inside a review or comment | Escaping on output plus a CSP without unsafe-inline for scripts |
| File uploads | Sends an executable disguised as an image | Type allowlist, content inspection, storage outside the web root |
| Credential stuffing | Thousands of login attempts on the admin panel | Attempt limits, 2FA, a non-default login URL |
Backups and a plan for the day it happens
A copy nobody has ever restored is not a backup, it is a hope. Half the incidents that reach us come with the phrase "backups were supposedly running": files exist, the database snapshot is four months old, the archive will not unpack. Verifying this takes an hour per quarter.
The minimum that should already be configured
- Daily database and file snapshots, retained at least 30 days
- One copy stored away from the web server — a different provider or object storage
- A quarterly restore test on staging, with the elapsed time written down
- An automatic snapshot before every core update or major change
- Hosting, domain and repository accounts registered to you, not the contractor
- The cost built into an annual maintenance budget rather than paid for in a panic
The question is not whether you have a backup. The question is how many hours the restore takes and who exactly performs it at two in the morning on a Saturday.
If the site is already behaving strangely — redirects to unfamiliar domains, unknown pages in the index, a sudden spike in server load — the response goes in this order, and the order matters.
- 1Freeze the evidence: copy the site and database exactly as they are. It is the only way to work out later how they got in.
- 2Take the site down behind a 503 holding page and cut public access to the admin panel.
- 3Rotate every credential: hosting, database, SSH and FTP, admin accounts, domain email, third-party API keys.
- 4Restore from a snapshot taken before the first suspicious change — not the latest one, which may already contain the backdoor.
- 5Update everything before lifting the holding page, or the same vector puts you back where you started within a day.
- 6Check the security issues section in Search Console, submit a review request, and inspect what is still sitting in the index.
Frequently asked questions about website security
Is enabling HTTPS enough to call a website secure?
No. HTTPS encrypts the channel between browser and server, protecting data in transit but doing nothing about vulnerabilities in the site itself. An outdated CMS, a weak administrator password or an unvalidated form fail exactly the same way over HTTPS. The certificate is the first item on the list, not the whole list.
How often should a CMS, its plugins and dependencies be updated?
Planned updates monthly, applied to a copy of the site before production. Critical security patches should go live within 24 to 48 hours, because that is precisely the window automated scanners work in. Updating twice a year leaves the site open to any bot working from a public vulnerability list.
Does a paid security plugin solve the problem?
It helps, but only as an additional layer. Such plugins handle login rate limiting, a basic firewall and file-change monitoring well, yet they will not update stale code or fix weak passwords. On a site with a dozen unpatched extensions, a security plugin mostly produces a feeling of safety rather than safety.
Is a Next.js site genuinely safer than WordPress?
On average yes, not because of the framework but because of the size of the attack surface: no public admin panel at a well-known URL, no third-party plugins with write access to the filesystem, and static pages that execute nothing on the server. Different risks appear instead — API keys, server functions, npm dependencies. The trade-off is covered in our comparison of Next.js and WordPress.
What should I do if Google has already flagged the site as dangerous?
Remove the cause first: restore from a clean snapshot, update everything and rotate all credentials. Then submit a review request in the security issues section of Search Console with a short description of what was fixed. Clearing the label usually takes a few hours to three days, though repeat submissions after a second infection are reviewed more slowly.
In short
- Nearly every small-site breach is automated: the goal is not to be unbreakable, only more expensive than the next domain in the queue.
- Four actions carry most of the value — monthly patching, 2FA for all administrators, server-side form validation, security headers with a CSP.
- A backup without a quarterly restore test is not a backup, it is an untested assumption.
- Write the incident response order before the incident. During a breach there is no time left to invent one.
Related reading
Website Maintenance: What It Includes and What It Costs a Year
A website is not a one-off purchase. Here is the yearly cost of ownership, line by line.
Next.js vs WordPress: Which One Your Business Site Needs
This is not modern versus outdated. It is two different cost models — here is both, without the sales pitch.
Technical SEO Audit: What to Check, in What Order
Technical faults cost rankings quietly. This is the order that catches the costly ones first.