Web Development

How to Secure Your Website: 12 Essential Steps Every Business Should Follow

SA
Shoaib Ali · Nov 3, 2026 · 13 min read
Website security illustration: a padlock inside a glowing shield on a dark navy and purple background, representing 12 essential steps to protect a business website

A small business website is rarely hacked because someone picked it out. More often a script running on a machine somewhere asks thousands of sites the same questions. Is this an old version of a plugin with a known flaw? Does the login page let me try a few thousand passwords? Is there a backup file sitting in the public folder? Your site happened to answer yes.

That is why website security for small businesses is less about heroics and more about closing the easy openings, one at a time. None of the twelve steps below needs a security team, and most take an afternoon. What they share is that they remove the things automated attacks depend on, and they limit the damage when something slips through anyway.

What can happen when a website is not secured

The dramatic version is a defaced homepage. The quieter outcomes are more common. Visitors get redirected to spam or scam pages, often only when they arrive from Google, so you may never see it yourself. Hidden pages selling someone else's products appear on your domain. A checkout or form is modified to copy what customers type. Your server is used to send spam and your host suspends the account, or Google flags the site as unsafe and browsers warn people away.

Then comes the cleanup: working out how they got in, restoring a clean copy, resetting every password, and winning back the trust of customers and search engines. If you hold customer data you may also have legal duties to report it. Prevention is far cheaper, and it does not need to be frightening. It needs to be routine.

The 12 steps

1. Use HTTPS, and know what it does not do

HTTPS means the connection between a visitor's browser and your server is encrypted with TLS. Someone on the same coffee-shop wifi cannot read or alter the traffic, and the browser can confirm it is talking to the real domain. It is the minimum, and browsers warn visitors when it is missing.

It is also where many people stop, and that is the mistake. A certificate encrypts a connection. It does not update your plugins, stop someone guessing your admin password, or catch an injection flaw in a form. A site can show a padlock and still be wide open. Think of TLS as one layer, website security as the habits and controls around the whole site, and complete protection as something nobody can honestly promise.

Free certificates from Let's Encrypt are available on most hosts, and many install and renew them automatically. Redirect all HTTP traffic to HTTPS, fix any mixed content (images or scripts still loaded over http), and make sure renewal really works, because an expired certificate puts a full-page warning in front of every visitor. Once things are stable, you can add an HSTS header, which tells browsers to use HTTPS for your domain without being asked:

Strict-Transport-Security: max-age=31536000

Go carefully here. Browsers will not let visitors click through certificate errors on an HSTS site, so an expired certificate then blocks access completely. Start with a short max-age, and read the MDN documentation before adding includeSubDomains or preload.

2. Keep everything updated

Outdated software is the most common way small sites get compromised, because the flaws are public and the attacks are automated. That covers WordPress core, plugins and themes, or on a custom site the framework and its packages, plus the PHP version on the server. A PHP version that no longer gets security fixes is a risk of its own; we wrote about that in the PHP 8.1 end-of-life post.

WordPress can install minor security releases of core by itself, and since version 5.5 you can switch on automatic updates for individual plugins and themes. Use that for plugins you trust, and take a backup before major updates. Delete what you do not use instead of just deactivating it, and be wary of plugins their authors have not touched in a long time. On Laravel and other Composer projects, composer audit checks installed packages against known advisories, and npm audit does the same for JavaScript.

3. Strong passwords and multi-factor authentication

The advice has changed from what many of us learned. OWASP's authentication guidance, which follows NIST, puts length ahead of tricks: allow long passphrases, do not force symbol-and-number rules, do not force regular changes unless a leak is suspected, and block passwords that have already appeared in breaches. In practice that means a password manager, a unique password for every account, and a long random or passphrase-style one for anything that matters.

Passwords alone are still the weak point, so add a second factor wherever it is offered. Start with the accounts that can take everything else down with them: your hosting control panel, your domain registrar, your email (password resets arrive there), and the WordPress admin. An authenticator app or hardware key beats SMS, and the official WordPress documentation says SMS is not a secure channel. Its guide to two-step authentication lists plugins that add it, including Two-Factor.

4. Protect the admin login

Login pages are attacked constantly because they are easy to find: /wp-login.php on WordPress, /admin on plenty of custom sites. Limit failed attempts, ideally per account rather than per IP address, since attackers rotate addresses. Return the same generic message whether the username or the password was wrong, so the form does not reveal which accounts exist. Avoid obvious usernames like "admin", and give admin rights only to people who need them.

Moving the login page to a different URL reduces noise in your logs but is not protection. On custom Laravel code, throttling is a one-line change:

Route::post('/login', [LoginController::class, 'store'])
    ->middleware('throttle:5,1');

5. Choose secure website hosting

Your host is part of your security whether you think about it or not. Secure website hosting means accounts isolated from each other, a current PHP version, SFTP or SSH instead of plain FTP, two-factor on the control panel, server-level protection such as ModSecurity, malware scanning, and backups. It also means a support team that answers when something goes wrong at an awkward hour.

Price is a weak signal in both directions. Some inexpensive hosts do the basics well and some expensive ones do not. Ask what is included, where backups are stored, and what happens if your site is compromised. Vague answers are information too.

6. Automate backups, and test the restore

A backup only counts if it works. The WordPress documentation is clear that you need both the database and the files to restore a typical site. Weekly can be enough for a site that rarely changes; busy ones need daily. Keep several recent copies, not just the latest, so you have one from before an unnoticed infection, and keep at least one away from the server itself. A common rule of thumb is three copies, on two kinds of storage, with one off-site.

Restore one at least once, onto a staging area or a spare subdomain, and note how long it takes. People often discover during an emergency that the backup is empty or missing the database. Also make sure the backups are not publicly reachable: a backup.zip left in the web root is a gift to anyone who guesses the name.

7. Add a Web Application Firewall

A web application firewall (WAF) sits in front of your site and filters requests, blocking patterns that look like SQL injection, XSS, bad bots and brute-force attempts. It can be a cloud service such as Cloudflare, a rule set on your host's server (the OWASP ModSecurity Core Rule Set is a common one), or a WordPress security plugin.

It is a valuable extra layer, partly because it can block attacks on a known plugin flaw before you have patched it. It is not a replacement for patching. OWASP notes that a WAF gives general baseline protection and may need tuning to your application, and a badly tuned one can block legitimate visitors. Use one, but do not let it make you relaxed about updates.

8. Protect your forms and APIs

Every form, search box and API endpoint accepts input from strangers. Validate it on the server, not only in the browser, because anyone can bypass browser checks. Use CSRF tokens on anything that changes data (Laravel's @csrf and WordPress nonces exist for this), rate-limit what can be abused, and add spam protection such as a honeypot field where needed.

Uploads need extra care: check type and size, rename the file, and make sure uploaded files can never be executed as code. On Apache or LiteSpeed, one common WordPress approach is a small .htaccess file in wp-content/uploads that denies PHP execution there; test the site afterwards, because setups differ.

For APIs, require authentication and check authorisation on every request: a logged-in user should reach their own records, not anyone's by changing an ID in the URL. Broken access control of this kind sits at the top of the current OWASP Top 10. Keep API keys out of public code, and do not show visitors detailed errors or stack traces: turn WP_DEBUG off in production on WordPress and APP_DEBUG off on Laravel.

9. Understand SQL injection and cross-site scripting

These two attacks are decades old and still turn up in modern code, so they are worth understanding in plain terms.

SQL injection happens when user input is pasted into a database query as if it were part of the query. If a login or search field is built by joining strings, an attacker can type something that changes what the query does, such as exposing other users' data. The fix is to keep data and query structure separate with prepared statements:

// Risky: input becomes part of the SQL
$rows = $pdo->query("SELECT * FROM users WHERE email = '$email'");

// Safer: input is passed separately
$stmt = $pdo->prepare('SELECT * FROM users WHERE email = :email');
$stmt->execute(['email' => $email]);

Query builders and ORMs such as Eloquent do this for you when used normally, and in WordPress you use $wpdb->prepare(). OWASP's SQL injection prevention cheat sheet lists parameterised queries as the main defence and marks hand-written escaping as strongly discouraged.

Cross-site scripting (XSS) is the browser-side cousin. Your site outputs something a visitor typed (a comment, a profile name, a search term) without making it safe, and the browser runs it as script, as if it came from your site. The defence is to encode output for the place it appears. Blade's {{ $value }} in Laravel does this by default, while {!! $value !!} does not, so keep the second form for content you have sanitised. In plain PHP use htmlspecialchars($value, ENT_QUOTES, 'UTF-8'), and WordPress provides esc_html(), esc_attr() and esc_url(). A Content Security Policy header is a useful extra layer, though OWASP presents it as defence in depth, not the main fix. See the XSS prevention cheat sheet for detail.

10. Set file permissions and limit access

The WordPress hardening guide recommends 755 for directories and 644 for files, with wp-config.php at 400 or 440 where your host allows it. Permissions of 777 (writable by everyone) are never the right answer to a "permission denied" error, whatever a forum post says. From the site root, the usual commands are:

find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;

On WordPress you can also stop the dashboard from editing plugin and theme files, which removes a favourite tool of anyone who reaches an admin account:

define( 'DISALLOW_FILE_EDIT', true );

Beyond permissions, think least privilege. Give the database user only the rights the site needs, with a separate user per site. Remove old FTP accounts and staff logins when people leave. Delete test files, phpinfo.php pages, old copies of the site and forgotten development folders, and turn off directory listing. Each is small, and each has been the way in somewhere.

11. Monitor activity and logs

Most compromises are not noticed on day one, and logs and alerts shorten that gap. Know where your logs are: in cPanel, the raw access logs and the error log show requests and failures. Look for repeated failed logins, requests for files that should not exist, and sudden spikes from one address. OWASP now lists security logging and alerting failures as a top-ten category, which says a lot about how often the real problem is that nobody noticed.

On WordPress, an activity-log plugin records new admin users, plugin installs and settings changes, and a file-change alert flags modified core files. Add an uptime monitor, and check the Security issues report in Google Search Console, where Google tells you if it has found malware or hacked content on your domain. Send alerts somewhere people actually read.

12. Decide now what you will do if you are hacked

A plan makes the first hour far calmer. If you suspect a compromise, the order usually goes like this:

  1. Contain it. Take the site offline or into maintenance mode if it is serving malware or collecting data, and tell your host, who can often see things you cannot.
  2. Keep evidence. Copy the logs and a snapshot of the affected files before cleaning, so you can work out how they got in.
  3. Change every credential from a device you trust: hosting panel, FTP/SSH, database, admin users, email, API keys. On WordPress, changing the security keys in wp-config.php logs everyone out.
  4. Remove unknown admin users, then look for backdoors, odd scheduled tasks and modified .htaccess files.
  5. Restore from a backup taken before the compromise, and update everything before going live again, or the same hole will let them back in.
  6. Find and fix the cause: the outdated plugin, the reused password, the compromised account.
  7. If Google flagged the site, request a review in Search Console once it is clean. If customer data may have been exposed, find out what you must report; rules differ by country, and under the GDPR, for example, the deadline can be as short as 72 hours.

A website security checklist

Use this as a quick audit. Anything you cannot tick is your next job:

  • HTTPS works on every page, HTTP redirects to it, and certificate renewal is automatic.
  • Core, plugins, themes, packages and PHP are current; unused ones are removed.
  • Every important account has a unique password and multi-factor authentication.
  • Login attempts are limited and there is no "admin" user.
  • Your hosting includes isolated accounts, SFTP or SSH, server-level protection and backups.
  • Backups cover files and database, are stored off the server, and have been test-restored.
  • A WAF is active and you know what it blocks.
  • Forms validate on the server, use CSRF protection and are rate-limited; uploads are restricted.
  • Queries are parameterised and output is escaped.
  • Permissions are sane, file editing is off, and old files, backups and test pages are gone.
  • Logs and security alerts are reviewed on a schedule.
  • Someone knows the incident steps and where the credentials and backups are.

Frequently asked questions

Is an SSL certificate enough to secure my website?

No. It encrypts traffic between the visitor and your server and confirms your domain's identity, which matters, but it does nothing about outdated plugins, weak passwords, vulnerable code or malware on the server.

Do small websites really get attacked?

Yes, because most attacks are automated and look for known weaknesses on any site, whatever its size. A small site with an outdated plugin is as easy a target as a large one.

Do I need a security plugin for WordPress?

It can help with a firewall, malware scanning, login protection and activity logs, but it does not replace updates, strong credentials and backups. Choose one well-maintained plugin instead of several that overlap, and check what your host already provides.

How often should I update my website?

Apply security updates as soon as you reasonably can, and review plugins, themes and packages at least monthly. For anything business-critical, update a staging copy first and take a backup.

How do I know if my website has been hacked?

Typical signs are unexpected redirects, unknown admin users, files you did not upload, spam pages in Google results for your domain, browser or Google security warnings, and a notice from your host. Check your admin user list and recently modified files, and look at Search Console.

Where to start

You will not do all twelve in one sitting, and you do not have to. If you only do three things this week, make them these: turn on multi-factor authentication for hosting, email and admin accounts; bring updates current and take a backup you have actually restored; and check that HTTPS, login protection and file permissions are what you think they are. The rest can follow in order. Website cybersecurity is mostly maintenance, and the sites that do the basics steadily are rarely the ones caught out.

If you would rather have help, Dydaltix builds and maintains websites and can review an existing one against a list like this. You can read about our web development and hosting and support services, or get in touch with the details of your site and we will take a look.

Share:
SA
Shoaib Ali
Founder, Dydaltix

Builds Laravel and WordPress websites and handles hosting and technical support at Dydaltix.

Related articles

Get more like this

Occasional notes on websites, hosting and PHP. No spam.