What is the proper syntax for rel="canonical" ??
-
I believe the proper syntax is like this [taken from the SEOMoz homepage]:
However,
one of the sites I am working on has all of their canonical tags set up like this:
I should clarify, not all of their canonicals are identical to this one, they simply use this naming convention, which appears to be relative URLs instead of absolute.
Doesn't the entire URL need to be in the tag? If that is correct, can you also provide me with an explanation that I can give to management please? They hate it when I say "Because I said so!" LOL
-
Thanks Dr. Pete! An you know what? You are absolutely right. Google has interpreted the canonical just that way and it's been in our GWT reports forever and no one could figure out where they were coming from.
Thank you, thank you, thank you (in my Gomer Pyle voice, of course!)
Wow, it's amazing how fixing one thing can sometimes take you down a whole nother road and fix something else at the same time. I just can't thank both you and George enough.
Kudos to George on a great answer.
-
Endorsing George for the full thread. Technically, Google does allow relative URLs, but I've heard of some odd issues, so I think it's better to use full URLs. Your home-page version isn't really either an absolute or relative URL - you really should have the "http://" (protocol) in that URL. If you're being nitpicky, that's an improper URL, and Google could end up interpreting it as something like:
http://www.ccisolutions.com/www.ccisolutions.com
Now, odds are, they won't, but with these tags it's really best to do it by the book.
-
No problem, glad to help!
-
Agreed. I think if we can change the Storefront to storefront without having to employ any kinds of redirects it would be great. Otherwise, the site is so old, that it may not matter.
Along those lines, we recently had the opportunity to remove /Storefront from the URL string. We chose not to because the site is 10 years old and didn't want to risk losing any page or domain authority by having a whole bunch of 301 redirects.
Certainly interested to know your take from the viewpoint of someone who knows code. Thanks George!
-
Yes, you are correct. But only if you have a base link in the document:
<base href="http://www.ccisolutions.com/">
This is a very good example for why you may want to stick to Absolute URLs. With an absolute URL you only need to know the actual URL of the page:
Hopefully I'm not adding even more to the fire, but now might be a good time to change "StoreFront" to "storefront" all lowercase. I think lowercase URLs are better if you can use them.
-
Thanks so very much George for your thorough answer. This is exactly what I needed know, and it makes it possible for me to explain it to the CEO. It appears we have a confusing mixture of absolute and relative URLs, that need to be sorted out. I think sticking with the absolutes will makes it much easier.
While we have this on the home page:
This is an example of a category page canonical tag:
Would I be correct is saying that there is a problem here because the actual URL of the page is
http://www.ccisolutions.com/StoreFront/category/wireless-microphones
So if we are going to use the relative URL in our canonical tag, it should be:
Is that correct?
-
Also just to clarify, when you state they are using "relative" URLs, are you talking about "www.ccisolutions.com/page1.html" vs. "http://www.ccisoultions.com/page1.html"?
If this is true, then both versions are absolute URLs. A relative URL is different. Here are a few examples of relative URLs:
page1.html
/products/page1.html
../products/page1.html
../images/image1.jpg
/images/image1.jpg
image1.jpg
Each of the above are "relative links". Absolute links look like the following and don't necessarily need the "http://":
www.ccisolutions.com/products/page1.html
http://www.ccisolutions.com/products/page1.html
Hope this helps too.
-
Document refers to the single web page you are placing the canonical link on.
The base link is referring to the URL you can provide as the href property for the base tag. The base tag can be included in the head of your HTML document.
Example base link:
<base href="http://www.ccisolutions.com/">
If you choose to use the example base link above and this relative URL:
Your canonical link will end up referring to “http://www.ccisolutions.com/page1.html”.
Here is a second example, this time using a new base link which includes the products directory:
<base href="http://www.ccisolutions.com/products/">
If you choose to use this new base link and the following relative URL:
Your canonical link will end up referring to “http://www.ccisolutions.com/products/page1.html”.
If you choose to use this new base link and this relative URL:
Your canonical link will actually refer to one-level-up from your base link or “http://www.ccisolutions.com/page1.html”. I'm not sure if you're familiar with the syntax "../" (dot dot slash), but it means to go up one level from the current directory.
The use of base links for canonical linking might be useful for a CMS where the content is generally dynamically created. It might be good to sit down with your developers and discuss which tactic would be best for the site in question.
I am including a link to this SEOmoz blog post in case it is also of help.
Edit: expanded on the explanations...
-
Thanks George. Can you help me with what this means on a large site "
If your document specifies a base link, any relative links
will be relative to that base link." ? Does "document" refer to the entire site, or a single Web page? Thanks!
-
Hello Dana,
I suggest reading this over: http://support.google.com/webmasters/bin/answer.py?hl=en&answer=139394
Midway down the page, Google states:
Can the link be relative or absolute?
rel="canonical"
can be used with relative or absolute links, but werecommend using absolute links to minimize potential confusion or
difficulties. If your document specifies a base link, any relative links
will be relative to that base link.
Hope this helps!
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Call for Help. Hit Badly with "Medic" and another 30% Loss with Sept 28th Update
Hi Everyone, I am not sure how this is all happening. We have been online for about 15 years, and now we are at our lowest amount of traffic in about 10 years. Our sites are www.bestpricenutrition.com and www.mysupplementstore.com. We sell commodity items, but I have focused on unique product descriptions, tons of UGC, blog posts and guides for awhile now and it has always done us well. Until as of late. This is what I feel led up to this, but I am hoping there is something I missed. May 1st, 2018: Migrated www.bestpricenutrition.com and www.mysupplementstore.com from Shopify. Similar sites, but almost all unique content. We purchased www.mysupplementstore.com about 8 years ago. A ton of traffic and sales, which is why we didn't just redirect it. Around May 25th: www.mysupplementstore.com took a big hit and lost almost 40% of its traffic. Nothing happened to www.bestpricenutrition.com, we actually increased traffic. Aug 1st Update: www.mysupplementstore.com lost another 25% of its traffic. www.bestpricenutrition.com lost about 40% of it's traffic. Sept 28th: Nothing happened to www.mysupplementstore.com, but www.bestpricenutrition.com lost another 30% of it's traffic. So I have been trying to figure out if there is anything technically wrong, but doesn't seem so. These are issues we discovered in August. During the migration, the reviews from each site were syndicated to both websites. There were 1000's. This was resolved in mid August. During the migration, the company doing the migration pushed our blog posts to both websites. 100's of blog posts duplicated to each website. This was resolved mid August. We found that a disgruntled employee instead writing unique content for our product pages, she was copying them one from another. This was about 100 product pages, which we have since resolved. What's Left I noticed on www.bestpricenutrition.com that we have 100's of blog posts that are getting hardly any traffic. I had trimmed www.mysupplementstore.com of this low traffic content. I am working on www.bestpricenutrition.com still. I have been in this industry since 2003, survived 2012, but have exhausted everything I know to figure this out. It's another sob story I know, but trying to keep everyone's job alive here, but it doesn't look like it's going to happen. Any help would be greatly appreciated.
Intermediate & Advanced SEO | | vetofunk0 -
How to answer for question "why xyz site is ranking for abc keyword" and not our website
Hi All, This is a layman question but would like to get a concrete answer for. I would like to know how to answer the questions like "Why our competitor is ranking for keyword ABC but not us"? What metrics or data can I showcase that gives logical answer. Please help in this regard. Thanks!
Intermediate & Advanced SEO | | Avin1230 -
Need help understanding "Clone sites"
I just read an article about Panda and it warned against against Clone sites: "Clone sites are a strong panda factor (JM, Mar 10, 2014)" I don't have any clone sites, but there are dozens of sites with imitations of mine. We were the first in the area of interest, and then all these other sites that imitated us popped up. None are exact replicas. But many have spun some of our articles and used them to create their sites; the site structures are not identical though. Google seems to know we are the original site on the topic since we are ranked #1 for most terms. Would these be considered clone sites in their eyes?
Intermediate & Advanced SEO | | bizzer0 -
Google's form for "Small sites that should rank better" | Any experiences or results?
Back in August of 2013 Google created a form that allowed people to submit small websites that "should be ranking better in Google". There is more info about it in this article http://www.seroundtable.com/google-small-site-survey-17295.html Has anybody used it? Any experiences or results you can share? *private message if you do not want to share publicly...
Intermediate & Advanced SEO | | GregB1230 -
Rel="canonical" questions?
On our site we have some similar pages for example in our parts page we have the link to all the electrical parts you can see here http://www.rockymountainatvmc.com/c/43/53/160/Electrical and we have a very similar page going from our accessories page to electrical here http://www.rockymountainatvmc.com/c/43/72/221/Electrical We are thinking about putting rel="canonical" from the accessories electrical page to the parts one. We would do this for several pages not just this one. Thoughts???
Intermediate & Advanced SEO | | DoRM0 -
Trailing slash and rel="canonical"
Our website is in a directory format: http://www.website.com/website.asp Our homepage display URL is http://www.website.com which currently matches our to eliminate the possibility of duplicate content. However, I noticed that in the SERPs, google displays the homepage with a trailing slash http://www.website.com/ My question: should I change the rel="canonical" to have a trailing slash? I noticed one of our competitors uses the trailing slash in their rel="canonical" Do potential benefits outweigh the risks? I can PM further information if necessary. Thanks for the assistance in advance...
Intermediate & Advanced SEO | | BethA0 -
Rel=canonical tag on original page?
Afternoon All,
Intermediate & Advanced SEO | | Jellyfish-Agency
We are using Concrete5 as our CMS system, we are due to change but for the moment we have to play with what we have got. Part of the C5 system allows us to attribute our main page into other categories, via a page alaiser add-on. But what it also does is create several url paths and duplicate pages depending on how many times we take the original page and reference it in other categories. We have tried C5 canonical/SEO add-on's but they all seem to fall short. We have tried to address this issue in the most efficient way possible by using the rel=canonical tag. The only issue is the limitations of our cms system. We add the canonical tag to the original page header and this will automatically place this tag on all the duplicate pages and in turn fix the problem of duplicate content. The only problem is the canonical tag is on the original page as well, but it is referencing itself, effectively creating a tagging circle. Does anyone foresee a problem with the canonical tag being on the original page but in turn referencing itself? What we have done is try to simplify our duplicate content issues. We have over 2500 duplicate page issues because of this aliasing add-on and want to automate the canonical tag addition, rather than go to each individual page and manually add this tag, so the original reference page can remain the original. We have implemented this tag on one page at the moment with 9 duplicate pages/url's and are monitoring, but was curious if people had experienced this before or had any thoughts?0 -
"Original Content" Dynamic Hurting SEO? -- Strategies for Differentiating Template Websites for a Nationwide Local Business Segment?
The Problem I have a stable of clients spread around the U.S. in the maid service/cleaning industry -- each client is a franchisee, however their business is truly 'local' with a local service area, local phone/address, unique business name, and virtually complete control over their web presence (URL, site design, content; apart from a few branding guidelines). Over time I've developed a website template with a high lead conversion rate, and I've rolled this website out to 3 or 4 dozen clients. Each client has exclusivity in their region/metro area. Lately my white hat back linking strategies have not been yielding the results they were one year ago, including legitimate directories, customer blogging (as compelling as maid service/cleaning blogs can really be!), and some article writing. This is expected, or at least reflected in articles on SEO trends and directory/article strategies. I am writing this question because I see sites with seemingly much weaker back link profiles outranking my clients (using SEOMoz toolbar and Site Explorer stats, and factoring in general quality vs. quantity dynamics). Questions Assuming general on-page optimization and linking factors are equal: Might my clients be suffering because they're using my oft-repeated template website (albeit with some unique 'content' variables)? If I choose to differentiate each client's website, how much differentiation makes sense? Specifically: Even if primary content (copy, essentially) is differentiated, will Google still interpret the matching code structure as 'the same website'? Are images as important as copy in differentiating content? From an 'machine' or algorithm perspective evaluating unique content, I wonder if strategies will be effective such as saving the images in a different format, or altering them slightly in Photoshop, or using unique CSS selectors or slightly different table structures for each site (differentiating the code)? Considerations My understanding of Google's "duplicate content " dynamics is that they mainly apply to de-duping search results at a query specific level, and choosing which result to show from a pool of duplicate results. My clients' search terms most often contain client-specific city and state names. Despite the "original content" mantra, I believe my clients being local businesses who have opted to use a template website (an economical choice), still represent legitimate and relevant matches for their target user searches -- it is in this spirit I ask these questions, not to 'game' Google with malicious intent. In an ideal world my clients would all have their own unique website developed, but these are Main St business owners balancing solutions with economics and I'm trying to provide them with scalable solutions. Thank You! I am new to this community, thank you for any thoughts, discussion and comments!
Intermediate & Advanced SEO | | localizedseo0