
In this article
Many hacked websites were not broken into with clever code. Someone simply logged in. A reused password from another breach, a guessed "admin" account or a stolen session is often all it takes. Securing the login page is one of the cheapest and most effective things you can do.
This guide applies to any platform, whether your site runs on WordPress, Shopify, Wix, Joomla, Magento or custom code, and to every login that touches your site: the admin panel, hosting, FTP/SFTP, the database, your domain registrar and email.
How attackers get in through logins
- Brute force: bots try thousands of common passwords against your login page.
- Credential stuffing: passwords leaked from other sites are tried on yours. Reuse is what makes this work.
- Phishing: a fake email or page tricks you or your staff into typing the password.
- Old accounts: a former developer, a test user or a forgotten plugin account still has access.
Step 1: use strong, unique passwords
Use a long passphrase or a random password of at least 14 characters, different for every account. A password manager creates and remembers them, so you only need to remember one master password. Never share passwords over chat or email. Instead, give each person their own account.
Step 2: turn on two-factor login
Two-factor authentication (2FA) asks for a second proof, such as a code from an authenticator app, after the password. Even if the password leaks, the attacker is stopped. Switch it on for:
- Your site's admin accounts.
- Your hosting control panel and your domain registrar. Losing the domain is worse than losing the site, and an expired or hijacked domain is hard to recover.
- Your email account, because password resets go there.
- Cloud storage that holds your backups.
Authenticator apps and hardware keys are safer than text-message codes. Store the recovery codes somewhere safe.
Step 3: remove easy targets
- Rename default usernames. Avoid "admin", "administrator" or your domain name as the admin user.
- Delete unused accounts from former staff, freelancers and tests.
- Give the least access needed. An editor does not need administrator rights.
- Retire shared logins so you can tell who did what.
Step 4: limit failed attempts
Lock or slow down logins after several wrong tries, and add a CAPTCHA if bots keep hammering the form. Many platforms and security plugins offer this. If you control the server, you can also restrict the admin area to known IP addresses or put it behind an extra password layer.
Step 5: protect the connection
- Serve the login page over HTTPS only, and keep the SSL certificate valid.
- Use SFTP, not plain FTP, which sends passwords unencrypted.
- Add sensible security headers, and set cookies with the
SecureandHttpOnlyflags.
Step 6: watch for trouble
Review your user list regularly for accounts you do not recognise. Turn on login alerts if your platform supports them, and look for sudden floods of failed logins. If you suspect a stolen password, change it, sign everyone out and check whether the site was hacked. A malware check shows whether anything was planted.
Common questions
Is a long password better than a complex one?
Length matters most. A long passphrase of several unrelated words is harder to crack than a short one full of symbols.
Is SMS two-factor login good enough?
It is far better than nothing, but an authenticator app or hardware key is safer because SIM-swapping can steal text messages.
Should I change passwords regularly?
Change them when you suspect a leak, when someone leaves the team or when a service reports a breach. Frequent forced changes without a reason push people toward weak patterns.
What if I lose my 2FA device?
Use the recovery codes you saved when you set it up. Keep them offline, away from the device itself.
Free tools for this problem
- Website malware scanner: Spam links, malicious scripts, cloaking, bad redirects and exposed backups.
- Security headers checker: Grade HSTS, CSP, clickjacking and referrer headers, with fixes to copy.
- SSL certificate checker: Expiry date, issuer, chain, TLS versions, HTTPS redirect and HSTS.
