Wordpress & Web Development

How to Set Up CDN the Right Way and Avoid SEO Problems

Ryan Dube 31-03-2014

Tired of your website loading like a snail? Well, installing a CDN system Vroom, Vroom: A Comprehensive Guide To Speeding Up A WordPress Blog MakeUseOf serves hundreds of thousands of visitors everyday, and we do it all on Wordpress. Wordpress can and does scale from tens to millions of pageviews, but you’re going to need some heavyweight plugins and... Read More on your WordPress blog can help, but setting it up wrong can really hurt. I’ll show you why and how to avoid those problems.


CDN stands for “Content Delivery Network”, and it’s a way to cache content on your website that doesn’t change very often across several servers located all across the Internet. This might include scripts and images that make up parts of your web pages that never change. So now, whenever someone in California, for example, accesses your website in their browser, the content is delivered to them from one of the CDN’s local servers and using cached content.

This helps in multiple ways. Not only do pages load extremely fast for your readers, but it also reduces the overall load 3 Ways To Speed Your Site Up With The Cloud The Cloud is the answer to all the worlds problems, it would seem - a buzzword technology that sends computing full circle right back to where it started - with a thin client model and... Read More on  your own web server, because you aren’t constantly serving up the same exact content all the time. It also helps with SEO for your site, because page load time is in fact one factor in the Google ranking algorithm. It’s a great thing to do, but not many newer website owners and blogger use it, because setting it up isn’t entirely straightforward. It can even hurt your SEO if you don’t do it right!

Signing Up for a CDN

In the early part of 2014, following James’ lead 3 Ways The W3 Total Cache Plugin Can Speed Up Your Wordpress Blog Self-hosted WordPress is a fantastic system, no doubt about it. But it can become a little bloated resulting in a slow load time. Read More , I posted a set of instructions for setting up W3 Total Cache How to Boost Your Website's Performance With W3 Total Cache and a CDN Getting judged by Google as a low-quality site because your pages load too slow will hurt you in the long run. Take time off to boost your site speed and enhance user experience. Read More  including CDN settings. In that article I mentioned that you can stick with the default CDN URL that ends in “netdna-cdn.com”, but that you have to make sure to enable SEO settings in your account so that those web pages are “nofollowed”. Otherwise they could get identified by Google as duplicates and ultimately damage your overall ranking – especially for images. In this article, I’m going to walk you through the advanced approach so that the CDN URL actually matches your own website’s domain. This can significantly help with keeping any content that may get crawled by Google under the same domain – preventing you from losing all of that SEO juice from your image content.

First things first. You need to sign up for a new CDN account if you haven’t already (in my case I use MaxCDN, because they offer an ultra-cheap account for small website owners with bandwidth under 100GB a month).



Not to promote MaxCDN or anything (I’m sure other CDN’s are just as good), but I thought it was pretty cool how just as you’re browsing the site, a help desk person proactively asks you if you need help. They helped me figure out how to re-enable my old account and get my settings all configured the same day.

Once you sign up for an account (if you haven’t already), you’ve got to create your first “Pull Zone”. Give it a suitable unique name, identify your original website URL, and give it a label.


Now for the important part.  Go into “Settings” and create a “Custom Domain” that includes your actual website domain. Typical is something like “cdn.yourdomain.com”. Click on the “+Add” button and your custom domain will be ready to go.



It isn’t live yet though. This setup won’t work until you add the CNAME with the correct “.netdna-cdn.com” URL.

Setting Up CDN on Your Server

You can do this inside of Cpanel by clicking on the “Simple DNS Zone Editor” icon under the “Domains” section.



This is the part that makes it all work – so do it right. The Name field needs to be the custom CDN url that you set up in your CDN account. The CNAME field needs to be the CDN’s URL listed on the Pull Zone settings page. It’s the one that ends in some other domain URL that’s not your own site’s domain.


Okay, so now you’ve got your CDN account properly set up and you’ve got your own web server set up to interpret the custom domain. All you’ve got left is to correctly configure CDN in your WordPress Admin panel.

Setting up CDN in WordPress

As I mentioned in my last article on the plugin, I prefer W3 Total Cache to handle site caching. Other caching plugins will have a section on CDN as well. For W3 Total Cache, you’ll need to go to the General Settings tab first so you can enable CDN if you haven’t already.



Don’t forget to select the correct CDN that you have an account with (in my case it’s MaxCDN), and then “Save all settings”.

Now go down to the CDN link in the plugin navigation bar, and make sure to select “Add canonical header”. This makes sure that each of the CDN served pages also include a canonical meta tag that tells the crawler the original image is actually located on your website, not the CDN’s web server. This is just one more important element that protects you from the SEO damage a CDN can potentially inflict on your site.


Finally, under “Configuration”, you’ll want to click on the “Authorize” button. This will connect to your chosen CDN network webpage, and you may need to log in. Once you do, you’ll receive a long authorization code that you’ll need to copy and then paste into the “Authorization key” field.


Past that key into the field, and then in the “Replace site’s hostname with:” field, type in the custom CDN url that you went through all of that effort of creating. This is the beautiful part – and you’ll see why in a minute.

Click “Add CNAME”, and then “Test MaxCDN” just below these settings.


If you did everything above correctly, you should see the “Test passed” status show up.



Click on “Save all settings”, and now you have properly configured CDN account for your site that won’t steal all of your hard-earned SEO juice. Google will still see all of those images as coming from your domain.

Here’s an example of the source code of one of the pages on my site. As you can see, the URL is still “topsecretwriters.com”.


The last thing you want to do is destroy your strong search engine standings in exchange for server performance. By correctly setting up CDN though, you really can have the best of both worlds. Beware of sites that recommend just using the default CDN URL. While canonical and the SEO settings in your CDN account may protect you from SEO damage, there’s no guarantee. Nothing is as disheartening as seeing images show up in Google Image search as coming under the CDN URL rather than from your own domain.

In 2012, Matt Cutts reiterated the SEO evaluation of subdomains by Google as being equivalent to subdirectories on your site. They are treated no differently.

That means that if the URL ends in “netdna-cdn.com”, that image will not be considered as even related to your site in an way. The fact that it’s now viewed by Google as a part of your domain means that you still maintain search value from those images in Google Image search, and the “link juice” from your page to your images remain on your own domain.

The beauty of having a properly configured CDN setup is that you now have everything you had before – everything under your own domain – but you also get the tremendous bonus of a crazy-fast loading website. This not only makes Google happy, but it makes your visitors very happy.

Give it a try and see if setting up a CDN for your website makes a performance improvement. Let us know what your experiences were while you were going through this process. Was it easy? Did you run into problems? Share in the comments section below!

Image Credits: Torkild Retvedt Via Flickr

Affiliate Disclosure: By buying the products we recommend, you help keep the site alive. Read more.

Whatsapp Pinterest

Leave a Reply

Your email address will not be published. Required fields are marked *

  1. Anonymous
    November 8, 2015 at 12:01 pm

    I have a problem in w3 total cache cdn setup:

    In Replace site's hostname with: I put my custom domain Maxcdn and see this message.

    Error: Unable to resolve hostname: cdn.midominio.com

  2. Satish
    March 23, 2015 at 9:22 am

    Excellent Information.. But giving third party CDN links like "cloudfront". Is google consider these links as a extranal domain and cause any SEO penalty. Presently moz.com using the same.

    • Ryan Dube
      March 25, 2015 at 1:16 am

      Hi Satish - the important thing is that on your blog, under the CDN setup, you need to have "Add canonical header" selected.

  3. Zoe
    March 9, 2015 at 10:22 am

    I've followed the advice in your article after noticing these offsite image URLs appearing just like you mention when I enabled CDN and didn't realise it has this effect.

    However, following your process creates a further SEO issue because Google has now seen 3 different URLS for the same image, as follows:

    (1) Original image url:
    [Broken Link Removed]

    (2) After enabling a CDN:
    [Broken Link Removed]

    (3) After applying your solution:
    [Broken Link Removed]
    So aren't we still losing SEO link juice by not informing Google that our original image has actually moved URL location too?

    Should we therefore create a 301 Redirect from URL (1) & (2) to URL (3) - this could show Google where the original image has moved and preserve SEO link juice to that image.

    Is this right? Would love to hear your advice. Thank you.

    • Mahjabeen
      March 2, 2016 at 1:25 am

      Hi Zoe.

      I came to this article looking for effects on SEO after installation of a CDN. I am wondering the same thing as you. If Ryan can please clarify this, it would be much appreciated. Thanks


  4. Regev
    September 20, 2014 at 7:37 pm

    Do I still need to check this Add Canonical Header if all my posts already have a link rel=canonical ? I'm using the Genesis framework and WordPress SEO by Yoast, i tried to find an answer on yoast site but couldn't find any

    also - should i no index the CDN in maxcdn robots.txt settings ?

    I hope your site sends email notifications for comment replies, if not - ill appreciate it if you can drop me a mail. Thanks!

  5. Anandu B
    April 3, 2014 at 2:40 pm

    i use cloudflare as cdn for anandu.info

  6. Waqas
    April 1, 2014 at 5:41 am

    Excellent guide Ryan! Thanks for sharing.