Domain names and their influence on SEO

We often get questions from people asking about the influence of domain names on SEO. Is there any relation at all? Does it help to include keywords like product names in your domain name? Is the influence of domain names different per location? And what’s the use of using more than one domain name for a site? In this article, I’ll answer all these questions and more.

What’s a domain name?

Let’s start at the very beginning. A domain name is an alias. It’s a convenient way to point people to that specific spot on the internet where you’ve built your website. Domain names are, generally, used to identify one or more IP addresses. So for us, that domain name is yoast.com. When we are talking about www.yoast.com, which we rarely do, the domain name is yoast.com and the subdomain is www.

Note that I deliberately included “.com” here, were others might disagree with that. In my opinion, most common uses of the word “domain name” include that top-level domain. 

Optimize your site for search & social media and keep it optimized with Yoast SEO Premium »

Yoast SEO for WordPress pluginBuy now » Info

Top-level domain (TLD)

Where “yoast” is obviously our brand, the .com bit of our domain name is called TLD (or top-level domain). In the early days of the internet:

  • .com was intended for US companies,
  • .org for non-profit organizations,
  • .edu for schools and universities and
  • .gov for government websites.

We’re talking 1985. Things have changed quite a bit. For the Netherlands, we use .nl, but lots of companies are using .com instead, for instance, when the .nl domain name they wanted was already taken. Things have gotten quite blurry. These days, TLDs like .guru and .pro are available. Automattic bought .blog a while back. And what about .pizza? We call these kind of TLDs generic TLDs.

Country code TLD (ccTLD)

I’ve already mentioned the .nl TLD. We call these kinds of TLDs country code or country specific TLDs. Years ago, Tokelau – an island in the Southern Pacific Ocean – started giving away their .tk TLD for free, and thousands of enthusiasts claimed their .tk. If I would have claimed michiel.tk, there would have probably been nobody in Tokelau who could have pronounced my domain name well. It’s like .cc, which you might have heard of, because it was once promoted as the alternative to .com. It’s actually a country specific TLD belonging to the Cocos (Keeling) Islands, although the people of Cypres might disagree.

This brings me to the first statement about domain names and SEO:

ccTLD or subdirectory?

If your website is available in multiple languages, you might be wondering what the best solution is: domain.com/uk/ and domain.com/de/ (subdirectories or subfolders) or domain.co.uk and domain.de (ccTLDs).

For SEO, the subdirectory makes more sense. If you use a subdirectory, all links will go to the same domain. Marketing is easy because you have one main domain. If there are language differences per subdirectory, use hreflang to tell Google about that. If you include all in one (WordPress) install, maintenance is easier. Just to name a few advantages.

Note that a subdomain, like the “www” I mentioned, is something totally different than a subdirectory. Google actually considers kb.yoast.com to be a different website than yoast.com, even though I’m sure they can connect the dots.

Age of a domain

These days, the age of a domain – referring to how long your domain already exists – doesn’t matter as much as it did before. It’s much more about the content, the site structure and basically how well your website answers the query people used in Google. To become the best result and rank top 3 for a query, you’ll have to be the best result.

As a matter of fact, John Mueller of Google confirmed just a few weeks ago that domain age doesn’t matter:

Is it that black and white? No, it’s not. Domain age as such might not influence ranking, but older domains probably have a nice amount of backlinks, pages in the search result pages etc. And obviously, that might influence ranking.

Exact Match Domain (EMD)

BuyCheapHomes.com is probably an existing domain name. This is an example of an Exact Match Domain name. In 2012, Google introduced what we now call the EMD Update. Google changed it’s algorithm, so websites that used domain names like that wouldn’t rank just for the simple fact that the keyword was in the domain name. And yes, that used to be the case, before the update.

So, after this update, does it still pay off to use a domain name that includes a keyword? Only if the rest of your website adds up. Homes.com works pretty well :) And in the Netherlands, the Dutch equivalent of cheaploans.com, goedkopeleningen.nl, probably gets a decent amount of traffic. But that’s because Google is better in English than Dutch (but catching up on that).

My advice: if you managed to build a brand around that EMD, and you still get lots of traffic, keep up the good work. If your money is still on BuyCheapHomes, please make sure your branding is absolutely top notch. You’re in the hen house and a fox might be near.

More on EMD in Moz’s The Exact Match Domain Playbook: A Guide and Best Practices for EMDs.

Branding

Following the EMD update, branding became even more important. It makes so much more sense to focus on your brand in SEO and your domain name – as opposed to just putting a keyword in the domain name – that a brand name would really be my first choice for a domain name. LEGO.com, Amazon.com, Google.com. It’s all about the brand. It’s something people will remember easily and something that will make you stand out from the crowd and competition. Your brand is here to stay (always look on the positive side of things).

Make sure your brand is unique and the right domain name is available when starting a new business. By the way, this might be the reason to claim yoast.de even if you’re mainly using yoast.com – just to make sure no one else claims it ;)

By the way, I mentioned that a (known) brand is usually easier to remember. For the same reason, I’d prefer a short domain name over a domain name like this. Pi.com was probably already taken.

Read more: ‘5 tips on branding’ »

More than one domain name for the same website

Does it pay off to claim multiple domain names and 301 redirect all the domains to the main domain name? In terms of branding: no. In terms of online ranking: probably not. The only valid reason I can think of to actively use multiple domain names for the same website, is offline and sometimes online marketing. If you have a specific project or campaign on your website that you’d like to promote separately, a second domain name might come in handy to get traffic straight to the right page on your website.

“Actively” is the main word in that last paragraph. As mentioned, feel free to register multiple domain names, just make sure not to confuse Google. Besides that, actively using multiple domain names for the same website will diffuse the links to your website. And that isn’t what you want, as mentioned at the subdirectory section as well. 

Become a technical SEO expert with our Technical SEO 1 training! »

Technical SEO 1 training$ 199 - Buy now » Info

Domain Authority (DA)

I feel I have to mention domain authority here as well, as you hear a lot about it nowadays. Domain Authority is a score that predicts how well your website will rank on the search results pages. It’s based on data from the Mozscape web index and includes link counts, MozRank and MozTrust scores, and dozens of other factors (more than 40 in total). Source: Moz.com. It’s Moz-specific, so if you are using Moz, go check it out. And if you are a heavy user of domain authority, please elaborate why in the comments, as it’s not a metric I use, to be honest :)

Keep reading: ‘SEO friendly URLs’ »

The perfect WordPress SEO permalink structure

In the past we received a lot questions regarding optimizing your WordPress SEO URL / permalink structure. Questions ranging from whether you should have the category in your permalink structure to the length of your slugs. In this post, we’ll address some of these questions and attempt to give you a better understanding of your permalink structure.

The ideal WordPress SEO URL structure

At Yoast, we recommend using a simple and clear permalink structure. Ending your URL with the post name is the preferred method and optionally you can prefix the post name with the category, which results in one of the two following permalink structures:

/%postname%/

And with the category prefixed:

/%category%/%postname%/

For an added bonus, we recommend adding your main keyword somewhere in the post’s name. When checking out the snippet preview in our plugin, you’ll see your keyword emphasized in the URL if it’s been detected in your slug (see image below).

What about using dates?

Using dates in your URL never had many benefits. When you add dates to your permalink structure, you automatically ‘date’ your posts. People will naturally look for posts with a more recent date, assuming that they contain the best information. However, sometimes older post can hold very valuable information, but won’t get the same amount of clicks due to their age.

Should I use the category in my permalink structure?

If your domain name is nice and short and you use short, yet descriptive category names, you can easily include a category in your permalink structure which can benefit your website, but beware: if you end up with a lengthy slug and category name, it will make sharing the URL more difficult and won’t have much added value in Google.

If you decide to use categories in your permalink structure, make sure that you only select one category per post. For some more information regarding using categories in your permalink structure, I advise you to watch the following video by Matt Cutts.

Optimize your site for search & social media and keep it optimized with Yoast SEO Premium »

Yoast SEO for WordPress pluginBuy now » Info

Should I add .html to my permalink structure?

In terms of SEO and ranking, there is little benefit to keeping the .html extension present in your URLs. However, in the video below, Matt explains that there might be some other advantages to keeping the file extensions present in your permalink structure.

The discussion whether or not you should forcibly add .html (or any other extension) can be ended very quickly: Don’t do it. It won’t help you and if you add certain extensions such as .exe, it can actually hurt your rankings.

My blog is in Google News. Don’t I need numbers in the URL?

The short answer here is: no. Back in the day, Google News required you to use a three digit number in your URLs in order to be included in the News index. A way around this was to have a separate XML sitemap. However, since September 2015, both the three digit unique number and XML sitemap are no longer required.

Should my focus keyword always be the first keyword in the URL?

It might help slightly, but if your focus keyword is present in the first few words, you’ll be fine. Matt explains this at great length in the following video.

How many words should I use in my slug?

In this interview with Matt Cutts, Matt mentions the following regarding the length of your slug:

If you can make your title four- or five-words long – and it is pretty natural. If you have got a three, four or five words in your URL, that can be perfectly normal. As it gets a little longer, then it starts to look a little worse. Now, our algorithms typically will just weight those words less and just not give you as much credit.

Should you change your URL structure for better SEO?

You might expect that the answer to this question would be a simple yes. However, if you’ve been blogging for a while, you might not want to make any drastic decisions. Have you been using dates in your permalink structure for the past few years? Then it might be wise to not switch to a structure without them. If you only just started then switching won’t cause you much harm and might even be a huge beneficial step.
However, if you’re still using the “old style” urls (?p=) then it’d be wise to switch regardless of how long you’ve been blogging. This will greatly improve your blog’s potential to be found in Google’s search results.

If you do decide to get rid of dates in your permalink structure, you can add the following redirect to your .htaccess file (if you’re on Apache) to ensure that the old URL (/yyyy/mm/dd/%postname%/) points to the new one:

RedirectMatch 301 /d{4}/d{2}/d{2}/(.*) https://yoast.com/$1

For Nginx, you can use the following snippet in your site configuration:

location ~ /d{4}/d{2}/d{2}/(.*) {
rewrite ^(.*)$ https://yoast.com/$1 permanent;
}

The perfect WordPress SEO URL

Overall, permalink structures won’t differ much from website to website if done correctly. We advise that you make sure your permalink structure is properly set before avidly writing posts. If you do decide to change your permalink structure over time, make sure you properly redirect users from the old structure to the new one.

Read more: ‘How to change your WordPress permalink structure’ »

How to remove www from your URL

At Yoast, we sometimes receive the question how to remove www from your website’s URL – or add it. In this post, I’ll show you how you can enforce either a www or non-www URL by tweaking your .htaccess file (or nginx.conf if you’re running on an Nginx server).

Get the most out of Yoast SEO, learn every feature and best practice in our Yoast SEO for WordPress training! »

Yoast SEO for WordPress training$ 99 - Buy now » Info

Does using one or the other impact SEO?

You might be wondering if using one or the other will have an impact on your SEO. The answer is: no. It’s really just a matter of preference/esthetics. Just make sure you properly add the www and non-www domains in Google Search Console, as described here, to ensure Google can properly index your website.

Removing www from your domain name

If you prefer to market your website without the www prefix, you can add the following lines to your .htaccess file (Apache only):

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.example.com$ [NC]
RewriteRule ^(.*)$ http://example.com/$1 [R=301,L]

Restart Apache and check that you get redirected to the non-www version when using the www prefixed URL.

Note that Apache’s mod_rewrite module needs to be enabled. Otherwise, the above snippet won’t work.

Now, in Nginx this snippet is a bit different, but yields the exact same result when placed in the proper configuration file (which depends on your setup):

server {
 server_name www.example.com;
 return 301 http://example.com$request_uri;
}

Now just restart Nginx and you should be good to go!

Adding the www instead of removing it

To do the opposite of the previous section, add the following code to your .htaccess file:

RewriteEngine On 
RewriteCond %{HTTP_HOST} ^example.com$ 
RewriteRule (.*) http://www.example.com$1 [R=301]

And in Nginx, all it takes is this:

server {
 server_name example.com;
 return 301 http://www.example.com$request_uri;
}

That’s all there is to it!

Read more: ‘Ask Yoast: www and duplicate content’ »

Ask Yoast: can I cancel a 301 or 410 redirect?

After creating a redirect, it might happen you’d like to use the URL of that post or page again. Or perhaps you decide that you’d like to cancel that redirect after some time. Reasons for this could be that redirecting that post or page was a mistake, or the post or page contains valuable content again. In this case you might ask yourself: is it possible to use this URL again, while it has been redirected? I’ll explain whether that’s possible and what’s important to consider when doing so!

In this Ask Yoast we received a question from Ahmed M Hassan:

“If I want to use a link that had been 301 or 410 redirected before, can I cancel the redirection and use it again?”

Check out the video or read the answer below!

Optimize your site for search & social media and keep it optimized with Yoast SEO Premium »

Yoast SEO for WordPress pluginBuy now » Info

Can I cancel redirects?

Read this transcript to learn more about cancelling redirects:

“Yes, you can. What I would do, when canceling a redirect, is a Fetch and Render from Google Search Console to that URL and then submit to index, so Google knows that that URL now has content again. Otherwise, it can take months or even years for Google to come back to that URL, because it assumes you’ve redirected or deleted it. So use Fetch and Render for that and get those old URLs back in if you really need to. If you need to do this a lot, you need to think about your redirection strategy and whether you’re redirecting too quickly though.

Good luck!”

Example of Fetch and Render in Google Search Console:
search_console_-_fetch_as_google_-_https___yoast_com_

Ask Yoast

In the series Ask Yoast we answer SEO questions from followers! Need help with SEO? Let us help you out! Send your question to ask@yoast.com.

Read on: ‘Google Search Console: crawl’ »

Ask Yoast: change URLs when relaunching website?

Relaunching a website can be an overwhelming project. You need a new design and perhaps new functionalities. What should you do with your existing content? And what about new content? The more changes you want, the more challenging it gets. In this process you might face the question if you should change or keep your URLs. We hope to help to make your relaunch a bit easier by answering this question!

At Ask Yoast we received the following question, from Taisia Fredrickson:

“We want to change the titles of all of our products as we are relaunching our website and adding new products. Could we do this, but keep the same slug/URL? We would have to redirect our complete product catalog (which is massive) in order to change the URLs, from what our developer says.

Check out the video or read the answer below!

Let our SEO experts analyze and improve your site's SEO! »

Yoast SEO Care$ 199 - Buy now » Info

Change URLs during relaunch or not

Read the transcript of the video to learn more:

“I would always, if you can, keep the URLs exactly the way the are. Even if you’re changing the names of your products. Only if it’s really weird for people, then I would change them on a product by product basis. But if you can, keep the URLS the same, so you don’t have to redirect them. Because people will have links pointing to these existing URLs. Redirection can always cause errors, because you can make a mistake somewhere, or you might lose stuff. So if you can prevent having to redirect it all, I would not redirect.

Good luck!”

Ask Yoast

Not sure how to solve an SEO issue on your site? Get help by asking your question to Ask Yoast! n the series we answer SEO questions from followers! Need help with SEO? Send your question to ask@yoast.com.

Read more: ‘SEO friendly URLs’ »

How to change your WordPress permalink structure

At Yoast, whenever we do a website review, we frequently recommend people change their permalink structure. In this post, we’ll explain why you should consider changing your permalink structure and how to go about it.

Why change your WordPress permalink structure?

A common thing we see in permalink structures are the usage of dates. For websites that post content that is related to current events, such as news sites, this makes perfect sense. However, for most blogs, the content is usually “timeless” as it tends to cover subjects that doesn’t relate to a specific date in time.

Using dates in your permalink structure also tends to have another side-effect, namely a lower CTR for older posts that may very well still be relevant. Whenever someone sees a result in Google with a date pointing back two years ago, they’ll be less likely to click that result. Seeing as Google uses this CTR for page rankings, it might be a very good idea to change your permalink structure to something more appealing to your visitors! If you want more information, you should read our post on WordPress SEO URL / Permalink considerations.

Get the most out of Yoast SEO, learn every feature and best practice in our Yoast SEO for WordPress training! »

Yoast SEO for WordPress training$ 99 - Buy now » Info

Changing WordPress permalink structure

There are two steps in changing your WordPress permalink structure. The first step is easy: go to Settings -> Permalinks and select Post name:

Changing your permalink settings

But what about all those old posts that still have dates in their permalink? With this handy tool, you can easily have a redirect generated that can be placed in your .htaccess file. This will point posts using the old permalink structure, to the new one. 

Please note that the tool currently only supports Apache-based servers and not Nginx.

After copying the redirect over to your .htaccess file, you should go out and test if everything is working properly. If the redirect doesn’t seem to be working, it could mean that you’re not allowed to use RedirectMatch on your Apache server.

If you don’t have proper rights to edit your .htaccess file or can’t use RedirectMatch, you can also consider using our Yoast SEO Premium plugin. The built-in Redirect Manager will automatically create a redirect for you whenever you alter the permalink of a post to reflect the newly chosen structure.

Read more: ‘WordPress SEO: the ultimate tutorial’ »

SEO basics: What’s a slug and how to optimize it

In SEO, we often talk about creating the right slug for a page. But what is this really? And why should you optimize it? In this post, we’ll explain all you need to know about it.

When you google “what’s a slug”, you’ll find that the definition we’re looking for is “a part of a URL which identifies a particular page on a website in a form readable by users.” It’s the nice part of the URL, which explains the page’s content. In this article, for example, that part of the URL simply is ‘slug’.

WordPress slugs

In WordPress, it’s the editable part of your URL that you can edit when writing a new post. Note that this only works with the right permalink settings. It looks like this:

slug-slug

If you have added more variables to your URL, we’re still talking about just that editable part of the URL to the page, like this:

slug-ocw

There’s an additional value at the end of that URL. In this case, that extra variable is used so slugs can be the same without the URL being the same. I think these examples clearly show what the slug we are talking about is.

New to SEO? Learn the Basics of SEO in our Basic SEO course »

Basic SEO training$ 199 - Buy now » Info

Optimizing your slug

What are the things you need to think of when constructing the right slug for your post or page? Let’s go over a number of characteristics you need to take into account:

No stop words

Filter our all the unnecessary words. Filter out “a”, “the” and “and” and similar words. We have written a tad bit more on stop words in our WordPress SEO article. For users of our Yoast SEO plugin: you might have noticed we filter stop words out by default.

Add focus

Don’t just filter out stop words, but really all the words that you don’t need. Make sure the slug still makes sense though. In the case of this post, WordPress automatically creates the slug “what-s-a-slug-and-how-to-optimize-it” (based upon the permalink settings in WordPress), which I manually reduced to “slug”.

There is one thing to keep in mind here. “Slug” as a subject is not likely to get another page on its own on our blog. This informative article will most probably remain the central point for information about slugs on our website. So I can reduce the slug to just “slug” for that reason. If this was an additional post to a main article, it would probably have been something like “optimize-slug” (and I wouldn’t have explained what it is, for that matter). So, do consider the page’s level or position on your website.

Keep it short, but descriptive

The URL of your page is shown in Google search results. Not always, sometimes it’s for instance replaced with breadcrumbs (awesome). When it’s shown, Google highlights the matching words from the search query:

url-in-search-result-pages-2

So you need to keep that in mind as well. Next to this, a short slug, right after the domain, will allow Google to show these keywords it in its mobile search result pages as well.

Now go optimize your slug with these three things in mind!

Read more: ‘SEO basics: what does Google do?’ »

rel=canonical: the ultimate guide

A canonical URL lets you tell search engines that certain similar URLs are actually the same. Sometimes you have products or content that can be found on multiple URLs – or even multiple websites, but by using canonical URLs (HTML link tags with the attribute rel=canonical), you can have these on your site without harming your rankings.

The rel=canonical element, often called the “canonical link”, is an HTML element that helps webmasters prevent duplicate content issues. It does this by specifying the “canonical URL”, the “preferred” version of a web page – the original source, even. Using it well improves a site’s SEO.

The idea is simple: if you have several similar versions of the same content, you pick one “canonical” version and point the search engines at it. This solves the duplicate content problem where search engines don’t know which version of the content to show in their results. This article takes you through how and when to use them, and how to avoid common mistakes.

The SEO benefit of rel=canonical

Choosing a proper canonical URL for every set of similar URLs improves the SEO of your site. This is because the search engine knows which version is canonical, so it can count all the links pointing at all the different versions as links to the canonical version. Setting a canonical is similar in concept to a 301 redirect, only without actually redirecting.

History of rel=canonical

In February 2009 Google, Bing and Yahoo! introduced the canonical link element – if you want to learn about its history, Matt Cutts’ post gives the clearest explanation. While the idea is simple, the specifics of how to use it are often complex.

The process of canonicalization

Ironic side note

The term Canonical comes from from the Roman Catholic tradition, where a list of sacred books was created and accepted as genuine and named the canonical Gospels of the New Testament. The irony is it took the Roman Catholic church about 300 years and numerous fights to come up with the canonical list, and they eventually chose four versions of the same story…

When you have several choices for a product’s URL, canonicalization is the process of picking one of them. In many cases, it’ll be obvious: one URL will be a better choice than others. In some cases, it might not be as obvious, but even then it’s still pretty simple: just pick one! Not canonicalizing your URLs is always worse than canonicalizing your URLs.

How to set canonical URLs

Correct example of using rel=canonical

Let’s assume you have two versions of the same page, each with exactly – 100% – the same content. The only difference is that they’re in separate sections of your site and because of that the background color and the active menu item are different – that’s it. Both versions have been linked to from other sites, so the content itself is clearly valuable. So which version should search engines show in results?

For example, these could be their URLs:

  • http://example.com/wordpress/seo-plugin/
  • http://example.com/wordpress/plugins/seo/

This is what rel=canonical was invented for and, unfortunately, this happens fairly often, especially in a lot of e-commerce systems. A product can have several different URLs depending on how you got there. In this case you would apply rel=canonical as follows:

  1. Pick one of your two pages as the canonical version. This should be the version you think is the most important. If you don’t care, pick the one with the most links or visitors, and if all else is equal, flip a coin. You just need to choose.
  2. Add a rel=canonical link from the non-canonical page to the canonical one. So if we picked the shortest URL as our canonical URL, the other URL would link to the shortest URL in the <head> section of the page – like this:
    <link rel="canonical" href="http://example.com/wordpress/seo-plugin/" />

    That’s it. Nothing more, nothing less.

What this does is “merge” the two pages into one from a search engine’s perspective. It’s a “soft redirect”, without redirecting the user. Links to both URLs now count as the single, canonical version of the URL.

Setting the canonical in Yoast SEO

Our Yoast SEO WordPress plugin lets you change the canonical of several page types in the plugin settings. You only need to do this if you want to change the canonical to something different from the current page’s URL. Yoast SEO already renders the correct canonical URL for almost any page type in a WordPress install.

For posts, pages, and custom post types, you can edit the canonical in the advanced tab of the Yoast SEO metabox:Setting a canonical in Yoast SEO

For categories, tags and other taxonomy terms, you can change them in the same place in the Yoast SEO metabox too. If you have other advanced use cases, you can also use the wpseo_canonical filter to change the Yoast SEO output.

When should you use canonical URLs?

301 redirect or canonical?

If you are unsure whether to do a 301 redirect or set a canonical, what should you do? The answer is simple: you should always do a redirect, unless there are technical reasons not to. If you can’t redirect because that would harm the user experience or be otherwise problematic, then set a canonical URL.

Should a page have a self-referencing canonical URL?

In the example above, we link the non-canonical page to the canonical version. But should a page set a rel=canonical for itself? This question is a much-debated topic amongst SEOs. At Yoast, we strongly recommend having a canonical link element on every page and Google has confirmed that’s best. That’s because most CMS’s will allow URL parameters without changing the content. So all of these URLs would show the same content:

  • http://example.com/wordpress/seo-plugin/
  • http://example.com/wordpress/seo-plugin/?isnt=it-awesome
  • http://example.com/wordpress/seo-plugin/?cmpgn=twitter
  • http://example.com/wordpress/seo-plugin/?cmpgn=facebook

The issue is that if you don’t have a self-referencing canonical on the page that points to the cleanest version of the URL, you risk being hit by this. If you don’t do it yourself, someone else could do it to you and cause a duplicate content issue, so adding a self-referencing canonical to URLs across your site is a good “defensive” SEO move. Luckily, our Yoast SEO plugin does this for you.

Cross-domain canonical URLs

Perhaps you have the same piece of content on several domains. There are sites or blogs that republish articles from other websites on their own, as they feel the content is relevant for their users. In the past, we had websites republishing articles from Yoast.com as well (with express permission), but if you had looked at the HTML of every one of those articles you’d found a rel=canonical link pointing right back to our original article. This means all the links pointing to their version of the article count towards the ranking of our canonical version. They get to use our content to please their audience, and we get a clear benefit from it too. Everybody wins.

Faulty canonical URLs: common issues

There are many examples out there of how a wrong rel=canonical implementation can lead to huge issues. I’ve seen several sites where the canonical on their homepage was pointed at an article, only to see their home page disappear from search results. There are other things you should never do with rel=canonical. Here are the most important:

    • Don’t canonicalize a paginated archive to page 1. The rel=canonical on page 2 should point to page 2. If you point it to page 1, search engines will actually not index the links on those deeper archive pages…
    • Make them 100% specific. For various reasons, many sites use protocol-relative links, meaning they leave the http / https bit from their URLs. Don’t do this for your canonicals. You have a preference, so show it.
    • Base your canonical on the request URL. If you use variables like the domain or request URL used to access the current page while generating your canonical, you’re doing it wrong. Your content should be aware of its own URLs. Otherwise, you could still have the same piece of content on – for instance – example.com and www.example.com and have each of them canonicalize to themselves.

    Multiple rel=canonical links on a page causing havoc. When we encounter this in WordPress plugins, we try to reach out to the developer doing it and teach them not to, but it still happens. And when it does, the results are wholly unpredictable.

    rel=canonical and social networks

    Facebook and Twitter honor rel=canonical too, and this might lead to weird situations. If you share a URL on Facebook that has a canonical pointing elsewhere, Facebook will share the details from the canonical URL. In fact, if you add a ‘like’ button on a page that has a canonical pointing elsewhere, it will show the like count for the canonical URL, not for the current URL. Twitter works in the same way.

    Advanced uses of rel=canonical

    Google also supports a canonical link HTTP header. The header looks like this:

    Link: <http://www.example.com/white-paper.pdf>; 
      rel="canonical"
    

    Canonical link HTTP headers can be very useful when canonicalizing files like PDFs, so it’s good to know that the option exists.

    Using rel=canonical on not so similar pages

    While I wouldn’t recommend this, you can definitely use rel=canonical very aggressively. Google honors it to an almost ridiculous extent, where you can canonicalize a very different piece of content to another piece of content. However, if Google catches you doing this, it will stop trusting your site’s canonicals and thus cause you more harm…

    Using rel=canonical in combination with hreflang

    We also talk about canonical in our ultimate guide to hreflang. That’s because it’s very important that when you use hreflang, each language’s canonical points to itself. Make sure that you understand how to use canonical well when you’re implementing hreflang, as otherwise you might kill your entire hreflang implementation.

    Conclusion: rel=canonical is a power tool

    Rel=canonical is a powerful tool in an SEO’s toolbox, but like any power tool, you should use it wisely as it’s easy to cut yourself. For larger sites, the process of canonicalization can be very important and lead to major SEO improvements.

    Read more: Duplicate content: causes and solutions »

The post rel=canonical: the ultimate guide appeared first on Yoast.