Where WordPress Attacks Really Come From
Understanding the threats helps you spend effort where it counts. Patchstack's State of WordPress Security in 2026 report, as summarized by Heart Internet, recorded 11,334 new vulnerabilities in the WordPress ecosystem during 2025, a 42% increase on the previous year. Ninety-one percent were in plugins and 9% in themes, with only six reported in WordPress core, all low risk.
The practical lesson is clear: most of your security effort belongs on the plugins and themes you add, and on keeping them updated.
The most common attack routes are:
- Known vulnerabilities in outdated plugins and themes
- Automated login attempts using weak or reused passwords
- Nulled (pirated) plugins and themes that arrive with malware included
- Compromised hosting accounts or other sites on the same account
- Too many users with administrator access
Step 1: Keep Everything Updated

Updates fix security holes. Apply them promptly.
- WordPress core: minor security releases update automatically by default. Apply major releases after a quick check on staging for important sites.
- Plugins and themes: enable automatic updates for well-maintained plugins you trust, and check others weekly.
- PHP: keep your PHP version current through your host. WordPress recommends PHP 8.3 or greater.
- Remove what you do not use. Deactivated plugins and unused themes can still be exploited if their files remain.
Before major updates, take a backup. See how to back up WordPress. For business-critical sites, test major updates on a staging copy first, then apply them to the live site once you know nothing breaks.
Step 2: Lock Down Logins
Automated bots try thousands of username and password combinations on WordPress sites every day.
- Use strong, unique passwords generated by a password manager for every account.
- Turn on two-factor authentication (2FA) for every administrator and editor. Wordfence, All-In-One Security and other plugins add it for free.
- Limit login attempts so repeated failures are blocked.
- Avoid obvious usernames such as "admin."
- Log out of shared computers and do not save passwords in shared browsers.
Two-factor authentication is one of the most effective protections you can add, because a stolen or guessed password is no longer enough to log in.
Step 3: Give Users Only the Access They Need
WordPress has built-in roles with different permissions:
| Role | Can do |
|---|---|
| Administrator | Everything, including installing plugins and managing users |
| Editor | Publish and manage all content |
| Author | Publish and manage their own posts |
| Contributor | Write posts but not publish |
| Subscriber | Manage their own profile |
Give each person the lowest role that lets them do their job. Review users regularly and remove accounts for people who no longer need access. Every administrator account is another way in.
Step 4: Choose Secure Hosting
Good hosting blocks many attacks before they reach WordPress. Look for:
- Account isolation, so one compromised site cannot affect others
- Server-level firewall and malware scanning
- Automatic backups stored off the server
- Current PHP and database versions
- Free SSL and HTTPS by default
- Malware removal included or available
Managed WordPress hosts often include most of these. WPX, for example, includes free malware removal. See managed WordPress hosting and best WordPress hosting.
Step 5: Install One Security Plugin
A security plugin adds a firewall, malware scanning and login protection inside WordPress.
| Plugin | Free version | Strength |
|---|---|---|
| Wordfence | Firewall, scanner, 2FA (rules delayed 30 days) | Most complete free option |
| All-In-One Security | Firewall, login protection, hardening | Detailed hardening controls |
| MalCare | Off-server scanning | No scan load on your server |
| Sucuri | Monitoring and remote scan | Cloud firewall and cleanup on paid plans |
Install only one full security suite; two can conflict. See the best WordPress security plugins for detail.
Step 6: Add a Web Application Firewall
A web application firewall (WAF) filters malicious traffic. There are two kinds:
- Endpoint firewalls run inside WordPress, such as Wordfence's firewall.
- Cloud firewalls filter traffic before it reaches your server, such as Cloudflare or Sucuri. They also absorb traffic floods and can speed up your site with caching.
Cloudflare's free plan adds basic DDoS protection and a firewall. See best CDN for WordPress for setup.
Step 7: Use HTTPS Everywhere
HTTPS encrypts data between visitors and your site, protecting logins and form submissions. Most hosts provide free SSL certificates.
- Enable SSL in your hosting dashboard.
- Update both addresses under Settings → General to https://.
- Redirect all HTTP traffic to HTTPS, usually a setting at your host or in your SEO or security plugin.
- Fix any mixed content warnings by updating old http:// links to images and scripts.
Step 8: Harden WordPress Settings
These changes reduce attack surface. Many security plugins can apply them for you.
- Disable file editing in the dashboard so attackers who get in cannot edit theme or plugin code. Security plugins often offer this, or developers can add the DISALLOW_FILE_EDIT setting to wp-config.php.
- Protect wp-config.php, which holds database credentials, with correct file permissions.
- Use correct file permissions, commonly 755 for folders and 644 for files, as your host recommends.
- Disable XML-RPC if you do not use apps or services that need it, since it is a common target for login attempts.
- Turn off directory browsing so visitors cannot list folder contents.
- Hide WordPress version numbers from page source, a minor step that reduces information for automated scans.
Step 9: Back Up Regularly
Backups are your safety net if every other layer fails. Schedule automatic backups that include files and database, and store copies off your server. See how to back up WordPress and the best backup plugins.
Step 10: Install Plugins and Themes Safely
- Use reputable sources: WordPress.org or well-known commercial vendors.
- Never use nulled plugins or themes, which are pirated copies that frequently contain malware.
- Check maintenance: recent updates, compatibility with your WordPress version and active support.
- Prefer fewer, well-built plugins over many single-purpose ones.
- Consider vulnerability monitoring, such as Patchstack, which alerts you when software on your site has a known vulnerability and can apply virtual patches on paid plans.
Step 11: Monitor Your Site
Early detection limits damage.
- Run regular malware scans with your security plugin or host.
- Enable alerts for administrator logins, new users and file changes.
- Check Google Search Console for security issue warnings.
- Use uptime monitoring to know quickly if the site goes down.
- Review activity logs if your security plugin provides them.
Step 12: Protect Forms and Comments From Spam
Spam is not always a security breach, but it wastes time, can hurt your reputation and is sometimes used to spread malicious links.
- Use an anti-spam plugin or service for comments and forms, such as Akismet or your form plugin's built-in protection.
- Add CAPTCHA or honeypot fields to contact and registration forms. Honeypots are invisible to people but trap bots.
- Close comments on old posts if they attract mostly spam, under Settings → Discussion.
- Disable user registration unless you need it, under Settings → General, and set the default role to Subscriber if you do allow it.
- Moderate first comments so links from new commenters do not appear until approved.
Step 13: Share Access Safely With Freelancers and Teams
Many sites are hacked through accounts created for a one-off job and never removed.
- Create a separate account for each person rather than sharing logins.
- Use the lowest role that lets them do the job, and upgrade only if needed.
- Set an end date and remove or downgrade the account when the work is done.
- Share hosting access through your host's team features where available, instead of your main password.
- Use a password manager's sharing feature if you must share a credential, and change it afterward.
- Ask developers to work on staging for major changes.
How a Typical Plugin Vulnerability Plays Out
It helps to understand why speed matters with updates. A common sequence looks like this:
- A security researcher finds a flaw in a plugin and reports it privately to the developer.
- The developer releases a fixed version, often describing it simply as a security update.
- The vulnerability is published in security databases so site owners know to update.
- Attackers write automated scripts that search the web for sites still running the old version.
- Sites that have not updated are compromised, sometimes within days of publication.
The window between steps 3 and 5 is where most damage happens. Automatic updates for trusted plugins, or a weekly update routine, close that window. Vulnerability monitoring services such as Patchstack add another layer by alerting you to problems in software you use and, on paid plans, applying virtual patches that block exploits before you can update.
Choosing Plugins With Security in Mind
Before installing any plugin, spend two minutes checking:
- Last updated date: plugins updated within the last few months are more likely to be maintained.
- Active installations and ratings: popular plugins attract more scrutiny, which helps find and fix issues.
- Support forum activity: are questions answered, and are security reports handled promptly?
- Compatibility: is it tested with your WordPress version?
- Need: could your theme, another plugin you already use or a few lines in your theme's settings do the same job?
Fewer, well-maintained plugins mean fewer places for vulnerabilities to appear.
Security Headers Explained
Security headers are instructions your server sends to browsers, telling them how to handle your site's content. They are a hardening step for intermediate users, often set by your host, a security plugin or a CDN such as Cloudflare.
| Header | What it helps prevent |
|---|---|
| Strict-Transport-Security (HSTS) | Browsers loading your site over insecure HTTP |
| X-Content-Type-Options | Browsers guessing file types in unsafe ways |
| X-Frame-Options or frame-ancestors | Your site being embedded in other sites for clickjacking |
| Referrer-Policy | Leaking full URLs to other sites |
| Content-Security-Policy | Loading scripts from unapproved sources |
Add these carefully and test afterward. A strict Content-Security-Policy in particular can break plugins, embeds and analytics if it is not configured for your site.
Overrated Security Tweaks
Some popular tips offer little real protection. They are not harmful, but do not let them replace the essentials:
- Changing the database table prefix on an existing site adds risk during the change and offers minimal protection.
- Hiding that you use WordPress is difficult and does not stop automated attacks, which simply try common WordPress paths.
- Blocking entire countries can reduce noise but also blocks legitimate visitors and is easily bypassed.
- Installing several security plugins creates conflicts and server load without adding meaningful protection.
Security by Site Type
Blogs and content sites need the basics done well: updates, strong logins with 2FA, a security plugin and off-site backups. Keep plugin counts low.
Business websites should add uptime monitoring and a cloud firewall, since downtime affects enquiries and reputation.
Online stores handle customer data and payments. Use reputable payment gateways so card details never touch your server, keep frequent backups, consider a premium firewall and test updates on staging first.
Membership and course sites have many user accounts. Enforce strong passwords, limit login attempts, protect registration forms from bots and review user roles regularly.
Agencies and freelancers managing client sites benefit from central dashboards that handle updates, backups and vulnerability alerts across many sites, and from consistent security standards for every client.
A 15-Minute Weekly Security Routine
- Apply pending updates after checking your latest backup exists.
- Review your security plugin's scan results and alerts.
- Check the Users page for unexpected accounts.
- Glance at uptime and Search Console for warnings.
- Confirm backups ran and were sent to remote storage.
Fifteen minutes a week catches most problems early, before they become emergencies.
Security Checklist
| Area | Action | How often |
|---|---|---|
| Updates | Update core, plugins, themes | Weekly, or automatic |
| Logins | Strong passwords and 2FA for all admins | Once, then enforce |
| Users | Review roles and remove old accounts | Quarterly |
| Plugins | Remove unused plugins and themes | Monthly |
| Backups | Automatic, off-site, tested | Daily or weekly; test twice a year |
| Scanning | Malware scan and review results | Weekly |
| Hosting | Current PHP, isolation, firewall | Check yearly |
| HTTPS | Valid certificate and redirects | Check after changes |
Signs Your Site Has Been Hacked
- Visitors are redirected to unfamiliar sites, sometimes only from search results or on mobile
- Unknown administrator accounts appear
- Spam pages or strange keywords show up in search results for your domain
- Browsers or Google show security warnings
- Your host reports malware or suspends the account
- New files appear in uploads or theme folders
- Server usage or outgoing email spikes without explanation
What to Do If You Are Hacked
- Stay calm and act quickly. Put the site into maintenance mode if you can.
- Contact your host. Many hosts help with cleanup, and some, such as WPX, include free malware removal.
- Restore a clean backup from before the infection, or use a professional cleanup service such as Sucuri or MalCare's paid plans.
- Update everything: WordPress, plugins, themes and PHP.
- Remove unused plugins and themes, and any you do not recognize.
- Change all passwords: WordPress users, hosting, database, FTP and email.
- Review user accounts and remove unknown administrators.
- Scan again to confirm the site is clean.
- Request a review in Google Search Console if Google flagged the site.
- Find the cause, usually an outdated plugin, and fix it so it does not happen again.
Security Myths to Ignore
- "My site is too small to be targeted." Most attacks are automated and hit every site they find.
- "A security plugin makes me safe." It helps, but updates, passwords and hosting matter more.
- "Changing the login URL is enough." It reduces noise, but strong passwords and 2FA are what stop attacks.
- "Premium plugins are always safer." Quality varies; maintenance and track record matter more than price.
Final Word
WordPress security comes down to a few habits: update promptly, protect logins with strong passwords and two-factor authentication, choose good hosting, install one security plugin, keep off-site backups and remove what you do not use. Put those in place and you avoid the vast majority of attacks. For tools, see the best WordPress security plugins, and for the full routine, the WordPress maintenance checklist.
Frequently Asked Questions
Is WordPress Secure?
WordPress core is maintained by a large security team and updated regularly. Most problems come from outdated or poorly maintained plugins and themes, weak passwords and insecure hosting. Keeping everything updated and following basic practices makes a WordPress site much safer.
What Is the Most Important WordPress Security Step?
Keeping WordPress, plugins and themes updated is the single most important step, because most attacks target known vulnerabilities in outdated software. Strong passwords with two-factor authentication come next.
Do I Need a Security Plugin?
A security plugin adds a firewall, malware scanning and login protection that most sites benefit from. Wordfence's free version is a common choice. Good hosting with server-level protection reduces how much you rely on a plugin.
How Do I Know If My WordPress Site Has Been Hacked?
Common signs include unexpected redirects, unknown admin users, spam pages in search results, warnings from Google or browsers, new unfamiliar files and sudden spikes in server usage or outgoing email.
Should I Change the WordPress Login URL?
Changing the login URL can reduce automated login attempts and log noise, but it is not a substitute for strong passwords, two-factor authentication and login limits. Treat it as an optional extra.
What Should I Do If My WordPress Site Is Hacked?
Put the site into maintenance mode if possible, restore a clean backup from before the hack or use a professional cleanup service, then update everything, remove unused plugins, change all passwords and review user accounts.
Want Security Handled at the Server? WPX Includes Free Malware Removal on Its WordPress Hosting Plans
Check the current plans, site limits and refund terms on the official WPX website.
See WPX Plans