ThisCalculator

Everyday

WordPress Security Tips: 12 Ways to Harden Your Site

Updated · Standard formula, shown below

The calculator for this page is switched off while it is checked. The formula is below, and the worked example in the article shows how to use it by hand.

WordPress security matters because it is the most targeted CMS on the web, and a single vulnerability can take down your site or expose visitor data. This article gives you 12 concrete, actionable steps to harden your WordPress installation, from choosing strong credentials to configuring server-level protections. Follow these practices to reduce the risk of malware, brute-force attacks, and data breaches.

Why WordPress Is a Common Target

WordPress powers over 40% of all websites, making it a high-value target for automated attacks. Hackers scan the internet for WordPress sites, then try common exploits: weak passwords, outdated plugins, and vulnerable themes. The sheer volume of sites means that even a low success rate yields many compromised sites. Understanding this threat model is the first step to taking security seriously.

Most attacks are not aimed at you personally; they are automated bots looking for any site with a weakness. They try to log in with common usernames like “admin,” test for known plugin vulnerabilities, and exploit unpatched core files. Once in, they can deface your site, inject malicious code, or use your server to send spam. The good news: most of these attacks are preventable with basic hygiene.

Use Strong Passwords and Two-Factor Authentication

The single most effective thing you can do is use a unique, long password for your WordPress admin account and every other user with editing rights. A password manager can generate and store a random 16-character password. Avoid reusing passwords from other sites. Enable two-factor authentication (2FA) for all admin users; this adds a second step—usually a code from an app or text message—that blocks most automated login attempts.

  • Use a password manager to generate and store strong passwords.
  • Enable 2FA via a plugin like WP 2FA or Google Authenticator.
  • Never use “admin” as your username; create a new admin account with a unique name and delete the old one.
  • Change your passwords immediately if you suspect a breach.

Keep WordPress Core, Themes, and Plugins Updated

Outdated software is the #1 cause of WordPress infections. Developers release updates to fix security holes, so ignoring them leaves your site exposed. Turn on automatic updates for minor core releases, and update plugins and themes as soon as a new version is available. Before updating, back up your site so you can roll back if something breaks.

It is not enough to update; you should also remove any plugin or theme you are not actively using. Inactive code still exists on your server and can be exploited. Delete it entirely. If a plugin has not been updated in over a year, consider replacing it with a maintained alternative.

Limit Login Attempts and Protect wp-admin

Brute-force attacks try thousands of password combinations per minute. A login limit plugin (e.g., Limit Login Attempts Reloaded) blocks an IP after a few failed attempts. You can also add extra protection to the wp-admin directory: require a server-level password (via .htaccess on Apache) or restrict access by IP address if you have a static IP. These measures make automated attacks impractical.

Another layer is to change the default login URL from /wp-login.php to something unique (using a plugin like WPS Hide Login). This stops bots that only try the default URL. However, it is not a substitute for strong passwords and 2FA—it just reduces noise.

Secure Your Hosting Environment

Your web host plays a huge role in security. Choose a host that offers free SSL certificates, daily backups, and malware scanning. At the server level, ensure that file permissions are set correctly: directories should be 755, files 644, and wp-config.php 600. Disable directory browsing and PHP error display in production. Use SFTP (not FTP) for file transfers, and never leave backup files in public directories.

If you are on a shared host, be aware that a compromised neighbor can affect you. Consider a managed WordPress host that isolates accounts and provides server-level firewalls. Regularly review your hosting control panel for unknown files or users.

Install a Security Plugin and Web Application Firewall

A good security plugin (e.g., Wordfence, Sucuri, iThemes Security) provides a firewall, malware scanner, and login security. A web application firewall (WAF) filters incoming traffic before it reaches your site, blocking known malicious requests. Some hosts offer a free WAF; otherwise, a plugin is the easiest route. These tools also alert you to suspicious activity.

Remember that a security plugin is not a silver bullet. It must be configured correctly and kept updated. Set up email alerts for critical events, and regularly review the logs. If you are not technical, choose a plugin with a simple setup wizard and default recommended settings.

Backup Your Site Regularly

Even with the best defenses, a breach can happen. Regular backups are your safety net. Schedule automatic backups of both files and database to a remote location (e.g., cloud storage or a different server). Test your backups by restoring them to a staging site periodically. Keep at least 30 days of backups, and store them off-site so a server compromise does not delete them.

Many hosts offer daily backups as part of their plan; if not, use a plugin like UpdraftPlus or BackupBuddy. The key is to have a documented restore process and to verify that backups are not corrupted. A backup is useless if you cannot restore it.

Common Mistakes and Misconceptions

One common mistake is thinking that security through obscurity (hiding your login URL) is enough; it is not. Another is ignoring security alerts because they seem false-positive. Always investigate. A frequent misconception is that only large sites get hacked—bots do not discriminate. Also, many people skip backups because they “have nothing valuable,” but your site’s content and reputation are valuable.

Another error is using nulled themes or plugins (pirated copies) that often contain backdoors. Always download from official sources. Finally, do not forget about your database: use a unique database prefix (e.g., wp_ is default and easy to guess) and a strong database password. Changing the prefix is not essential, but it is a simple hardening step.

Frequently Asked Questions

How often should I update WordPress? As soon as a security update is available. For minor core releases, enable auto-updates. For plugins and themes, check at least weekly and update immediately if a security patch is announced.

Is a security plugin necessary if I have a managed host? Not always, but it adds a layer of defense. Managed hosts handle server-level security, but a plugin adds login protection, file scanning, and firewall. If you are not technical, a plugin with defaults is helpful.

What should I do if my site is hacked? First, take it offline. Change all passwords (hosting, FTP, database, WordPress). Scan your computer for malware. Restore from a clean backup. Then, identify the vulnerability (often outdated plugin) and fix it. If you cannot clean it, hire a professional or use a security service.

Can I use the same password for my WordPress admin and hosting account? No. Use different passwords for each. If one is compromised, the other remains safe. A password manager makes this easy.

Does SSL protect my WordPress site from hacks? SSL encrypts data in transit, but it does not prevent server-side attacks. It is essential for protecting user data and for SEO, but it is not a substitute for other security measures.

How do I know if my site has been compromised? Signs include unexpected redirects, new admin users, strange files, or warnings from Google Safe Browsing. Use a security plugin’s scanner to check for malware, and monitor your site’s uptime and performance for anomalies.

Related

Formula used

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.