Skip to content

The WordPress Security Checklist for 2026: Protect Your Site

A practical WordPress security checklist for 2026: updates, logins, 2FA, file permissions, backups, firewalls and malware scanning, with copy-ready code.

By Devma Hosting Team · · 8 min read

A WordPress security checklist comes down to a few habits. Keep WordPress core, plugins, themes and PHP up to date. Protect every login with a strong password and two-factor authentication. Lock down wp-config.php, file permissions and the built-in file editor. And run a firewall, malware scanning and tested off-site backups. Most vulnerabilities appear in plugins, so the quickest win is usually deleting the ones you don't use and updating the rest.

Key takeaways

  • Plugins, not WordPress core, are where nearly all new vulnerabilities appear. Update them quickly, or replace them.
  • Turn on two-factor authentication for every administrator account.
  • A few lines in wp-config.php and correct file permissions block common attack paths.
  • A web application firewall can protect you while a plugin has no patch available yet.
  • Backups only count if they're stored off the server and you've tested a restore.

Why does WordPress security matter in 2026?

Because attackers move faster than most site owners. Patchstack's State of WordPress Security in 2026 report found:

  • 11,334 new vulnerabilities in the WordPress ecosystem in 2025, a 42% increase over 2024.
  • 91% of them were in plugins and 9% in themes. WordPress core had just six, all low priority.
  • 46% had no fix from the developer in time for public disclosure.
  • For heavily targeted vulnerabilities, the weighted median time to first exploit was five hours.

The lesson: WordPress itself is in good shape, but your plugins and themes need watching. You also need a way to block attacks when there's no patch to install yet.

1. Keep WordPress, plugins, themes and PHP updated

This step prevents more hacks than anything else on this list.

  • Core updates. Sites first installed on WordPress 5.6 or later get both minor and major core updates automatically by default. Sites installed earlier get minor updates only. You can set the behavior explicitly with the WP_AUTO_UPDATE_CORE constant. It accepts true, false or 'minor'.
  • Plugin and theme auto-updates. Since WordPress 5.5 you can enable auto-updates one plugin or theme at a time from the Plugins and Themes screens. WordPress checks twice a day and emails you the results.
  • Delete what you don't use. A deactivated plugin's code is still on your server. The official hardening guide recommends deleting plugins you aren't using.
  • Replace abandoned plugins. If a plugin hasn't been updated in a long time, look for a maintained alternative.
  • Run a supported PHP version. WordPress recommends PHP 8.3 or later. PHP 8.1 no longer gets security fixes. PHP 8.2's security support ends on December 31, 2026, so plan that upgrade now.
  • Test big updates on staging before applying them to a store or other business-critical site.
// wp-config.php: allow all core updates, including major releases
define( 'WP_AUTO_UPDATE_CORE', true );

2. Lock down logins and user accounts

  • Use unique, long passwords for every WordPress, hosting, SFTP and database account. A password manager makes this painless, and our password generator can create strong ones.
  • Turn on two-factor authentication (2FA) for every administrator and editor. The free Two-Factor plugin, built by WordPress contributors, supports authenticator apps, email codes and backup codes.
  • Apply least privilege. Give people the lowest role that lets them do their job. Most content writers need Author or Editor, not Administrator. Review the user list every few months and remove people who've left.
  • Avoid obvious usernames like admin for administrator accounts.
  • Rate-limit the login page so password-guessing bots can't hammer it.
  • Review Application Passwords. Since WordPress 5.6, users can create Application Passwords for API access. They can't be used to log in to the dashboard, but they do grant API access. Revoke any you don't recognize. If you never use them, you can turn the feature off with the wp_is_application_passwords_available filter.

If you manage your own Nginx server, a rate limit on wp-login.php looks like this. Adjust the PHP-FPM socket path to match your server:

# In the http {} block
limit_req_zone $binary_remote_addr zone=wplogin:10m rate=5r/m;

# In your server {} block
location = /wp-login.php {
    limit_req zone=wplogin burst=5 nodelay;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_pass unix:/run/php/php8.3-fpm.sock;
}

3. Harden wp-config.php and file permissions

wp-config.php holds your database credentials and security keys, so it deserves extra care. Add these lines above the "That's all, stop editing!" comment:

// Disable the theme and plugin file editor in the dashboard
define( 'DISALLOW_FILE_EDIT', true );

// Force HTTPS for logins and the admin area
define( 'FORCE_SSL_ADMIN', true );

// Never show PHP errors to visitors on a live site
define( 'WP_DEBUG', false );

DISALLOW_FILE_EDIT means that an attacker who steals an admin login can't simply paste malicious code into a theme file from the dashboard. Next:

  • Refresh your security keys and salts if they're missing, default or possibly leaked. WordPress provides a generator. Replacing them logs everyone out, which is exactly what you want after a suspected breach.

  • Set correct file permissions. The official guide recommends 755 for directories and 644 for files. wp-config.php should be readable only by you and the web server, which generally means 400 or 440:

    find /path/to/wordpress/ -type d -exec chmod 755 {} \;
    find /path/to/wordpress/ -type f -exec chmod 644 {} \;
    chmod 440 /path/to/wordpress/wp-config.php
    
  • Give the database user only what it needs. Everyday operation needs SELECT, INSERT, UPDATE and DELETE. The hardening guide notes that removing schema-changing privileges can break some updates, so do this only if you can manage it.

  • Use a custom table prefix on new installs. It's a small extra layer, not a substitute for updates.

4. Close the doors you don't use

  • XML-RPC. If nothing on your site uses xmlrpc.php, block it. Some services, such as Jetpack, depend on it, so check first. The xmlrpc_enabled filter only disables methods that require authentication, not pingbacks, so blocking at the server is more thorough.
  • PHP in uploads. Your uploads folder should only ever contain media. Refusing to run PHP there stops a common way of executing uploaded backdoors.
  • Forgotten copies. Old staging sites, test installs and backup.zip files in the web root are easy targets. Delete them, or protect them with a password.

On Nginx, both blocks take a few lines. Place them above your main PHP location block, because Nginx uses the first regular-expression location that matches:

location = /xmlrpc.php {
    deny all;
}

location ~* ^/wp-content/uploads/.*\.php$ {
    deny all;
}

5. Add a firewall, malware scanning and monitoring

Updates fix known problems. These layers catch the rest:

  • Web application firewall (WAF). A WAF filters malicious requests, such as SQL injection or cross-site scripting attempts, before they reach WordPress. Many can also apply "virtual patches" for known vulnerabilities, which matters when nearly half of new vulnerabilities have no fix at disclosure.
  • DDoS mitigation keeps floods of traffic from taking the site offline.
  • Malware scanning. Run daily scans of files and the database for injected code, spam links and backdoors.
  • File change monitoring. The hardening guide suggests watching for unexpected file changes with tools such as Git, diff or inotify.
  • Uptime monitoring and logs. Alerts tell you within minutes when the site goes down. Your access logs show brute-force attempts and suspicious requests.
  • Bot control. Scrapers and aggressive crawlers can slow a site down. Our guide on how to block AI crawlers without hurting your SEO explains how to manage them.

6. Back up like you'll need it

  • Automate backups of both files and the database. Daily is a sensible default for active sites.
  • Store copies off the server. A backup on the same account as a hacked site may be hacked too.
  • Keep older snapshots. The official guide recommends periodic snapshots, so you still have a clean copy from before an intrusion you discover late.
  • Encrypt backups, since they contain your database and wp-config.php.
  • Test a restore to a staging site every few months. An untested backup is just a hope.

7. Get the hosting basics right

  • HTTPS everywhere. Use a valid certificate on every page, not just checkout. Check yours with the SSL checker.
  • SFTP or SSH, never plain FTP. The hardening guide recommends SFTP. Plain FTP sends your password unencrypted.
  • Supported server software. WordPress recommends MariaDB 10.11+ or MySQL 8.0+ alongside PHP 8.3+.
  • Account isolation. On shared hosting, make sure each site runs under its own system user, so one compromised site can't read another's files.

Who does what depends on your hosting type. Our comparison of VPS, shared and managed WordPress hosting includes a security responsibility table.

What to do if your WordPress site is hacked

  1. Take a full backup of the hacked site before changing anything. You'll want it to work out how the attacker got in.
  2. Restrict access, for example with maintenance mode or a firewall rule, so visitors aren't exposed.
  3. Change every password: WordPress users, hosting panel, SFTP and database. Then replace your security keys and salts.
  4. Restore a clean backup from before the infection, or clean manually. Replace core files with a fresh copy and reinstall plugins and themes from official sources. Then search wp-content/uploads for PHP files.
  5. Find and fix the entry point. Check logs and update or remove the vulnerable plugin, or the site will be reinfected.
  6. Request a review in Google Search Console's Security Issues report if Google flagged your site.
  7. Monitor closely for the next few weeks.

Your WordPress security checklist at a glance

  • WordPress core, plugins and themes up to date, with auto-updates on where safe
  • Unused plugins and themes deleted
  • PHP 8.3 or later
  • Unique passwords and 2FA for every admin
  • Least-privilege user roles, reviewed regularly
  • Login rate limiting in place
  • DISALLOW_FILE_EDIT and FORCE_SSL_ADMIN set, debug display off
  • Permissions at 755/644, with wp-config.php at 400 or 440
  • XML-RPC blocked if unused, and no PHP execution in uploads
  • WAF, DDoS mitigation and daily malware scans active
  • Encrypted, off-site backups with a tested restore
  • HTTPS everywhere, and SFTP instead of FTP

Let your host handle the heavy lifting

Much of this list is ongoing maintenance, and that's where it slips. Devma WordPress Hosting starts at $4.99/month with free SSL, automatic core security updates and daily backups. The WP Managed plan adds managed plugin and theme updates, staging sites for testing changes, malware scanning and a firewall. For sites that need more, Security & AI Bot Protection adds an edge firewall, DDoS mitigation and malware scanning in front of any site hosted with us, from $4.99 per site per month. Two-factor authentication and strong passwords remain your part of the deal.

Frequently asked questions

How do most WordPress sites get hacked?

Usually through a vulnerable plugin or theme, not WordPress itself. Patchstack's 2026 report found that 91% of the new WordPress vulnerabilities discovered in 2025 were in plugins and 9% in themes, while WordPress core had only six, all low priority. Weak or reused passwords are the other common entry point.

Do I need a WordPress security plugin?

Not necessarily. If your host already provides a web application firewall, malware scanning and login protection, a heavy all-in-one plugin may just duplicate that work. You may still want a lightweight plugin for two-factor authentication. Avoid running several overlapping security plugins at once.

Should I disable XML-RPC in WordPress?

If nothing on your site uses it, yes. Check first, because some services, such as Jetpack, rely on it. Note that the xmlrpc_enabled filter only disables methods that require authentication, so to switch it off completely, block xmlrpc.php at the web server or firewall.

How often should I back up my WordPress site?

Back up at least as often as your content changes. For a store or busy blog, that usually means daily. Keep copies off the server and retain older snapshots as well as recent ones, because a compromise can go unnoticed for weeks. Test a restore every few months so you know the backups actually work.

Is changing the wp_ database table prefix worth it?

It's a minor extra step. WordPress's own hardening guide says a custom prefix can block some SQL injection attacks that assume the default, but it won't protect a site with a vulnerable plugin. Do it on new installs, and focus your effort on updates, logins and backups.

Abstract blue swirling shapes with light reflections

Ready when you are.

Pick a plan and launch today, or tell us what you run and we will size it with you.

Devma Hosting

AI assistant · replies in seconds

Hi there.
How can we help?

Ask about plans, moving your site, email or security. Answers come from our own guides, and a person is one tap away.

  • Message us on WhatsApp