Where the holes are
Patchstack recorded 11,334 new vulnerabilities in the WordPress ecosystem in 2025, 42 % more than the year before. 91 % were in plugins, 9 % in themes, and WordPress core had six reports. 46 % were not patched when they were disclosed, and the most exploited flaws typically saw mass exploitation within five hours.
That means two things. First, every extra plugin is extra risk. Second, updating once a month does not help if a plugin on your site gets a critical flaw on a Tuesday. Someone has to see the warnings the same day.
When we scanned the sites we look after, Akismet ran on 14 of 16 installations and Yoast on seven, with 161 different plugins in total. None of those numbers is unusual. But every plugin is code from another vendor that has to be kept up to date.
Hardening checklist with WP-CLI
Try this on a copy first if you are new to WP-CLI. The first block only reads.
# Has WordPress core been modified? Compares every file with wordpress.org
wp core verify-checksums
# Have wordpress.org plugins been modified? (premium plugins cannot be checked this way)
wp plugin verify-checksums --all
# What needs updating?
wp plugin list --update=available --fields=name,version,update_version
wp theme list --update=available --fields=name,version,update_version
wp core check-update
# Plugins closed on wordpress.org or not updated in a long time
wp plugin list --fields=name,status,version,wporg_status,wporg_last_updated
# Who is an administrator? Remove anyone who should not be
wp user list --role=administrator --fields=ID,user_login,user_registered
# Can anyone register? Should be 0 on a company site
wp option get users_can_register
The wporg_status and wporg_last_updated fields show whether a plugin has been closed in the directory and when it was last updated. A closed plugin gets no security fixes – even if it seems to work fine.
The next block changes settings:
# No code editor in wp-admin (otherwise an attacker with an admin login can write PHP directly)
wp config set DISALLOW_FILE_EDIT true --raw
# No new registrations if you do not use them
wp option update users_can_register 0
# New keys and salts: logs everyone out. Use it after a suspected break-in
wp config shuffle-salts
And a small mu-plugin that closes two doors most company sites do not use: XML-RPC and application passwords. If you use Jetpack or an app that logs in via XML-RPC, leave out the first line.
<?php
/**
* Plugin Name: Hardening (mu-plugin)
* Save as wp-content/mu-plugins/hardening.php
*/
add_filter( 'xmlrpc_enabled', '__return_false' );
add_filter( 'wp_is_application_passwords_available', '__return_false' );
// Hide the REST API user list from visitors who are not logged in
add_filter( 'rest_endpoints', function ( $endpoints ) {
if ( ! is_user_logged_in() ) {
unset( $endpoints['/wp/v2/users'], $endpoints['/wp/v2/users/(?P<id>[\d]+)'] );
}
return $endpoints;
} );
Finally: no PHP files in the uploads folder. Only images and documents belong there, and a PHP file there is almost always a backdoor.
# wp-content/uploads/.htaccess (Apache 2.4)
<FilesMatch "\.(php|phtml|phar)$">
Require all denied
</FilesMatch>
# nginx – in the server block:
# location ~* /wp-content/uploads/.*\.(php|phtml|phar)$ { deny all; }
These are the same measures we built into our own product Lynbro Shield: code editor off, no PHP in uploads, XML-RPC, readme and license blocked, version number hidden and application passwords off. Shield also sets security headers and HSTS and has a firewall with 13 rules that, among other things, blocks known scanners. It was tested against 21 attack cases and 15 Danish texts with no false positives. Version 0.3.0 runs a full Content Security Policy, which we ran in report-only mode first and then enforced, with a collector for the reports. Shield is not in the wordpress.org directory; it lives on plugins.lynbro.dk.
Login protection
- No shared logins. One user per person, so you can close one account without changing everyone’s password.
- Two-factor for every administrator. It stops almost every attack with stolen passwords.
- Limit attempts. A plugin that slows down repeated failed logins stops automated guessing.
- No user called “admin”. It is the first thing a scanner tries.
We use our own product Lynbro Login Guard, approved on wordpress.org in November 2026, which runs on our own sites and the whole best-choice.dk network with multisite support. It is new: the directory still shows fewer than ten active installs, and it is tested with WordPress 7.1.5. There are older, more widely used alternatives in the directory; what matters is that you have one.
Plugin hygiene
- One plugin per job. Two cache plugins or two SEO plugins cause conflicts and double the attack surface.
- Delete, do not just deactivate. A deactivated plugin is still on the server, and its files can be called directly.
- Only from known sources. Never install a “free” copy of a paid plugin. Those files often have a backdoor built in.
- Look at maintenance. When was the plugin last updated, and is it tested with the latest WordPress? We collected the numbers for the Danish plugins on the plugin status page.
- AI features with your own key. Plugins that send text to an AI service should do it with your own key and be off by default. That is how our own plugins with AI features are built.
E-mail is security too
Forms, order confirmations and password resets depend on the site being able to send mail. For us, PHP’s mail() had silently stopped on a server, and on one site wp_mail() had been broken without anyone noticing. It now sends via SMTP, with SPF, DKIM and DMARC passing. Our own product Lynbro SMTP Mailer handles that. Whether your domain has DMARC, you can check automatically on audit.best-choice.dk.
If the damage is done
Hardening is prevention. Once a site has been hacked, the order changes: contain, keep the evidence, find the backdoors and rotate keys last. The full procedure with WP-CLI commands and the deadline for reporting a breach is on the page WordPress hacked – what now?.
If it is not an attack but an everyday fault – a critical error, a white screen or a form that does not send – the short answers are on the page about WordPress errors and help.
Questions about WordPress security
Which security plugin should we use?
A plugin helps, but it does not replace updates and having few plugins. Most of the hardening above needs no plugin. If you pick one, pick one – not two that overlap.
Is WordPress insecure?
Core is rarely the problem: it had six reports in 2025 against more than 10,000 in plugins. The risk lies in the plugins and themes you choose and how quickly they are updated.
How can I tell if my WordPress site is hacked?
Run wp core verify-checksums and wp plugin verify-checksums --all, and look for unknown administrators and PHP files in uploads. Strange redirects on mobile and spam pages in Google are typical signs too.
Should we turn off XML-RPC?
Yes, unless you use Jetpack or an app that logs in that way. It is one of the doors scanners try.
Sources
- Patchstack – State of WordPress Security in 2026 — vulnerabilities in 2025, checked 19 Nov 2026
- WP-CLI – wp plugin list — the wporg_status and wporg_last_updated fields, checked 19 Nov 2026
- WP-CLI – wp core verify-checksums and wp plugin verify-checksums — checked 19 Nov 2026
Fixed price, no commitment
Get a free WordPress check
Tell us briefly what you use today and what you want to achieve. A person answers by e-mail with a proposal and a fixed price before any work starts.
- A fixed price before we start
- An answer by e-mail, no calls
- Your details are used only to answer you