How to Secure a WordPress Website
WordPress powers 40% of websites, making it a prime target. Learn essential security measures to protect your site.
Essential Security Measures
These four measures form the foundation of WordPress security. Implement all of them to protect against 97% of common attacks.
Keep Everything Updated
Outdated plugins, themes, and WordPress core are the #1 cause of WordPress hacks. Enable automatic updates for minor releases and apply major updates promptly after testing.
Use Strong Passwords
Weak or reused passwords are an open door for attackers. Strong credentials are one of the simplest and most effective security measures you can implement.
Install a Security Plugin
A good security plugin provides multiple layers of protection - firewall, malware scanning, login protection, and file integrity monitoring - in a single solution.
Regular Backups
A good backup is your last line of defence. If everything else fails, you restore from a clean backup and get back online quickly - often within hours.
Advanced Security Measures
Once the essentials are in place, these additional measures provide deeper protection for sites with higher security requirements.
Change the Login URL
Move wp-admin to a custom URL to instantly eliminate 99% of automated brute force attacks targeting the default login page.
Disable XML-RPC
XML-RPC is a legacy WordPress feature that's commonly exploited for brute force and DDoS attacks. Disable it unless you specifically need it.
Security Headers
Implement HTTP security headers (Content-Security-Policy, X-Frame-Options, HSTS, Referrer-Policy) to close browser-level attack vectors.
Limit Login Attempts
Configure login throttling to lock out IP addresses after a defined number of failed attempts - preventing brute force attacks from succeeding.
Hosting Security
Choose a host that provides server-level WAF, DDoS protection, malware scanning, and automated backups. Security starts at the server level.
File Permissions
Review and harden WordPress file permissions. Directories should be 755, files should be 644, and wp-config.php should be 600 or 440.
What to Do If Your Site Gets Hacked
If you discover your WordPress site has been compromised, follow these steps in order:
- 1Don't panic - and don't ignore it
Most hacked sites can be recovered. The faster you act, the less damage is done.
- 2Take your site offline
Replace your index page with a maintenance page to prevent further damage to visitors and your search reputation.
- 3Change all passwords immediately
Change passwords for WordPress admin accounts, database access, FTP/SFTP, and your hosting control panel.
- 4Restore from a clean backup
If you have a backup from before the compromise, restore from it. Verify it's clean before going live.
- 5Scan and clean if no backup exists
Use a security plugin to scan for malware, or hire a professional cleanup service. Manual cleanup is complex and error-prone.
- 6Patch the vulnerability
Identify how the attacker got in - usually an outdated plugin or weak password - and fix it before restoring the site.
- 7Contact your hosting provider
They may be able to help with server-level cleanup and should be informed of any compromise affecting their infrastructure.
If you're on a managed hosting or maintenance plan with us, skip steps 1-6 and contact us immediately. We handle emergency cleanup and restoration as part of the service.
Get Emergency HelpWordPress Security - Common Questions
Get comprehensive WordPress security
Security monitoring, malware protection, vulnerability management, and rapid incident response - all included in our managed hosting and care plans.