Skip to content
TatiCreative
All articles

· 8 min read · Mert Tati

WordPress DDoS Protection: How to Keep Your Site Online Under Attack (2026)

How to protect WordPress from DDoS: volumetric vs. application-layer floods, the CDN layer, rate limiting, blocking fake Googlebots and an emergency plan.

Short answer: protecting WordPress from DDoS attacks takes two separate layers. Volumetric attacks that exhaust connections and bandwidth must be absorbed at the CDN or hosting level (Cloudflare, for example) before they ever reach your server; no WordPress plugin can stop them on its own. Application-layer floods, which choke PHP with expensive requests such as search, forms, 404s and XML-RPC, need per-IP rate limiting, fake search bot blocking and a time-limited emergency mode on the WordPress side.

A protected lane through a massive crowd, DDoS traffic

What is a DDoS attack, and why are WordPress sites targeted?

A DDoS (distributed denial of service) attack floods a site with requests or traffic from many different sources until it can no longer respond to real visitors. WordPress sites are especially vulnerable because every request that isn't served from cache runs PHP and hits the database. On shared hosting or a small VPS, only a limited number of PHP workers can run at once; once they're tied up with expensive requests, the site locks up without the attacker ever sending “big” traffic.

Not every slowdown is an attack. A heavy theme, a bloated database or broken caching cause the same symptoms, so rule those out first using the steps in our website speed and Core Web Vitals guide.

Types of DDoS: network layer or application layer?

To put your defenses in the right place, you first need to know which layer the attack is hitting:

  • Volumetric attacks: UDP floods, reflection and amplification attacks that try to saturate your bandwidth. By the time they reach the server it's too late; they can only be stopped at the network and CDN layer.
  • Protocol attacks: attacks like SYN floods that exhaust connection tables and network hardware. These are also handled at the operating system, firewall and provider level; they never reach PHP.
  • Application-layer (HTTP/L7) attacks: HTTP requests that look completely “normal.” Thousands of search queries, 404 floods probing nonexistent URLs, form submissions, xmlrpc.php requests, fake crawlers posing as Googlebot. The traffic volume may be small, but every request runs PHP and the database.

The honest limit is this: WordPress only kicks in once a request reaches PHP. A plugin cannot stop a network-layer attack or a flood that never reaches PHP. What a plugin can do is reject expensive application-layer requests as early and as cheaply as possible, and alert you that an attack is underway.

Layer 1: CDN and hosting (for volumetric attacks)

If your site sits behind a CDN like Cloudflare, visitors connect to the CDN's edge servers rather than your server, and volumetric attacks are absorbed there. When setting up this layer, keep the following in mind:

  • Your server's real IP address must not be exposed. Make sure your DNS records are proxied; an old subdomain or mail record can give away your origin IP.
  • If possible, have the origin server accept web traffic only from the CDN's IP ranges. This is configured in the server firewall.
  • Ask your hosting provider in advance whether they offer network-level DDoS protection and what they do during an attack. Some providers temporarily take a site under attack offline.
  • Cloudflare's “Under Attack” mode puts visitors through a browser check lasting a few seconds, so bots never reach PHP. Turn it on during an attack and switch back to your previous level when it's over.

Server, CDN and firewall configuration is not a plugin's job. If you want this layer set up on your own infrastructure, we can plan it together as part of our software and hosting service.

Layer 2: rate limiting inside WordPress (for the application layer)

Dam releasing water in a controlled flow, traffic protection

A CDN can't recognize every HTTP request as an attack: a search query or form submission might be perfectly legitimate. To manage the expensive requests that do reach WordPress, a good rate limiter should:

  • Count cost, not requests: a page served from cache is almost free, while search, form submissions, xmlrpc and 404s are expensive. Scoring each request by its cost and giving every IP a per-minute budget catches bots without touching real visitors.
  • Respond correctly: return a 429 (Too Many Requests) with a Retry-After header to any IP that exceeds its budget, for a few minutes. That response must not be cached, or the block will spill over to other visitors.
  • Run early: if the check doesn't happen before the theme and plugins load, even rejected requests will wear the server down.
  • Count without writing to the database: writing a counter to the database on every request during a flood turns your protection into part of the load. Shared memory (APCu) is ideal for this.
  • Separate fake search bots: a request claiming to be Googlebot or Bingbot should be verified against Google's and Bing's official IP lists. Real bots should be exempt from the budget so your SEO doesn't suffer.
  • Never block checkout: WooCommerce checkout and payment gateway callbacks must never receive a 429 under any circumstances.
  • Get the real IP behind Cloudflare: your server only sees Cloudflare's address. The visitor's IP should be read from the Cloudflare header, but only if the request really comes from Cloudflare's network.

What to do during an attack: emergency steps

  • Is it really an attack, or just a slowdown? Check your server access logs for the same IPs, the same URLs or the same User-Agent piling up.
  • If you use a CDN, turn on “Under Attack” or a similar challenge mode.
  • Temporarily tighten the budget on the WordPress side; use a time-limited mode so you don't forget to switch back when you're done.
  • Identify the URL the attack is targeting: if you don't use xmlrpc.php, disable it; if the search page is the target, rate-limit search.
  • Notify your hosting provider; if there's a network-layer attack, only they can step in.
  • Once the attack is over, review the logs and add your own tools (monitoring services, integrations) to the allowlist.

DDoS attacks usually aim to take a service down, not to steal data. If you find files or users you don't recognize after an attack, you're dealing with a different incident; see our guide on what to do when your WordPress site is hacked.

The application layer with Hushfort Load Protection

The Load Protection module in the Hushfort WordPress security plugin implements the second layer described above. Each IP gets a per-minute point budget: a page costs 1 point, AJAX 1-2, REST 2-3, add to cart 3, search and form submissions 5, and xmlrpc 10; when an IP probes nonexistent URLs, each 404 costs an extra 4 points. Pages served from cache aren't counted. An IP that exceeds its budget gets an uncached 429 with a Retry-After header for as long as you configure.

  • The check runs in an early layer the plugin installs, before the theme and plugins load; counters are kept in APCu when the server has it, so there are no database writes per request. A “Where protection runs” indicator shows whether these are actually active on your site.
  • The fake Googlebot/Bingbot block works with Google's and Bing's official IP lists, which are refreshed once a day; real search bots are exempt from the budget.
  • WooCommerce checkout and payment gateway callbacks always go through, even from a banned IP.
  • The module starts in trial mode: for a few days it only logs, and if no real visitors show up in the log, you switch it to “Protect” mode. Addresses on the allowlist are never blocked.
  • Emergency mode cuts the budget to a quarter and switches itself off after the time you set. If you've entered a Cloudflare API key and Zone ID, it also turns on Cloudflare's “Under Attack” mode and restores your previous security level when it ends.
  • Alert email: if a number of IPs you define get blocked within 10 minutes, it notifies you, at most once an hour.

Hushfort does not stop network-layer attacks, and it says so plainly in its own dashboard: in a large attack, the CDN is your main shield. The plugin's job is to keep PHP workers from being wasted on expensive requests, bring Cloudflare in automatically and alert you in time. For bot traffic that arrives together with fake sign-up floods, see our guide to fake user registrations and bot traffic, and for the big picture read how to secure a WordPress site.

DDoS readiness checklist

  • The site is behind a CDN and the origin IP is not exposed.
  • You know your hosting provider's network-level DDoS policy.
  • Page caching works; most visitors never reach PHP.
  • WordPress has a per-IP, cost-based rate limit, tested first in trial mode.
  • Fake search bots are filtered out using official IP lists.
  • Checkout and payment gateway callbacks are exempt from the limit.
  • xmlrpc.php is disabled if you don't use it.
  • A time-limited emergency mode and an alert email are ready to switch on during an attack.

Frequently asked questions

Can a WordPress plugin completely stop a DDoS attack? No. Network- and protocol-layer attacks saturate the server or connection before reaching PHP. A plugin can only manage application-layer requests; for volumetric attacks, CDN and hosting protection is essential.

Is Cloudflare's free plan enough? For small and medium-sized sites, it's a good starting point against volumetric attacks. Which plan suits you depends on your traffic and risk level; check Cloudflare's own pages for current coverage.

Will a 429 response hurt my Google rankings? Not as long as the real Googlebot is exempt from the budget and the 429 isn't cached. 429 with Retry-After is a standard response in which the server says “I'm busy right now.”

Will mobile carrier users get blocked by mistake? On mobile networks, many people can share the same IP. That's why the budget should be set far above anything a human could ever reach, and the rule should first be monitored in trial mode. Whether you're in Izmir or anywhere else, reviewing these logs before a busy campaign day is a good habit.

Summary: stop volumetric attacks at the CDN and hosting layer before they reach your server; on the WordPress side, set up a rate limit that scores expensive requests, runs early, filters out fake bots and never touches checkout. Keep a time-limited emergency mode and alerts ready for when an attack hits.

More articles

Request a call

Describe your project in 60 seconds.

Fill in the short pre-form; we'll match you with the right person and reply within 24 hours.

A native English-speaking Project Lead from our team runs your project with you.

01 / 04

Which areas do you need help with?

  • UI/UX & Product Development
  • AI Solutions
  • Graphic & Brand Design
  • Software & Hosting
  • Studio & Production
  • Social Media
  • Digital Marketing
  • Digital Transformation
  • Industrial IoT (IIoT)
Average response time< 24 hours