WordPress Security in 2026: The 10 Attacks You Need to Know
WordPress powers 43% of all websites. That makes it the world's most popular CMS — and the world's biggest target for hackers.
But the attacks in 2026 look different than 2-3 years ago. Brute force against wp-login is still a thing, but the truly dangerous attacks have become more sophisticated. Supply chain attacks via compromised plugins. AI-generated phishing emails that look like official WordPress notifications. Formjacking that steals credit card data directly from your checkout.
This guide covers the 10 most relevant attack types in 2026 — and what you specifically do to protect yourself.
This is not a beginner's guide
This guide assumes you already have a security plugin installed and keep WordPress updated. If you're missing the basics, start with The 8 Best Security Plugins for WordPress.
Attack 1: Supply chain attacks via plugins
What it is
Instead of attacking your site directly, hackers compromise a popular plugin. When you (or your auto-update system) update the plugin, you install the malware yourself.
In 2024-2025, we saw several major cases:
- Social Warfare (60,000+ installs) — malicious code injected in an update
- AccessPress Themes (360,000+ sites) — backdoor in 40+ themes and plugins
- Several premium plugins sold to new owners who added tracking and malware
Why it's dangerous
You do everything right — stay updated, have strong passwords, use 2FA — and still get compromised because you trust a third party.
How to protect yourself
- Limit plugin count — every plugin is a potential attack vector. 20 plugins = 20 risks
- Check plugin ownership — has the plugin changed owners recently? Be skeptical
- Use Patchstack — monitors known vulnerabilities and blocks attacks before you update
- Staged updates — test updates on staging before production
- Enable WordPress auto-update only for core — plugins should be updated manually after verification
Patchstack is free
Patchstack offers a free plan that monitors your plugins and alerts you to known vulnerabilities. It's the most important free security measure you can take in 2026.
Attack 2: AI-driven credential stuffing
What it is
Classic brute force tries random passwords. AI-driven credential stuffing is smarter: It uses leaked passwords from other sites, combined with AI that predicts password variations.
Example: If your password was Summer2024! on LinkedIn (which was leaked), the AI automatically guesses Summer2025!, Summer2026!, Summ3r2024!, etc.
How to protect yourself
- Unique password per site — use a password manager (Bitwarden, 1Password)
- 2FA is mandatory — not optional, not just for admin, but for all user roles
- Limit login attempts — max 5 attempts, then lockout for 15+ minutes
- Hide wp-login — move login URL with WPS Hide Login or similar
- Passkeys — WordPress 6.8 supports passkeys natively. Use them
Attack 3: Formjacking
What it is
Malicious JavaScript is injected into your checkout or contact form. The code intercepts data (credit cards, personal information) and sends it to the attacker's server — without the user or you noticing.
Why it's dangerous
- The user completes their purchase normally — no errors, no warnings
- You typically discover it only when customers complain about fraud
- GDPR fines for data breaches can be massive
How to protect yourself
- Content Security Policy (CSP) — restrict which scripts can run on your site
- Subresource Integrity (SRI) — verify that external scripts haven't been modified
- File change monitoring — Wordfence and Sucuri can alert on changed files
- Use Stripe/hosted checkout — let the payment provider handle card data so it never touches your server
# Example CSP header in nginxadd_header Content-Security-Policy "default-src 'self'; script-src 'self' https://js.stripe.com; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; connect-src 'self' https://api.stripe.com;" always;Attack 4: XML-RPC abuse
What it is
XML-RPC (xmlrpc.php) is an old API in WordPress that allows remote publishing. The problem: It also allows mass authentication — an attacker can test hundreds of passwords in a single request.
How to protect yourself
Disable XML-RPC completely unless you specifically use it:
// Disable XML-RPCadd_filter('xmlrpc_enabled', '__return_false'); // Or block at server level (nginx)location = /xmlrpc.php { deny all; return 403;}Attack 5: REST API information disclosure
What it is
WordPress REST API exposes usernames by default via /wp-json/wp/v2/users. An attacker can retrieve all usernames and then focus brute force on known accounts.
How to protect yourself
// Restrict user endpoint to authenticated usersadd_filter('rest_endpoints', function($endpoints) { if (!is_user_logged_in()) { unset($endpoints['/wp/v2/users']); unset($endpoints['/wp/v2/users/(?P<id>[\d]+)']); } return $endpoints;});Attack 6: Privilege escalation via plugin vulnerabilities
What it is
A vulnerability in a plugin lets an attacker upgrade a Subscriber account to Administrator. In 2025, several major plugins had this type of vulnerability (Ultimate Member, User Role Editor).
How to protect yourself
- Remove unused user accounts — especially old Subscriber/Contributor accounts
- Audit user roles regularly — do all users have the minimum necessary role?
- Use capability-based access control — not just role checks
- Keep plugins updated — and follow Patchstack/WPScan for advisories
Attack 7: Malicious redirects via .htaccess
What it is
Attackers modify .htaccess (Apache) or inject redirect code into wp-config.php to send your visitors to spam/phishing sites. Often only on mobile devices or from specific referrers (Google) — so you as the owner don't notice.
How to protect yourself
- File integrity monitoring — Wordfence/Sucuri alert on changes to .htaccess and wp-config.php
- Correct file permissions —
.htaccess: 644,wp-config.php: 440 or 400 - Regular malware scanning — at least weekly
- Check yourself from mobile — visit your site via Google on a phone regularly
Attack 8: Brute force against wp-cron.php
What it is
wp-cron.php is publicly accessible and executes on every page visit. Attackers can overload it with requests and cause DDoS-like effects.
How to protect yourself
// Disable wp-cron via browser (wp-config.php)define('DISABLE_WP_CRON', true);And use a real cron job instead:
# Server crontab — run every 5 minutes*/5 * * * * curl -s https://yoursite.com/wp-cron.php?doing_wp_cron > /dev/null 2>&1Attack 9: SEO spam injection
What it is
Hackers inject hidden links and pages into your WordPress database — typically for casino, pharma, or adult sites. The pages are invisible to you but indexed by Google, and your site gets penalized for spam.
Signs to look for
- Google Search Console shows unknown pages in the index
- Strange Japanese/Chinese characters in search results
- Sudden drop in organic traffic
- Unknown users in WordPress admin
How to protect yourself
- Monitor Google Search Console — check "Pages" and "Manual actions" weekly
- Database scanning — Wordfence scans for injected content in posts and options
- Limit user registration — disable open registration: Settings → General → unchecked
Attack 10: Dependency confusion in build pipelines
What it is
If you use npm/Composer in your WordPress workflow, attackers can publish packages with identical names to your private registry. The build system fetches the malicious package instead of yours.
How to protect yourself
- Lock your dependencies — use
composer.lockandpackage-lock.json - Use scope/namespace —
@yourcompany/package-nameprevents confusion - Pin versions — avoid
^and~in production - Audit regularly —
npm auditandcomposer audit
The prioritized security checklist
Password manager + 2FA for all users
The absolute most important. A weak password trumps all other security. Use Bitwarden (free) and enable 2FA for all WordPress users.
Install Patchstack (free)
Monitors all your plugins for known vulnerabilities and alerts you before it's too late.
Disable XML-RPC and restrict REST API
Remove two attack surfaces with a few lines of code.
Content Security Policy
Restrict which scripts can run. Prevents formjacking and XSS.
File permissions and monitoring
Correct permissions + alerts on changes to critical files.
Staged updates
Test all updates on staging. Have a rollback plan.
Backup 3-2-1 rule
3 copies, 2 media types, 1 offsite. Test restore regularly.
Conclusion
WordPress security in 2026 isn't about paranoia — it's about understanding that the threat landscape has changed. Attackers use AI, automation, and supply chain attacks that are fundamentally different from classic brute force.
The good news: Most attacks can be prevented with relatively simple measures. 2FA, Patchstack, CSP, and sound plugin hygiene cover 95% of threats.
The bad news: Most WordPress sites still have none of these.
Need a security audit?
I review your WordPress site for vulnerabilities and implement the necessary security measures. Book a free consultation and let's secure your site.




