Discuss your project

Web developmentLayer: Hosting and operations

WordPress security: how to protect your website from attacks

WordPress is the world's most used CMS and therefore a popular target for attacks. This article covers the measures that protect your website and what regular WordPress maintenance adds.

By Mathias ZiehengraserUpdated: 16 min read

Over 43% of all websites worldwide run on WordPress. That makes the open-source CMS the most widely used content management system and a favourite target for cyberattacks. In 2025 alone, over 90,000 attacks per minute on WordPress sites were recorded. If you run a WordPress website, you need to look after its security actively.

This article covers which threats are real and which measures keep your website secure in the long term. The basic principles of WordPress security apply to a company blog just as much as to a WooCommerce shop or a corporate portal.

The Most Common Types of WordPress Attacks

To protect yourself effectively, you need to know how attacks happen. The five most common attack vectors:

Attack TypeFrequencyDangerProtection
Brute-force loginVery commonMediumLogin limiter, 2FA, strong passwords
SQL injectionCommonVery highUpdates, WAF, prepared statements
Cross-site scripting (XSS)CommonHighSecurity headers, input validation
File inclusion (LFI/RFI)MediumVery highFile permissions, PHP hardening
Supply chain attacksIncreasingCriticalPlugin audits, monitoring

Supply chain attacks are hard to spot: a previously trustworthy plugin changes hands, and the new owner injects malicious code. In 2024, this affected several plugins with over 1 million active installations between them. Without monitoring, such attacks often go undetected for weeks.

The Right Update Strategy

Updates are the single most important measure for WordPress security. Updating everything without checks falls short, though. A good update strategy looks at both stability and security:

  • Security patches immediately: When a security update appears for a plugin or WordPress core, apply it within 24 to 48 hours. Exploit code is often published within hours of a vulnerability becoming known.
  • Feature updates with staging: Test major version jumps (e.g. WordPress 6.x to 7.x) in a staging environment first to catch incompatibilities.
  • Check plugin compatibility: Create a complete backup before every update and read the compatibility notes. With WooCommerce shops in particular, an incompatible update can bring the entire ordering process to a halt.
  • Enable automatic minor updates: WordPress offers automatic updates for minor releases (e.g. 6.5.1 to 6.5.2). Keep them enabled, as they mainly contain security fixes.
  • Remove unused plugins: Deactivated plugins are a risk too, because their code is still on the server and can be exploited. Delete what you do not use.

In our maintenance work, updates always follow the same sequence: backup, staging test, live update, function test. This keeps the risk of downtime low.

Backup Strategy: The Last Safeguard

A backup does not prevent an attack. If every other measure fails, though, it decides whether you restore your website in hours or spend weeks rebuilding it from scratch.

A professional backup strategy includes:

  • Daily automatic backups: Back up the database and file system separately. For shops with more than 50 orders a day, we recommend hourly database backups.
  • External storage location: Backups on the same server as the website are worthless if the server is compromised. Store backups with a separate cloud provider (AWS S3, Google Cloud Storage or a specialist backup service).
  • Retention strategy: Keep daily backups for 30 days and monthly backups for 12 months. That way you still have a clean version if malware only becomes active weeks after infection.
  • Regular restoration tests: Only a test shows whether a backup can be restored. Test restores at least quarterly on a test environment.

WordPress Hardening: Ten Measures

WordPress hardening means systematically securing a WordPress installation beyond the default configuration. We implement these ten measures on every website we look after:

  1. Disable file editor: define('DISALLOW_FILE_EDIT', true); in wp-config.php stops anyone editing PHP code through the dashboard.
  2. Change login URL: The default URL /wp-admin is known to every attacker. A custom login URL reduces automated brute-force attacks by over 90%.
  3. Two-factor authentication (2FA): Even with a stolen password, nobody gets in without the second factor. 2FA is mandatory for all administrators and editors.
  4. Limit login attempts: After 5 failed attempts, we block the IP for 30 minutes; after 3 lockouts, for 24 hours.
  5. Disable XML-RPC: Most current applications no longer need the XML-RPC interface, which still offers an attack surface for DDoS amplification and brute-force attacks.
  6. Set HTTP security headers: Content-Security-Policy, X-Frame-Options, Strict-Transport-Security, and Permissions-Policy protect against XSS, clickjacking, and downgrade attacks.
  7. Change database prefix: Instead of the default prefix wp_, use a custom prefix to make automated SQL injection attacks more difficult.
  8. Harden file permissions: Directories to 755, files to 644, wp-config.php to 440. Also protect .htaccess and wp-config.php from direct access.
  9. Block user enumeration: The default API (?author=1) reveals usernames. Block this lookup so attackers cannot collect names for targeted brute-force attacks.
  10. Enforce SSL/TLS: HTTPS has been standard for years and is a ranking factor for SEO. Enforce HTTPS for the entire website, including the admin area and API calls.

Misconfigured security settings can break your website, so it is worth having specialists help with the implementation.

If your existing site is already weighed down by page builders, old plugins or poor hosting, a technical relaunch through our WordPress agency is sometimes more economical than one repair after another.

Site Protect: Proactive Protection for WordPress

Only reacting to attacks is not enough. We therefore rely on protection that stops attacks before they cause damage.

Our Site Protect approach includes:

  • Virtual Patching: The WAF (Web Application Firewall) blocks known vulnerabilities before an official update is available. This matters most for zero-day exploits the plugin developer has not yet responded to.
  • IP blocking & geo-fencing: We block IPs that show malicious behaviour automatically. If your business serves only specific markets, whole regions can be blocked as well.
  • User enumeration protection: We block the known ways of reading usernames via the REST API, author archives and oEmbed endpoints.
  • Real-time malware scanning: We check all files continuously for known malware signatures and suspicious code patterns. Alerts go straight to our team.
  • Integrity monitoring: We compare current files with the original versions from the WordPress repository and detect any unauthorised change immediately.
  • Login protection with brute-force detection: Brute-force detection goes beyond simple login limiters. Even if a botnet spreads the attack across thousands of IPs, our system still recognises the pattern.

We offer virtual patching and security monitoring for WordPress websites through our own maintenance service, websitewartung.at (external link, opens in a new tab), together with updates and backups.

GDPR and WordPress Security

Data security and data privacy are closely linked. The GDPR requires “appropriate technical and organisational measures” to protect personal data. For WordPress operators, this specifically means:

  • Encryption: SSL/TLS is mandatory for the entire website, including pages without forms.
  • Data processing agreements: Conclude a DPA with every service provider that has access to personal data (host, CDN provider, email service).
  • Data minimisation: Collect only the data you need. Every extra contact form field adds GDPR obligations.
  • Breach notification obligation: If a hack exposes personal data, you must report it to the responsible authority within 72 hours. Without monitoring, you may not even notice that data has leaked.
  • Cookie consent: Technically unnecessary cookies (analytics, marketing) may only be set after explicit consent. Consent must be documented and revocable.

If customer data leaks from a hacked WordPress shop, you face reputational damage and GDPR fines of up to 4% of annual turnover.

Note: We are a technical service provider, and this overview is not legal advice. For specific GDPR questions, DPAs and documentation obligations, consult a lawyer who specialises in data protection law.

WordPress Maintenance: Do It Yourself or Outsource?

Whether you need a maintenance contract or can handle it yourself depends on your risk profile:

CriterionDIYProfessional Maintenance
Time investment/month4 to 8 hours0 hours (for you)
Update speedWhen you rememberWithin 24 to 48 hours
Backup reliabilityVariableCommitted & tested
Security monitoringManual / occasional24/7 automated
Response time if hackedHours to days< 4 hours
Virtual PatchingNot availableYes, until the update
Staging environmentRarely availableStandard
Costs€0 (plus your time)Depends on the site's scope

For a personal blog or a simple portfolio site, self-maintenance may be sufficient, provided you take the time for it. For business-critical websites, especially shops that handle customer data, professional WordPress maintenance keeps day-to-day operations secure.

A worked example: if your shop makes €5,000 a day and a security incident takes it offline for two days, you lose €10,000 in revenue, plus recovery costs and reputational damage. Professional maintenance costs a fraction of that per year.

WordPress Security Needs Ongoing Care

Threats change constantly, and your protective measures have to keep up. We offer WordPress maintenance with updates, backups, monitoring and virtual patching through our own service, websitewartung.at. If a relaunch or a new WordPress website is on the cards, let's talk about your project.

Discuss your project

Frequently asked questions

How secure is WordPress?

WordPress core is fundamentally secure and maintained by a dedicated security team. Most security problems arise outside the core: from outdated plugins, weak passwords or poor server configuration.

What are the most common WordPress attacks?

The most common attacks are brute-force attacks on the login, SQL injection via insecure plugins, cross-site scripting (XSS), file inclusion attacks and exploitation of known vulnerabilities in outdated plugins or themes.

How often should I update WordPress?

Check WordPress core, plugins and themes for updates at least weekly, and apply security patches within 24 to 48 hours. With a maintenance contract, someone takes this on for you with a firm commitment.

What is Virtual Patching?

Virtual patching is a WAF (Web Application Firewall) technique that blocks known vulnerabilities at network level before an official plugin update is available. This protects you even against zero-day exploits.

Do I need a security plugin?

A security plugin such as Wordfence or Sucuri is recommended but does not replace professional maintenance. It provides a firewall, malware scanner and login protection as a first line of defence.

What does WordPress maintenance cost?

Costs depend on the website's scope and the services you need. For WordPress websites there is our own maintenance service, websitewartung.at, with fixed plans for updates, backups, monitoring and protection against known vulnerabilities.

What should I do if my site is hacked?

Take the website offline immediately, restore a clean backup and change all passwords. Then identify and fix the root cause, and request a review from Google if the site has been blocklisted.

Is WordPress GDPR compliant?

WordPress itself is GDPR-neutral; compliance depends on configuration. That covers SSL encryption, cookie consent, a privacy policy, data processing agreements with hosts, and avoiding US services without EU data transfer guarantees.

What is WordPress hardening?

WordPress hardening means systematically securing the WordPress installation, for example by disabling the file editor, limiting login attempts, changing the database prefix, setting secure file permissions and adding HTTP security headers.

How does a backup strategy work?

A solid backup strategy includes daily automatic backups (database and files), storage at an external location, regular restore tests and a clear retention policy (e.g. daily backups kept for 30 days, monthly backups for 12 months).

Should I disable the theme editor?

Yes. The built-in WordPress theme and plugin editor lets attackers who gain dashboard access execute PHP code directly. One line in wp-config.php (DISALLOW_FILE_EDIT) closes this gap.

Professional maintenance or DIY?

For business-critical websites we recommend professional maintenance. You save time, avoid update errors, get committed response times (we reply within 24 hours on business days) and ongoing security monitoring. For simple blogs, maintaining the site yourself may be enough.