Few cyber threats are as destructive as a distributed denial-of-service (DDoS) attack. It can make your website painfully slow to load, or it can completely crash your site.

While DDoS attacks are illegal under the Computer Fraud and Abuse Act (CFAA), that hasn’t stopped cyber criminals from performing them. According to NETSCOUT, an average of 23,000 DDoS attacks occur each day.

You can protect your website from destructive DDoS attacks, however, by implementing a few security measures.

What Is a DDoS Attack?

A DDoS attack is a malicious spam-based attack in which a targeted website is flooded with an excessive amount of traffic originating from many IP addresses. It’s intended to overload the website’s server by consuming resources that would otherwise be used to process legitimate traffic.

Servers can only process so much traffic until they begin to experience performance issues.

A DDoS attack leverages the finite processing capabilities of servers to harm the targeted website. The flood of incoming traffic consumes the server’s resources, thereby causing the website to load slowly or go offline entirely.

Cyber criminals perform DDoS attacks using hijacked computers and devices.

Before conducting a DDoS attack, a cyber criminal will develop a botnet, which is a network of computers and other internet-connected devices that have been hijacked with malware. After taking control of these computers and devices, the cyber criminal will use them to send data packets to the website he or she is attacking.

Upgrade Your Hosting

A premium hosting service can protect your website from DDoS attacks.

If you currently use a low-end hosting service, such as a shared hosting plan, your website probably won’t have a sufficient amount of server resources to stay online during a DDoS attack. It may handle legitimate traffic without any interruptions, but once the malicious traffic begins pouring in, it will go offline.

Premium hosting services, including Virtual Private Servers (VPS), dedicated servers, and cloud hosting platforms offer stronger protection against DDoS attacks than their low-end counterparts because they provide more server resources. You’ll get more bandwidth, RAM, and CPU resources, allowing your website to process more traffic.

Looking for a WordPress hosting service that takes DDoS and other cyber attacks seriously? Check out our recommendations here. 👈

Install a Web Application Firewall

Another way to strengthen your website’s level of protection against DDoS attacks is to install a web application firewall.

A web application firewall is a special type of cybersecurity-enhancing firewall that lives up to its namesake by operating on layer seven—the application layer—of the Open Systems Interconnection (OSI) model. In comparison, traditional firewalls operate on layers three and four of the OSI model.

All firewalls work by evaluating traffic against a set of predetermined rules. If a data packet doesn’t meet the ruleset, the firewall will reject it so that it doesn’t consume server resources.

Unfortunately, traditional firewalls offer little or no protection against DDoS attacks because they only evaluate the headers of data packets and not their contents. Web application firewalls, on the other hand, offer a more robust traffic-filtering solution by thoroughly evaluating the contents of data packets for suspicious activity.

Use Geoblocking

You can also use geoblocking to protect your website from DDoS attacks.

Geoblocking involves blocking traffic that originates from one or more countries. DDoS attacks often originate in foreign countries where Internet Service Providers (ISPs) don’t proactively monitor their customers’ traffic for malicious activity. If you notice that your website is receiving a lot of traffic from a particular foreign country, you can block it.

Geoblocking is a feature offered with most hosting services. Alternatively, you can use your .htaccess file for geoblocking purposes.

The downside to geoblocking is that it will prevent users in the specified country or countries from accessing your website. When attempting to load your website, they’ll see an error message. Therefore, some webmasters only use geoblocking during a DDoS attack rather than as a preventative measure.

Blacklist IP Addresses

If you don’t want to block entire countries from accessing your website, you can blacklist specific IP addresses.

When blacklisted, traffic from the corresponding IP address will be rejected by your website’s server. Just monitor your website’s traffic logs during a DDoS attack while taking note of IP addresses that follow a suspicious pattern. You can then blacklist those IP addresses to prevent them from harming your website.

Like geoblocking, you can blacklist IP addresses either within your hosting service account or by using a .htaccess file. If your hosting service offers a control panel, it should have an IP address blacklisting feature.

With that said, blacklisting IP addresses can be tedious since DDoS attacks often use thousands of them.


Another way to protect your website from DDoS attacks is to launch it on a content delivery network (CDN).

A CDN will expand your website’s footprint across multiple servers. If a DDoS attack begins to take a toll on your website’s main server, the other servers will step up to the plate by processing more of its traffic.

CDNs are used primarily to make websites load more quickly. When you launch your website on a CDN, the CDN’s servers will create and store copies of your site’s content. The cached content will then be sent to your website’s visitors upon request from the nearest server. A visitor in the United States may receive content from a California-based server, whereas a visitor in Australia may receive content from a Queensland-based server.

Along with speeding up your website, though, a CDN can protect it from DDoS attacks. The CDN’s servers will alleviate the burden placed on your website’s main server. If any of the servers become overloaded, the CDN will simply route the traffic to a different server.

Cloudflare and StackPath are two of the most popular CDN providers.

Final Thoughts

Being on the receiving end of a DDoS attack is demoralizing.

You’ve probably spent a substantial amount of time, as well as money, to build your website. If it’s targeted by a cyber criminal during a DDoS attack, users may not be able to see it. Even they can access it, your website will probably load painfully slow.

Thankfully, you can protect your website from DDoS attacks by upgrading your hosting service, installing a web application firewall, using geoblocking and blacklisting suspicious IP addresses.

If you use WordPress and want to lock down your site’s security, check out our complete WordPress security guide here. 🔐

Notify me of

1 Comment
Oldest Top Rated
Inline Feedbacks
View all comments

WordPress Masterclass: The Free Beginner Website Course

Learn how to build beautiful, functional websites without writing a single line of code. Completely free—no registration required.