Protect your WordPress site

How to Secure a WordPress Website

WordPress powers 40% of websites, making it a prime target. Learn essential security measures to protect your site.

Security
12 min read
Step-by-step
Proven methods

Essential Security Measures

These four measures form the foundation of WordPress security. Implement all of them to protect against 97% of common attacks.

Step 1

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.

Update WordPress core as soon as stable releases are available
Update all plugins - especially security and compatibility patches
Update your theme and test that customisations still work
Check PHP version - run 8.0+ for latest security features
Remove any unused plugins and themes entirely
Step 2

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.

Use unique passwords of 16+ characters for all WordPress accounts
Never reuse passwords across different services or websites
Implement two-factor authentication (2FA) for all admin users
Remove or rename the default 'admin' username
Regularly audit user accounts and remove inactive ones
Step 3

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.

Choose a reputable plugin like Wordfence, Sucuri, or Solid Security
Enable the web application firewall (WAF) to block malicious traffic
Set up real-time malware scanning and file change detection
Configure login throttling to block brute force attacks
Enable security email alerts for suspicious activity
Step 4

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.

Automate daily backups to a remote location (cloud storage)
Keep at least 30 days of backup history
Test backups monthly - verify files can be restored
Use both database-only and full-site backup types
Store backups off-site, not on your hosting server

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:

  1. 1
    Don't panic - and don't ignore it

    Most hacked sites can be recovered. The faster you act, the less damage is done.

  2. 2
    Take your site offline

    Replace your index page with a maintenance page to prevent further damage to visitors and your search reputation.

  3. 3
    Change all passwords immediately

    Change passwords for WordPress admin accounts, database access, FTP/SFTP, and your hosting control panel.

  4. 4
    Restore from a clean backup

    If you have a backup from before the compromise, restore from it. Verify it's clean before going live.

  5. 5
    Scan 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.

  6. 6
    Patch the vulnerability

    Identify how the attacker got in - usually an outdated plugin or weak password - and fix it before restoring the site.

  7. 7
    Contact 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 Help

WordPress 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.

    Cookie Consent

    We use a Google Ads cookie to measure the effectiveness of our advertising. No personal data is shared with Google.Privacy policy →