Whether you’re new to WordPress SEO or have been doing it for years, you’ve probably heard of Content Delivery Networks (CDNs).
CDNs can be a powerful tool for WordPress sites; in fact, some SEO professionals consider them a must-have.
In this column, you’ll find everything you need to know about choosing, setting up, and configuring a CDN for your WordPress website.
Recap: What’s a CDN?
A CDN is a series of edge servers typically located in multiple places throughout the world. They cache files from your website to improve load speeds for users and most offer security benefits, as well.
You can learn more about the basics of content delivery networks in these guides:
- Content Delivery Network (CDN): What It Is & How It Works
- How to Use a Content Delivery Network (CDN) for SEO
Before you explore integrating a content delivery network with your WordPress site, I highly recommend reading the two articles above so that you have a full understanding of how CDNs work.
Why Are CDNs Beneficial for WordPress?
While WordPress is the world’s most widely used content management system and a favorite amongst most SEO professionals, it’s not without its faults.
Many WordPress themes are overly bloated and come with both load speed and security issues.
To be clear, CDNs are neither a permanent fix nor a bandaid for load speed and security issues.
You should still do the work to fix as many technical SEO issues as possible.
Instead, CDNs can be used to enhance your website’s technology stack.
If you’ve put the work into improving your WordPress site’s performance and looking to take it to the next level, here are three reasons why CDNs are a great choice for you.
1. CDNs Offer Improved Security Features for WordPress
By its nature, WordPress is prone to security flaws. But with the right modifications, it can be made secure.
Many CDN providers offer superb security features specifically for WordPress sites, such as:
- Protecting Your Login Page: CDNs like Cloudflare offer advanced firewall rules that can be configured to protect your login page.
- Blocking xmlrpc.php Attacks: In addition to login page attacks, xmlrpc.php attacks are one of the most common attacks on WordPress sites. You can set up similar firewall rules on most CDNs as the previous page to block traffic to that path.
- DDoS Protection: Cloudflare is the most popular choice for DDoS (distributed denial-of-service) protection, but many modern CDNs offer excellent DDoS protection. DDoS attacks are rare for most SMB and mid-market WordPress sites, but having this protection can offer peace of mind.
- Free SSL Certificates: Most modern CDNs now offer free SSL certificates, a must-have for any WordPress website.
- Preconfigured Firewall Rulesets: Many CDNs with a focus on security offer WordPress-specific firewall rules. This is great for the non-security-savvy WordPress users who need peace of mind from outside threats.
Many CDNs offer security, but it’s important to find one that offers the right balance of WordPress automation without sacrificing customization.
2. Improved Site Speed for WordPress
Improved site speed is one of the main reasons WordPress users choose a CDN.
Being able to cache and deliver your content closer to your website visitors is critical for anyone looking to improve their Core Web Vitals scores.
Additionally, almost all CDNs are now taking advantage of Brotli, a file compression technology developed by Google.
3. Downtime Reducer
Many content delivery networks offer website uptime support in case your main server goes down.
This works by serving the latest cached version of your WordPress site to visitors until your main web server comes back online.
What to Look for in a WordPress CDN
Here are the top features and functions to look for in a CDN for your WordPress site:
Integrations Through Your Current Host
Before you begin looking for a CDN, check with your current WordPress host. Many modern WordPress hosts offer a built-in CDN through various partners.
Find out who they use and compare capabilities and features. Make sure you have those security features in addition to the edge caching.
How Many Edge Servers They Have
Check your website’s analytics and find out where the majority of your traffic is coming from.
Compare your traffic’s locations with the CDN’s edge server locations to see if they’re close.
Pre-Set WordPress Configurations
Since WordPress is the most used CMS in the world, many content delivery networks have pre-set configurations specifically for WordPress. However, not all of them do.
Find out what they optimize for and compare them to other CDNs.
Do They Offer a Plugin?
While I typically try to reduce plugins on a WordPress site, having a plugin for a CDN can be really beneficial.
CDN plugins can help sync your WordPress settings to help with automatic platform optimizations and even allow you to clear your CDN cache directly from your WordPress dashboard.
Any Past Vulnerabilities?
You wouldn’t buy a car without researching its recall history (I hope).
Why would you go relaxed with your CDN? Make sure you research your CDN of choice to ensure they don’t have a history of vulnerabilities.
How to Set Up a CDN for WordPress
Before we get into the fun optimization steps, we need to ensure that you have your CDN properly set up for WordPress.
We can do this in a few quick steps:
- Sign up for your CDN.
- Once you’ve signed up for a CDN, they will provide you with either new nameservers or a CNAME that you will need to add to your current registrar. Most CDNs act as a DNS and will require you to use their nameservers; however, some allow you to use a CNAME.
- Once your DNS is finished propagating to your new CDN, you can start getting your CDN set up.
- If your CDN offers a WordPress plugin, I recommend checking the reviews on it and installing it if reviews look safe.
That’s it! Your CDN is all set up and you’re ready to start optimizing it for your WordPress site.
How to Optimize a CDN for WordPress
Here’s the fun part…
We’re now going to take some advanced steps to put your CDN to work for your WordPress site, making sure it’s fast and secure:
- Enable Automatic WordPress Optimization: If your CDN offers WordPress-specific enhancements, go ahead and enable them first.
- Enable Brotli: Make sure Brotli is enabled on your website. This compression technology can make a big difference with your site speed.
- Minify HTML/CSS/JS: This is becoming a standard feature for most CDNs and I recommend you enable it with caution. Once it’s enabled, make sure to test that your webpages still function properly.
- Secure WordPress Login Page: Go to your firewall rules page — make the field “URI”, the value “/wp-login.php”, and the action “JS Challenge.” Now you have a JS protection page that can help reduce bot attacks on your login page.
- Block xmlrpc.php Attacks: Using the same firewall rule as above, instead of blocking the login page, block xmlrpc.php.
- Be Careful with Rocket Loader: If you’re using Cloudflare, be careful with Rocket Loader. It can make some big improvements with site speed, but I’ve also seen it break functionality on some WordPress websites. Use with caution and test, test, test!
- Enable HTTP/2 or HTTP/3: HTTP/2 protocol works by parsing your website’s HTML to determine the optimal order for loading assets for the best possible performance. If you’re worried about how this may affect your SEO performance, you can rest assured that Googlebot can crawl with HTTP/2 protocol.
- Enable Image Optimization: Many CDNs are starting to offer image optimization services to help compress images and even convert them to WebP.
3 Final Thoughts on Optimizing WordPress with a CDN
Content delivery networks are a powerful tool for WordPress sites and should definitely be considered in your web tech stack.
When setting up a CDN for your WordPress site, make sure you:
- Test site speed before and after to compare results.
- Test your website’s functionality.
- Monitor performance in your CDN platform to see what you’ve been missing.
More Resources:
- 3 Image Optimization Tips for Faster Speeds & Higher Rankings
- How to Take Your Website Beyond Fast
- WordPress SEO Guide: Everything You Need to Know
Image Credits
All screenshots taken by author, June 2021