In this day and age, having a fast-loading website is crucial for both user experience and SEO. When it comes to site speed, there are a lot of optimizations to be made including finding the right web host, caching content, and optimizing images for the web. Using a content delivery network (CDN) can also significantly speed up your site.
ay your server is located somewhere in the United States. A visitor on the other side of the world may experience slow load times because of the physical distance. A CDN essentially caches static elements of your website, and sends them to different servers around the world. As a result, static content will be loaded from a geographically close server whenever someone visits your website.
There are tons of CDN options available, but Cloudflare has a free plan for small websites and blogs. By sitting between the visitor and your server, Cloudflare also helps protect your site from malicious hackers and bots. In this tutorial, I’ll show you how to set up Cloudflare on your WordPress site.
How to Set up Cloudflare
The first thing you need to do is create an account here. You’ll then be asked to provide the URL of your website, and Cloudflare will scan your website’s DNS records. While Cloudflare’s scan is almost always accurate, now would be a good time to login to your domain registrar to double check your A Record and CNAME. If you need to add or change a record, do so now. If everything looks fine, confirm and continue on with the setup process.
You’ll then be prompted to choose a plan. I’ve been using the free plan, but the paid ones do offer more options. I recommend the following initial Cloudflare settings.
- SSL On
- Performance — CDN + Basic Optimizations
- Security — Medium
SSL encrypts all connections between the visitor and Cloudflare’s severs. CDN + Basic Optimizations will give you a good speed boost without compromising too much on cache timeouts. Medium security will protect you from malicious hackers and bots without too many false positives.
Cloudflare will then ask you to change your name servers. This allows Cloudflare to route malicious traffic through their servers before they get to your server. It also allows Cloudflare to serve cached static content.
If your domain registrar is BlueHost, your name servers will probably like…
- ns1.bluehost.com
- ns2.bluehost.com
Cloudflare will have you change them to something like this…
- abc.ns.cloudflare.com
- def.ns.cloudflare.com
Changing name servers can be done at your domain registrar. If you don’t know how to change your name servers, just Google “name of domain registrar change name servers,” Once you’ve updated your name servers, continue on and finish the setup process.
While waiting for the new name servers to fully propagate around the world, install the Cloudflare plugin on your WordPress site. After installation, go to Cloudflare settings under the Plugins tab, and fill in the relevant info.
- Cloudflare Domain Name is the name of the site you signed up with or added.
- Your Cloudflare API Key can be found under the Account tab on the Cloudflare website.
- Cloudflare API Email is the email address you signed up with.
- You don’t need to configure Development Mode right now.
Cloudflare should be all set up, you can begin to reap the benefits which include…
- Protection from malicious hackers and bots.
- Faster loading times through caching and minification.
- Free SSL encryption.*
- Sophisticated analytics reports.
If you need to change any settings or add websites, just go to the Cloudflare dashboard. This is also where you can go through analytics reports of your websites.