
WordPress runs 38.3% of all websites, and 57.3% of the sites whose content management system is known, according to W3Techs. That reach makes it the first target of automated attacks. In 2027 those attacks are faster, cheaper and better at looking human, because more and more of them are driven by AI.
This guide is for the people who answer for a WordPress site: owners of company and e-commerce sites, IT managers and the agencies that maintain them. It covers how the attacks work, how quickly new flaws are exploited and a defense plan you can apply in order, with the settings that matter.
Why AI Changes Bot Attacks
Imperva's 2026 Bad Bot Report found that automated traffic made up more than 53% of all web traffic in 2025, up from 51% the year before, while human activity fell to 47%. AI tools let attackers:
- generate login attempts and form submissions that imitate real visitors,
- read pages and adapt their requests instead of following a fixed script,
- rotate through residential IP addresses that look like ordinary users,
- test newly published plugin vulnerabilities across thousands of sites.
The same report found that 27% of bot attacks target APIs. That matters for WordPress, where the REST API and XML-RPC are switched on by default.
Not every bot is hostile. Search engine crawlers, uptime monitors and the crawlers of AI assistants all visit the same pages as the attackers. The job in 2027 is not to block automation. It is to tell the bots you want from the bots you do not, and to make the rest expensive.
How Fast New Flaws Are Exploited
Patchstack's State of WordPress Security in 2026 counted 11,334 new vulnerabilities in the WordPress ecosystem in 2025, a 42% increase on 2024. Several of its findings decide how a site should be maintained:
- Fixes often come late. 46% of the vulnerabilities did not receive a fix from the developer in time for public disclosure.
- Exploitation starts within hours. About half of high-impact vulnerabilities were exploited within 24 hours, and the weighted median time to the first exploit was 5 hours.
- Severity is rising. 17% of the new vulnerabilities had a high severity score, and highly exploitable vulnerabilities rose 113% year on year.
- Premium components are a blind spot. Premium and freemium plugins and themes accounted for 29% of valid reports, and 76% of the vulnerabilities found in them were exploitable in real attacks.
- Broken access control led the attacks. It was the most exploited class, and its exploits look like normal logged-in traffic, which makes them hard for a traditional firewall to spot.
The conclusion is uncomfortable: a weekly update routine is too slow for the most dangerous flaws, and some flaws have no update at all on the day they become public. Fast patching still matters, but it has to be combined with fewer components, protection in front of the site and the ability to recover.
Where WordPress Sites Get Hit
According to the same Patchstack report, 91% of the new vulnerabilities were in plugins and 9% in themes, while only 6 low-priority issues were reported in WordPress core. Bots go where the flaws are:
- Login pages: credential stuffing and brute force against wp-login.php and xmlrpc.php.
- Outdated plugins and themes: scanners try known flaws on every site they find.
- Access control flaws: requests from low-privilege accounts, such as customers or subscribers, that reach functions meant for administrators.
- Forms and checkouts: spam, fake sign-ups and payment card testing on WooCommerce stores.
- User enumeration: usernames collected from author archives and the REST API to sharpen login attacks.
- Scraping: crawlers copying pages, prices and product data at scale.
Signs in Your Logs That Bots Are Targeting You
Most attacks announce themselves in the web server's access log long before they succeed. Look for:
- bursts of POST requests to wp-login.php or xmlrpc.php, often from many different addresses;
- requests for author archives such as
?author=1and for/wp-json/wp/v2/users, which reveal usernames; - series of 404 errors for plugin files your site does not have, a sign that a scanner is checking which vulnerable plugins you run;
- heavy traffic to admin-ajax.php from visitors who are not logged in;
- on WooCommerce stores, many failed payments in a short time, often small amounts: a sign of card testing;
- visitors that call themselves Googlebot but come from addresses that fail Google's verification.
A one-line count of the busiest login attackers on a typical Linux server:
grep "POST /wp-login.php" /var/log/nginx/access.log | awk '{print $1}' | sort | uniq -c | sort -rn | headIf a handful of addresses send hundreds of login attempts, the rate limits in step 3 below are overdue.
A WordPress Defense Plan for 2027
Work through the steps in order. The first three remove most of the everyday risk; the rest limit the damage when something gets through.
1. Patch Fast and Remove What You Do Not Use
WordPress has offered automatic updates for plugins and themes since version 5.5. Turn them on for the components you trust, and review the rest at least weekly.
- Keep an inventory of every plugin and theme, its vendor and why the site needs it.
- Delete deactivated plugins and themes instead of leaving them on the server.
- For premium components, subscribe to the vendor's security notices, because their updates often do not appear in the dashboard until the license is renewed.
- When a flaw is public and no fix exists, disable the component or block the vulnerable request until the vendor ships a fix.
Every plugin you remove is one less thing to patch.
2. Move Off PHP 8.2 Before 31 December 2026
PHP releases receive security fixes for a fixed period. According to php.net, PHP 8.2 receives security fixes until 31 December 2026, PHP 8.3 until 31 December 2027 and PHP 8.4 until 31 December 2028. After that date a version gets no more fixes, whatever flaws are found in it.
WordPress itself recommends PHP 8.3 or greater, MariaDB 10.11 or greater or MySQL 8.4 or greater, and HTTPS. Test the upgrade on a staging copy first: an old plugin that fails on a new PHP version is easier to find there than on the live site.
3. Lock Down Logins and the Admin Area
- Require two-factor authentication for every administrator and editor. WordPress core does not include it; the Two Factor plugin is one option.
- Limit login attempts and slow down repeated failures.
- Disable XML-RPC if no service you use needs it.
- Keep the admin area off the open internet: allow it only from known networks or behind a client certificate.
- Do not use "admin" as a username, and stop exposing usernames through author archives.
- Give integrations their own application passwords, available since WordPress 5.6, instead of a person's login, so you can revoke one without touching the others.
On an nginx server, the web server can rate-limit the login page and close XML-RPC before a request reaches PHP. The example below uses Debian and Ubuntu paths; adjust the PHP-FPM socket to your version:
# In the http block: at most 5 login requests per minute per IP address
limit_req_zone $binary_remote_addr zone=wplogin:10m rate=5r/m;
# In the WordPress server block
location = /wp-login.php {
limit_req zone=wplogin burst=3 nodelay;
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php8.3-fpm.sock;
}
location = /xmlrpc.php {
deny all;
}4. Put a Web Application Firewall in Front
A web application firewall (WAF) blocks known exploit patterns before they reach PHP. Add rate limits for wp-login.php, xmlrpc.php and the REST API, and block requests that probe for files your site does not have.
If you run your own WAF, the open-source OWASP Core Rule Set has a WordPress rule exclusion plugin that reduces false alarms on the WordPress admin area. Managed WAFs and security plugins can also apply virtual patches: rules written for one specific vulnerability that block it before the vendor's fix arrives.
Know the limits. In a large-scale test of popular hosting companies, Patchstack found that only 26% of vulnerability attacks were blocked, and access control flaws in particular look like legitimate traffic. A WAF reduces risk; it does not replace updates and fewer plugins.
5. Manage Bots Instead of Only Blocking Them
robots.txt tells well-behaved crawlers what you prefer; it stops nothing. Anyone can put "Googlebot" in a user agent string, so check the address instead. Google's guide to verifying its crawlers describes two methods: a reverse DNS lookup that must return a name under googlebot.com, google.com or googleusercontent.com, followed by a forward lookup that must return the original IP address, or a comparison with the IP ranges Google publishes.
AI crawlers can be managed separately. OpenAI documents its crawlers as independent robots.txt settings: GPTBot collects content that may be used to train its models, while OAI-SearchBot decides whether a site can appear in ChatGPT search results, and both have published IP ranges. A site that wants to stay out of model training but remain visible in AI search could use:
User-agent: GPTBot
Disallow: /
User-agent: OAI-SearchBot
Allow: /Requests made on behalf of a person, such as ChatGPT-User fetching a page a user asked about, follow different rules: OpenAI states that robots.txt rules may not apply to them. Everything that claims to be a crawler but fails verification can be rate-limited or blocked at the server.
6. Harden the Server
Run a supported PHP version, set strict file permissions and disable file editing in the dashboard. The official WordPress hardening guide covers the basics. Two lines in wp-config.php close common gaps:
define( 'DISALLOW_FILE_EDIT', true );
define( 'FORCE_SSL_ADMIN', true );Also send security headers such as Content-Security-Policy and Strict-Transport-Security, keep the database user limited to the site's own database, and make sure backups and old copies of the site are not stored inside the public web folder.
7. Monitor, Back Up and Practice Recovery
- Watch for changed files and alert on new administrator accounts.
- Keep encrypted, off-site backups, keep more than one generation, and test a restore.
- Keep server and application logs long enough to investigate an incident that is found weeks later.
- Write down who does what when a site is compromised: isolate, clean, patch, rotate passwords, restore.
A backup that has never been restored is a hope, not a plan.
What to Do in the First Hour After a Compromise
- Take the site offline or into maintenance mode, so visitors and search engines do not receive malicious content.
- Copy the files, the database and the logs before you change anything; you will need them to find the way in.
- Change every password and key: administrator accounts, hosting, database, FTP or SFTP, API keys and the security keys in wp-config.php.
- Remove unknown administrator accounts, and check scheduled tasks and the must-use plugins folder for code you did not install.
- Replace WordPress core, plugins and themes with clean copies from their official sources, and restore content from a backup made before the compromise.
- Close the hole that was used, then watch the site and its logs closely for the following weeks.
A 30-Minute WordPress Security Check
- Update WordPress core, plugins and themes, and delete everything inactive.
- Check which PHP version the site runs, and plan the move if it is 8.2 or older.
- Turn on two-factor login for every administrator.
- Check that xmlrpc.php is blocked or rate-limited.
- Confirm the site forces HTTPS and sends a Strict-Transport-Security header.
- List the administrator accounts and remove any you do not recognize.
- Take one backup and restore it on a test copy.