Skip to content

A DDoS Attack on Your Website: How to Detect It and What to Do in Real Time

On this page

Last updated: · By

In short: a DDoS attack floods your site with requests from thousands of machines at once, until the server cannot answer real visitors. In real time: use traffic monitoring to see where the requests come from, turn on Under Attack Mode in Cloudflare, block IPs or countries in the server firewall, and make sure Cloudflare cannot be bypassed through the IP address. This is how it works on Cloudways, as of 7 Nov 2026.

⏱ First response time: 15–30 minutes · Difficulty: intermediate to advanced · Last checked: 7 Nov 2026

What is a DDoS attack and what types are there?

DDoS (Distributed Denial of Service) is a distributed denial-of-service attack: many machines, usually hacked computers and devices, send traffic to the same target. The difference from a plain DoS is the distribution, so blocking a single address does not stop it.

TypeWhat happensWho usually stops it
Layers 3–4 (network and transport)A flood of packets or connections that fills the bandwidthThe provider and the network. On Cloudways, layer 3–4 protection is included on all servers
Layer 7 (application, HTTP flood)Lots of “normal” requests to heavy pages: search, cart, wp-loginA CDN with WAF and rate limiting, and a server-level firewall
Aggressive botsScrapers or fake Googlebots that load the site with no intent to take it downBot management, blocking by user agent or rate

According to the Cloudways security page, all servers include DDoS protection at layers 3 and 4, and Flexible servers are also protected by a server-level firewall (Imunify360) that filters malicious traffic and DoS attacks. Most attacks that take down WordPress sites are at layer 7, and that is where you need the protections below.

How do you know your site is under a DDoS attack?

The first sign is usually 502/504 errors or a stuck site, together with server CPU at 100% for no business reason (no sale, no campaign).

  1. In the Cloudways dashboard, open the application: Monitoring > Analytics > Traffic. According to the official guide, it shows the addresses with the most requests, bot traffic, the requested URLs and response codes.
  2. Look for a pattern: single IP addresses with thousands of requests, a single URL that keeps repeating (for example /?s= or wp-login.php), or a single user agent.
  3. On the server, open Security > Overview. According to the Cloudways security guide, it shows an assessment of attack intensity and the incidents blocked over the last 30 days.
  4. Compare with Google Analytics: if the server is collapsing but the number of real visitors is normal, the traffic is not people.

Not every load spike is an attack. AI bots or SEO crawlers can load a site heavily. I measured which bots get blocked on my own server: AI bots on Cloudways. And if the site is simply slow with no attack, see slow site and high CPU.

What do you do in real time when your site is attacked?

The order: first stop the bleeding in Cloudflare, then block on the server, and only at the end analyze.

  1. Turn on Under Attack Mode: with the Cloudways Cloudflare Enterprise add-on, it is a switch in the application’s Cloudflare settings. According to Cloudways, it is a last-resort step meant for layer 7 attacks, and verified bots like Googlebot and Bingbot keep crawling. On your own Cloudflare account, the setting is in the Cloudflare dashboard.
  2. Make sure Rate Limiting and WAF are on: in the Cloudways add-on both are enabled by default, under Cloudflare > Settings > Security.
  3. Block in the server firewall: Security > Firewall lets you block IP addresses, ranges (subnets) and countries. If the whole attack comes from a country where you have no customers, blocking the country is a quick step.
  4. Block direct access to the server IP: an attack aimed straight at the server’s address bypasses Cloudflare. In Settings & Packages you can block direct traffic to the IP address, according to the Cloudways guide.
  5. Protect the heavy endpoints: wp-login.php, xmlrpc.php and site search. A challenge rule in Cloudflare for those addresses removes most of the load.
  6. Open a support ticket with the addresses and times you saw. See how to open a ticket on Cloudways.

What does Under Attack Mode do to visitors?

According to the Cloudflare documentation, every visitor goes through a browser check that decides within up to five seconds whether to allow or block, and the visitor needs JavaScript enabled. Cloudflare warns that the mode temporarily hurts access and analytics data. So you turn it off as soon as the attack ends.

Note: mobile apps, payment provider webhooks and API connections do not run JavaScript and can get blocked. On a store, check after turning it on that payments still go through. See payment notifications not reaching WooCommerce.

Black Friday80% off
80% off 2 months of managed hosting

The code BFCM802 takes 80% off your bill for the first two months (up to $200 off per month), including unlimited free site migrations. New customers only, and only until the offer ends.

The offer ends on December 4, 2026 at 23:59 (UTC+2).

Ends in—days—hours—minutes—seconds
Code:
Grab the 80% now

Start with a free trial, no credit card. Enter the code at checkout and check that it shows up.

After Black Friday: 30% off for 3 months with the code ASAEL. On a large server (above about $444 a month) ASAEL already saves more today. BFCM802 vs. ASAEL calculator

Is free Cloudflare enough against DDoS?

For most attacks, yes. According to the Cloudflare documentation, unmetered DDoS protection at layers 3 to 7 is included in all plans, including the free one. The difference is in the tools around it: bot management, flexible rate limiting and support. You can see what Cloudflare actually blocks in the guide to security events in Cloudflare.

CapabilityFree CloudflareCloudflare Enterprise via Cloudways
DDoS protection, layers 3–7YesYes
Bot managementBot Fight Mode, with no WAF exceptionsEnterprise-level Bot Management
Rate LimitingSet up manually in your own account, depending on the planOn by default
Cost$0$4.99 per domain per month (1–4 domains), as of 7 Nov 2026

According to the Bot Fight Mode documentation, you cannot exempt addresses from it with WAF rules, and it may challenge API and mobile traffic. A full comparison: Cloudflare Enterprise on Cloudways, and prices on the add-ons pricing page.

How do you prepare for the next attack?

  • Turn on Cloudflare (free or Enterprise) before there is an attack. Turning it on mid-attack needs a DNS change, and up to 24 hours of propagation.
  • Block direct access to the server IP, so Cloudflare cannot be bypassed.
  • Limit wp-login.php and xmlrpc.php. Cloudways protects against repeated login attempts on SSH and HTTP.
  • Make sure caching works: a cached page costs the server almost nothing, even under load.
  • Write down in advance who handles it, how to get into the dashboard, and where the switches are. During an attack there is no time to look.

An extra insurance: a recent backup. A DDoS attack does not steal data, but it is sometimes used to mask a breach. Hardening guide: hardening security on Cloudways.

Frequently asked questions

How do you know if your site is under a DDoS attack?

Common signs are 502/504 errors, server CPU at 100% and unusual traffic with no rise in real visitors in Analytics. On Cloudways, the Traffic screen in the application shows which IP addresses and URLs send the most requests.

What is Under Attack Mode?

An emergency mode in Cloudflare where every visitor goes through a short browser check before entering the site, and malicious bots are blocked. It is meant for application-layer attacks, and you turn it on only during an attack because it temporarily hurts the experience and analytics.

Does Cloudways protect against DDoS?

Yes, at a basic level. All servers include DDoS protection at layers 3–4, and Flexible servers are protected by a server-level firewall (Imunify360). For application-layer attacks, Cloudflare is recommended, free or through the Cloudflare Enterprise add-on.

Can a DDoS attack steal data from the site?

Usually not. DDoS is meant to take the site down, not to break into it. It is sometimes used as a distraction from a breach, so after an attack it is worth checking users, files and security logs.

Can you block a whole country on Cloudways?

Yes. In the server’s Security tab, on the Firewall screen, you can block IP addresses, address ranges and countries. Before you block a country, make sure you have no customers or external services there that need access.

Does free Cloudflare stop DDoS?

Yes, unmetered DDoS protection is included in the free plan too, according to Cloudflare. What the free plan mostly lacks is advanced bot management and flexible rate limiting, which matter in application-layer attacks.

Sources

Official source: Cloudways Knowledge Base and Cloudflare Docs. This guide was written and checked by Asael Dreyer · Updated: 7 Nov 2026

Disclosure: this is an independent site, not the official Cloudways site. Some links on this site are affiliate links: if you sign up through them we earn a commission, at no extra cost to you. Full details

Picture of Asael Dreyer
Asael Dreyer

Hi, I'm Asael Dreyer, CEO of an SEO agency that runs hundreds of websites hosted on dozens of Cloudways servers.
Everything you will find here comes from hands-on experience, mine and my teams', straight from the field: from the guides to the recommendations. All to help you get the most out of Cloudways.

More about me →

Need help? Got a question about your server or this guide? Write to us and we will get back to you.

More guides on this topic:
מפריד
Thanks for your message!
We will get back to you soon.
Ready to get started?

Sign up with the coupon code ASAEL