Websites

WordPress Security Checklist: How to Harden Your Site, Step by Step

WordPress Security Checklist: How to Harden Your Site, Step by Step

To secure WordPress, do five things in this order: keep core, plugins and themes updated and delete the ones you don’t use; keep only the admin accounts you need, with strong passwords and 2FA; set up automatic backups stored off the server; tighten file permissions and turn off code editing in the dashboard; then add a WAF and change monitoring. Most hacks don’t start in WordPress core; they start in plugins. According to Patchstack, 91% of the 11,334 new vulnerabilities found in 2025 were in plugins, and just 6 were in core.

Where do WordPress hacks come from?

The clearest picture comes from the annual Patchstack State of WordPress Security in 2026 report. In 2025, 11,334 new vulnerabilities were found in the WordPress ecosystem, 42% more than the year before. 91% were in plugins, 9% in themes, and core had 6 low-priority issues. A few more numbers from the report explain why “our WordPress is up to date” isn’t enough:

  • 46% of vulnerabilities had no fix from the developer at the time of public disclosure.
  • Roughly half of high-impact vulnerabilities were exploited within 24 hours, and the weighted median time to first exploitation for heavily attacked flaws was 5 hours.
  • Premium plugins and themes bought on marketplaces had three times as many vulnerabilities exploited in real attacks as free ones.
  • In penetration tests of hosting companies, typical defences blocked only 26% of attacks on WordPress vulnerabilities.

Patchstack sells security services, so read the report with that in mind, but the direction is clear. Attackers come in through plugins, they move fast, and your host won’t stop everything.

Common attack route How to defend against it
A vulnerable or abandoned plugin or theme Updates, fewer plugins, vulnerability monitoring, a WAF with virtual patching
A guessed or stolen admin password Unique passwords from a manager, 2FA, login rate limiting
“Free” copies of paid plugins (nulled) Plugins and themes only from WordPress.org or the developer
Over-broad file permissions and the dashboard code editor 755/644 permissions, DISALLOW_FILE_EDIT
Poorly isolated hosting, unencrypted FTP Hosting with account isolation, SFTP or SSH instead of FTP

The WordPress security checklist

This list is based on the official Hardening WordPress guide and related WordPress documentation, plus what we check on client sites ourselves.

1. Updates

  • WordPress has installed minor security updates to core automatically since version 3.7. Leave them on.
  • Since version 5.5 you can enable automatic updates for each plugin and theme individually. WordPress checks twice a day and emails you after every attempt (WordPress documentation). It relies on WP-Cron, so check Site Health to make sure scheduled tasks actually run.
  • Test big updates, such as WooCommerce or a page builder, on a staging copy first, and always back up before updating.
  • Delete plugins and themes you don’t use. A deactivated plugin is still sitting on the server.

2. Plugins and themes

  • Install only from WordPress.org or directly from the developer. The WordPress hardening guide says plainly not to get plugins or themes from untrusted sources.
  • Before installing, check when it was last updated, how many active installs it has and whether the developer responds to support threads.
  • Follow vulnerability databases for the plugins you run. With almost half of flaws unpatched on disclosure day, updating alone isn’t always enough.
  • Every plugin is code someone has to maintain. Fewer plugins means a smaller attack surface. We explain why we went from 24 to 5 in Elementor vs a custom theme.

3. Accounts and logins

  • Review your administrator list regularly. An unknown admin account is one of the most common signs of a hack, and it’s easy to miss.
  • Don’t use the username “admin”, and give everyone the lowest role that does the job: authors write, editors edit, and administrators stay as few as possible (roles and capabilities).
  • Turn on 2FA for every administrator and privileged account. WordPress core doesn’t include two-factor authentication, so you need a reputable plugin (WordPress docs on brute-force attacks).
  • Rate-limit login attempts at the WAF, CDN or web server. A security plugin is the fallback when your host doesn’t do it.
  • Moving the login URL can cut bot traffic, but the documentation says it shouldn’t be your only defence.

4. Passwords and keys

  • Long, unique passwords from a password manager for WordPress, hosting, the database, SFTP and email.
  • Generate the keys and salts in wp-config.php with the official WordPress.org generator. Change them whenever you suspect a breach: it invalidates every active session, including the attacker’s.

5. Backups

  • A backup has to cover the database and the files: core, plugins, themes, uploads, wp-config.php and .htaccess.
  • The WordPress docs suggest weekly backups for smaller sites and daily ones for busy sites, keeping 3–5 recent copies in different places, such as the server, cloud storage and a local machine (WordPress Backups).
  • Keep older snapshots too. An infection can sit in your files for weeks, and by then yesterday’s backup is infected as well.
  • Once a quarter, test restoring the site from a backup in a separate environment. A backup nobody has restored is just a hope.

6. File permissions and configuration

  • Directories 755 or 750, files 644 or 640, and wp-config.php 440 or 400 so other users on the server can’t read it. Never 777, not even for the uploads folder (WordPress: file permissions).
  • Add define( 'DISALLOW_FILE_EDIT', true ); to wp-config.php to disable the plugin and theme editor in the dashboard. The docs point out it won’t stop someone uploading malicious files, but it closes the easiest route to changing code after an account takeover.
  • Block PHP execution in wp-content/uploads. That folder is for images and documents, not scripts.
  • Turn off directory listing on the server.

7. XML-RPC and the REST API

  • If you don’t use XML-RPC (some mobile apps and older integrations do), switch it off. If you need it, restrict and rate-limit it. That’s the WordPress documentation’s advice, and server-level blocks are best scoped narrowly to /xmlrpc.php and /wp-login.php.
  • Don’t disable the whole REST API. The block editor and many plugins depend on it. Restrict specific endpoints if you have to.

8. WAF and hosting

  • A web application firewall at the CDN, server or plugin level filters known attacks and can patch flaws virtually before an update exists. Bear in mind, though, that according to Patchstack the most exploited category in 2025 was broken access control, where attacks look like normal logged-in traffic. A generic WAF won’t catch those; updates and tighter permissions will.
  • Your host should offer a supported PHP version, account isolation, SFTP or SSH access, malware scanning and its own backups.
  • HTTPS across the whole site, with HTTP redirected.

9. Monitoring

  • File integrity: the WP-CLI command wp core verify-checksums compares core files against WordPress.org checksums, and wp plugin verify-checksums does the same for plugins from the official directory.
  • Alerts for new administrator accounts and logins from new locations.
  • The Security Issues report in Search Console. Google lists, among others, code injection, content injection (spammy links and text) and URL injection (spam pages created on your site) (Search Console Help).
  • A sudden jump in indexed pages in Search Console that you can’t explain. It is often the first visible symptom of spam injected into the database.
  • Server logs and uptime monitoring. The WordPress hardening guide calls logs your best friend when investigating an incident.

The checklist as a schedule

How often Task
Continuously (automated) Core security updates, backups, WAF, uptime and new-account monitoring
Weekly Plugin and theme updates, checking that backups ran, reviewing alerts
Monthly Reviewing users and roles, removing unneeded plugins, verifying checksums, Search Console reports
Quarterly A test restore from backup, reviewing file permissions and server configuration, rotating technical account passwords
After any incident New passwords and salts, an account review, full verification of files and database, root-cause analysis

From our own work: what we found after a hack on orbitbuilder.pl

In November 2026 we cleaned up our own site after a hack. I’m writing about it openly because it shows what a typical spam infection looks like and why “just delete the suspicious files” doesn’t cut it. Here’s what we found:

  • 2 altered files that appended spam to the site footer. Spam like this is often not obvious at first glance, but search engine crawlers see it on every page.
  • A rogue administrator account that would have let the attacker back in even after the file changes were reverted.
  • 9,915 spam posts and 2,238 spam categories and tags in the database: thousands of pages none of us had created.

We removed the injected code from both files, deleted the rogue account and purged the spam posts and terms from the database. The spam URLs now return 410 Gone. Google treats all 4xx codes except 429 the same way and drops such URLs from the index if they were indexed before (Google Search Central). We chose 410 because it tells every crawler unambiguously that the page is gone for good.

The lessons match the Patchstack report, which notes that malicious code increasingly lands inside genuine core, plugin or theme files rather than in separate, easy-to-spot files. That’s why our cleanups compare files against checksums and clean copies and go through the user list and the database, instead of just hunting for oddly named files.

What should you do if your site has already been hacked?

This article is about prevention, but if you’re seeing signs of a hack, the order of steps matters:

  1. Preserve the evidence. Copy the files and database as they are before changing anything. You’ll need them to work out the cause.
  2. Cut off access. Change hosting, SFTP, database and admin passwords, generate new salts and remove unknown accounts.
  3. Clean the files. Verify checksums and reinstall core and plugins from official sources.
  4. Clean the database. Spam posts, terms, options, cron jobs and users.
  5. Tidy up in Google. Spam URLs returning 404 or 410, an updated sitemap and, once the issues are fixed, a review request in the Search Console Security Issues report. Google says reviews take anywhere from a few days to a few weeks.
  6. Remove the cause. If you don’t find the way in, the infection usually comes back. Then work through the full checklist above.

If you’d rather not do it yourself, see how our WordPress malware removal works. Keep an eye on search traffic too: injected spam damages visibility, and checking the site after an incident is a good moment for an SEO audit.

Who should be responsible for website security?

The worst answer is “everyone”, because then nobody is. Most of the neglect we see isn’t about lack of knowledge; it’s that after launch nobody was given the job of checking updates, backups and accounts every week. If no one in the company will do that, hand it to a provider with a clear scope: what runs automatically, what’s done by hand, how often and who responds to an alert.

Want someone to keep an eye on updates, backups and security for your site? Take a look at our WordPress maintenance, and if your site is already infected, get in touch and describe what you’re seeing.

Frequently asked questions

How do I secure a WordPress site?

Keep core, plugins and themes updated and delete the ones you don’t use. Keep only the admin accounts you need, with strong passwords and 2FA, set up automatic off-server backups, tighten file permissions and disable the dashboard code editor. Then add a WAF and monitoring for file and account changes.

Is WordPress secure?

Core is: in 2025 Patchstack found only 6 low-priority vulnerabilities in it. The problem is plugins and themes, which accounted for the rest of the 11,334 new flaws. How secure a WordPress site is depends mainly on how many plugins you run, which ones, and how quickly you update them.

Should I disable XML-RPC in WordPress?

Yes, if you don’t use it. The WordPress documentation recommends disabling XML-RPC when it isn’t needed, and otherwise restricting and rate-limiting it. Some mobile apps and older integrations rely on it, so check before you switch it off.

How often should I back up WordPress?

The WordPress docs suggest weekly backups for smaller sites and daily ones for busy sites, and always before an update. Backups must include both the database and the files. Keep 3–5 recent copies in different places and regularly check that you can actually restore from them.

How can I tell if my site has been hacked?

Check your administrator list, the Security Issues report in Search Console and whether the number of indexed pages has grown for no reason. Compare files against checksums with wp core verify-checksums. Spam is often visible only in the page source, for example hidden links in the footer.

Is a security plugin enough?

No. A plugin helps with things like 2FA, login limits and file scanning, but it can’t replace updates, backups, sensible permissions and tidy accounts. Patchstack notes that the most exploited flaws look like normal logged-in traffic, so generic filters won’t stop them.

Sources

  1. Patchstack – State of WordPress Security in 2026
  2. WordPress Developer Resources – Hardening WordPress
  3. WordPress Developer Resources – Brute Force Attacks
  4. WordPress Developer Resources – WordPress Backups
  5. WordPress Developer Resources – Changing File Permissions
  6. WordPress Documentation – Plugin and themes auto-updates
  7. WordPress Documentation – Roles and Capabilities
  8. WP-CLI – wp core verify-checksums
  9. WP-CLI – wp plugin verify-checksums
  10. WordPress.org – Secret key and salt generator
  11. Search Console Help – Security Issues report
  12. Google Search Central – How HTTP status codes affect Google’s crawlers

Need help with this?

We design and code company websites from scratch — no off-the-shelf templates, built for conversion, speed and visibility in Google and AI search.