Your business website is one of your most public-facing assets — and one of the most attacked. Every website on the internet is subjected to automated scanning and probing by bots, script kiddies, and professional criminal gangs looking for vulnerabilities to exploit. The consequences of a successful attack range from embarrassing defacements and SEO spam injection to devastating data breaches, ransomware infections, and regulatory fines from the ICO.
For UK businesses, website security is not optional. Under UK GDPR, if your website collects personal data — contact forms, customer accounts, payment details — you have a legal obligation to implement appropriate technical and organisational measures to protect that data. The NCSC (National Cyber Security Centre) has published extensive guidance on website security, and Cyber Essentials certification requires that externally facing services, including websites, are properly secured.
This guide covers the essential steps every UK business should take to secure its website against hackers, from basic hygiene measures that stop automated attacks to more advanced protections against targeted threats.
The Most Common Website Attacks
Understanding the threats helps you prioritise your defences. The vast majority of website attacks exploit a small number of well-known vulnerability classes.
SQL Injection
SQL injection attacks exploit websites that construct database queries using unsanitised user input. An attacker enters specially crafted input — often through a search box, login form, or URL parameter — that causes the database to execute unintended commands. This can allow the attacker to read the entire database, modify or delete data, bypass authentication, or even execute operating system commands on the server.
SQL injection remains one of the most dangerous vulnerabilities precisely because it is so well understood yet continues to appear in production websites. The Open Web Application Security Project (OWASP) consistently ranks injection attacks in its Top 10 list, and for good reason. A single successful SQL injection attack against a UK business can expose thousands of customer records, triggering mandatory breach notification under UK GDPR. The ICO has issued significant fines to organisations that failed to protect against this well-known vulnerability class, on the grounds that prevention measures are widely available and well documented.
For UK businesses, the risk extends beyond data theft. Attackers who gain database access through SQL injection frequently escalate their attack, using the compromised server as a launching point for further network penetration. In cases involving e-commerce databases, attackers may modify pricing data, redirect payment flows, or insert backdoor accounts that persist even after the original vulnerability is patched. Parameterised queries and prepared statements eliminate SQL injection entirely, yet many legacy applications and hastily built websites continue to concatenate user input directly into SQL strings.
Cross-Site Scripting (XSS)
XSS attacks inject malicious JavaScript into web pages that are then served to other users. When a victim's browser executes the injected script, the attacker can steal session cookies (allowing them to hijack user accounts), redirect users to phishing pages, modify the page content, or exfiltrate sensitive data from the user's session.
Cross-site scripting vulnerabilities are particularly insidious because they exploit the trust relationship between a user and a legitimate website. When a user visits your business website, their browser trusts that the code served by your domain is safe to execute. An XSS vulnerability breaks this trust by allowing an attacker to inject their own code into your pages. There are three main variants: stored XSS, where the malicious script is permanently saved on the target server such as in a forum post or comment; reflected XSS, where the script is embedded in a URL that the victim clicks; and DOM-based XSS, where the vulnerability exists in client-side JavaScript rather than server-side code.
For UK businesses, XSS attacks pose a particular risk to customer-facing portals, support ticket systems, and any feature that displays user-generated content. A successful stored XSS attack on a customer portal could silently harvest login credentials from every user who visits the affected page, potentially running undetected for weeks or even months before discovery. Implementing a robust Content Security Policy header is one of the most effective defences against XSS, as it restricts which scripts the browser is permitted to execute, effectively neutralising injected code even if the underlying vulnerability has not yet been patched.
Brute Force Attacks
Brute force attacks attempt to gain access to admin panels, CMS login pages, and user accounts by systematically trying large numbers of password combinations. Automated tools can attempt thousands of passwords per minute, and many websites still use weak or default credentials that make this attack trivially successful.
Modern brute force attacks have evolved well beyond simple password guessing. Credential stuffing attacks use vast databases of username and password combinations leaked from previous data breaches to attempt logins across multiple websites. Because many people reuse passwords across services, these attacks are alarmingly effective. A UK business whose website admin panel shares credentials with a compromised personal email account is at immediate risk. Password spraying is another variant, where attackers try a small number of commonly used passwords against a large number of accounts, staying below lockout thresholds whilst still achieving a high success rate across a large target base.
The consequences of a successful brute force attack on a website admin panel are severe. Once inside, an attacker can modify website content to distribute malware, inject SEO spam that damages your search rankings, access customer data stored in the CMS, install persistent backdoors that survive password changes, and use your web server to launch attacks against other targets. Rate limiting, account lockout policies, CAPTCHA challenges, and multi-factor authentication together form a layered defence that makes brute force attacks impractical even for well-resourced attackers.
Plugin and Theme Vulnerabilities
For websites built on CMS platforms like WordPress — which powers approximately 43 per cent of all websites — the most common attack vector is through vulnerable plugins and themes. Many WordPress sites run dozens of plugins, each of which represents a potential entry point for attackers if not kept up to date.
The plugin ecosystem represents a significant supply chain risk for any website built on a CMS platform. When you install a third-party plugin, you are trusting that its developer follows secure coding practices, promptly patches vulnerabilities when discovered, and will continue maintaining the plugin for the foreseeable future. In practice, many WordPress plugins are developed by small teams or individuals who may abandon the project, leaving known vulnerabilities permanently unpatched. The WordPress plugin repository contains thousands of plugins that have not been updated in over two years, yet remain installed on millions of websites worldwide.
For UK businesses, this supply chain risk demands a disciplined approach to plugin management. Conduct a quarterly audit of all installed plugins and themes. Check whether each one is still actively maintained, has known vulnerabilities listed in the WPScan Vulnerability Database, and is actually necessary for your website to function. Remove anything that is not essential. Where possible, choose plugins from established developers with a track record of prompt security updates and transparent vulnerability disclosure. Consider using a commercial WordPress security service that monitors your plugin inventory and alerts you immediately when vulnerabilities are published affecting your installed components.
Essential Website Security Measures
1. Keep Everything Updated
This single action prevents more attacks than any other. Ensure your CMS (WordPress, Joomla, Drupal, or whatever platform you use) is always running the latest version. Update all plugins, themes, and extensions as soon as security patches are released. Keep the server operating system and web server software (Apache, Nginx, IIS) patched and up to date. Remove any plugins, themes, or components that you are not actively using — unused code is still attackable code.
Automate updates wherever possible. WordPress supports automatic background updates for minor releases and security patches. For plugins, consider enabling automatic updates for all plugins or, at minimum, for those with known security histories.
2. Use HTTPS Everywhere
Every page on your website — not just checkout and login pages — should be served over HTTPS. An SSL/TLS certificate encrypts the connection between the user's browser and your server, preventing attackers from intercepting data in transit. Since 2018, Google Chrome has marked all HTTP sites as "Not Secure," and search engines penalise non-HTTPS sites in rankings.
SSL certificates are available free of charge from Let's Encrypt, and most hosting providers include them at no additional cost. There is genuinely no excuse for any business website to still be running on HTTP in 2026.
Beyond simply installing an SSL certificate, UK businesses should ensure their TLS configuration follows current best practices. Disable older, insecure protocol versions — TLS 1.0 and TLS 1.1 should be turned off entirely, as they contain known vulnerabilities that have been actively exploited. Configure your server to support only TLS 1.2 and TLS 1.3, with strong cipher suites that provide forward secrecy. The Qualys SSL Labs Server Test is a free tool that grades your SSL configuration and identifies specific weaknesses. Aim for an A+ rating, which indicates that your TLS configuration meets or exceeds current industry standards.
Proper certificate management is equally important. Set up automated certificate renewal to prevent expiry — an expired SSL certificate causes browsers to display a prominent security warning that will drive visitors away from your site immediately. If you use Let's Encrypt, tools like Certbot handle automatic renewal without manual intervention. For businesses using multiple subdomains, a wildcard certificate simplifies management considerably. Additionally, implement HTTP Strict Transport Security (HSTS) to instruct browsers to always connect over HTTPS, even if a user types the HTTP address. HSTS preloading goes further by embedding this instruction in the browser itself, providing protection from the very first visit before any HTTP connection has been established.
3. Implement Strong Authentication
Secure your website's admin panel and any user-facing login areas with strong authentication measures. Use strong, unique passwords for all admin accounts — at least 14 characters with a mix of upper and lower case, numbers, and special characters. Enable multi-factor authentication on the admin panel. Limit login attempts to prevent brute force attacks — lock accounts or introduce increasing delays after three to five failed attempts. Change the default admin URL if your CMS allows it (for example, changing /wp-admin to a custom URL on WordPress). Never use "admin" as a username.
The NCSC recommends using three random words as a password creation strategy for user-facing accounts. For admin and system accounts, they recommend long, randomly generated passwords stored in a password manager. The NCSC also strongly advises against password complexity rules that frustrate users (such as requiring special characters) and instead recommends minimum length requirements of at least 12 characters. For any website handling sensitive data, MFA should be mandatory for all accounts, not just administrators.
4. Deploy a Web Application Firewall (WAF)
A Web Application Firewall sits between your website and the internet, inspecting incoming traffic and blocking malicious requests before they reach your server. A good WAF blocks SQL injection attempts, XSS attacks, malicious file uploads, known vulnerability exploits, and automated bot attacks.
Cloud-based WAF services like Cloudflare, Sucuri, and AWS WAF are the most practical option for SMEs. They require no server-side installation — you simply route your traffic through the WAF by changing your DNS settings. Cloudflare's free plan provides basic WAF protection, while their Pro plan (around £16 per month) adds more comprehensive rulesets.
5. Secure Your Hosting Environment
Your hosting environment is the foundation of your website's security. Use a reputable hosting provider that offers server-level firewalls and intrusion detection, regular server patching and maintenance, DDoS protection, automated backup services, and PHP version management (ensure you are running a supported PHP version if using WordPress or similar CMS).
If you manage your own server, ensure that unnecessary services are disabled, file permissions are correctly set (directories at 755, files at 644 for most CMS platforms), directory listing is disabled, and error messages do not expose sensitive information like file paths or database structures.
Choosing the right hosting provider is a decision that directly affects your website's resilience to attack. In the UK, hosting providers that operate from UK data centres are preferable for businesses that handle personal data, as this simplifies UK GDPR compliance by keeping data within a known legal jurisdiction. Look for providers that hold ISO 27001 certification or Cyber Essentials Plus, as these certifications demonstrate a genuine commitment to information security management. Shared hosting environments, whilst affordable, carry inherent risks because a vulnerability in another website on the same server can potentially be exploited to compromise yours. For business-critical websites, a virtual private server or dedicated hosting provides stronger isolation between tenants and greater control over your security configuration.
Server hardening is a critical but often overlooked aspect of website security. Beyond the basics of disabling unnecessary services and setting correct file permissions, consider implementing a host-based intrusion detection system such as OSSEC, which monitors file changes, log entries, and system calls for indicators of compromise. Configure your web server to hide version information from HTTP response headers, as this information helps attackers identify specific exploits for your software versions. Regularly review and rotate SSH keys, disable root login over SSH, and use key-based authentication rather than passwords for server access. For PHP-based websites, disable dangerous PHP functions that are not needed by your application, such as exec(), system(), and passthru(), which can be abused by attackers who achieve code execution through another vulnerability.
Website Security Best Practices
- All software patched and up to date
- HTTPS on every page with a valid certificate
- Web Application Firewall protecting all traffic
- MFA on all admin accounts
- Regular automated backups with tested restoration
- Security headers configured (CSP, HSTS, X-Frame-Options)
- Regular vulnerability scanning and penetration testing
Common Security Failures
- CMS and plugins months or years out of date
- No WAF — direct exposure to all attacks
- Admin panel accessible with just a password
- Default admin usernames and weak passwords
- No backups or untested backup restoration
- No security headers — vulnerable to clickjacking and XSS
- Unused plugins and themes still installed
6. Configure Security Headers
HTTP security headers instruct the visitor's browser to behave in ways that protect against common attacks. They cost nothing to implement and significantly improve your website's security posture.
| Header | Purpose | Example Value |
|---|---|---|
| Content-Security-Policy (CSP) | Controls which resources the browser can load — prevents XSS | default-src 'self'; script-src 'self' |
| Strict-Transport-Security (HSTS) | Forces HTTPS connections — prevents downgrade attacks | max-age=31536000; includeSubDomains |
| X-Frame-Options | Prevents your site being embedded in iframes — prevents clickjacking | SAMEORIGIN |
| X-Content-Type-Options | Prevents MIME type sniffing | nosniff |
| Referrer-Policy | Controls referrer information sent with requests | strict-origin-when-cross-origin |
| Permissions-Policy | Controls browser features (camera, microphone, location) | camera=(), microphone=(), geolocation=() |
7. Regular Backups with Tested Restoration
Even with the best security measures, breaches can occur. Regular backups ensure you can recover your website quickly. Back up your entire website — files, database, and configuration — at least daily. Store backups off-site, separate from your web server. Retain multiple backup generations (see our guide on backup retention policies). Test your restoration process regularly — a backup you cannot restore from is worthless.
8. Monitor and Scan
Implement ongoing security monitoring to detect attacks and compromises early. Use uptime monitoring to detect if your site goes down unexpectedly. Run regular vulnerability scans using tools like WPScan (for WordPress), Qualys SSL Labs (for SSL configuration), or commercial scanning services. Monitor file integrity — changes to core files that you did not make may indicate a compromise. Review server logs for suspicious patterns — repeated login failures, unusual traffic spikes, or access to admin URLs from unfamiliar locations.
Website Security for E-Commerce
If your website processes payments, additional requirements apply. PCI DSS (Payment Card Industry Data Security Standard) compliance is mandatory for any business that handles card payments. For most UK SMEs, the simplest approach is to use a hosted payment provider like Stripe, PayPal, or Braintree, which handles the card data on their platform and reduces your PCI compliance scope significantly.
Never store credit card numbers on your own server unless you have achieved full PCI DSS compliance — the consequences of a payment data breach include mandatory forensic investigation costs (typically £15,000 to £50,000), fines from the card schemes, liability for fraudulent transactions, and reputational damage that can destroy a small business.
Beyond PCI DSS compliance, e-commerce websites face additional security challenges that general business websites do not. Shopping cart manipulation, where attackers modify prices or quantities in transit between the browser and server, is a common attack against poorly designed e-commerce platforms. Always validate prices and calculations server-side — never trust values submitted by the client. Account enumeration attacks target the registration and login processes to identify valid customer accounts, which can then be targeted with credential stuffing or phishing campaigns. Implement consistent error messages that do not reveal whether a specific username or email address exists in your system, as even this small detail gives attackers valuable intelligence.
Product review and comment systems on e-commerce sites are frequent targets for spam injection and stored XSS attacks. Implement robust input sanitisation and consider requiring account verification before allowing reviews. Order confirmation and shipping notification emails are another attack surface that is often overlooked — ensure your email sending infrastructure uses SPF, DKIM, and DMARC to prevent attackers from spoofing your domain to send convincing phishing emails to your customers. For UK e-commerce businesses, the Consumer Rights Act 2015 and the Electronic Commerce Regulations 2002 impose additional requirements around data handling and transparency that intersect directly with your security obligations, making comprehensive website security not merely a technical concern but a legal necessity.
Session management is another critical area for e-commerce security. User sessions should be protected with secure, HttpOnly, and SameSite cookie attributes to prevent session hijacking. Implement session timeouts appropriate to the sensitivity of the transaction — a customer browsing products may have a longer session, but any session involving payment or account management should time out after a shorter period of inactivity. Regenerate session identifiers after login and after privilege elevation to prevent session fixation attacks. For UK businesses processing high volumes of transactions, consider implementing fraud detection mechanisms that flag suspicious patterns such as multiple failed payment attempts, rapid changes to delivery addresses, or orders from IP addresses associated with known proxy services.
Need a Website Security Assessment?
Cloudswitched provides website security audits, vulnerability assessments, and ongoing website management for UK businesses. We identify and fix vulnerabilities before attackers exploit them, keeping your website and your customers' data safe.
GET IN TOUCH