Canonical and Alternate Advice
-
At the moment for most of our sites, we have both a desktop and mobile version of our sites. They both show the same content and use the same URL structure as each other. The server determines whether if you're visiting from either device and displays the relevant version of the site.
We are in a predicament of how to properly use the canonical and alternate rel tags. Currently we have a canonical on mobile and alternate on desktop, both of which have the same URL because both mobile and desktop use the same as explained in the first paragraph.
Would the way of us doing it at the moment be correct?
-
That would normally be the case but not tonight.
LOL, I am picking up a lot of the UK Q&A I will be at BrightonSEO and search love London if any of you guys will be in the area I'd love to grab a pint?
sincerely,
Thomas
-
The reason we answered 'quickly' by the way is because we are in the UK - you were still in bed lol!
-
There is only ONE URL that is the point.
If they share the same URL then you only have one page of code so ONE canonical
Regards
Nigel
-
Sorry Nigel
was not trying to make this more complicated was just trying to make sure that we were all on the same page.
FYI if you need a method of adding the rel canonical to your website quickly you can use Google tag manager or if you want to add to the header
https://support.stackpath.com/hc/en-us/articles/360001445283-EdgeRules-Adding-a-Canonical-Header
-
So a self referencing canonical on both mobile and desktop versions of the site, regardless if they chuck out two version with the same content?
-
Hi JH
I'm sure Thomas means well with his multiple complicated posts but all of this is totally unnecessary.
Both sites are serving the same URL
You can't put a rel=alternative because there is nothing to point to.
Just put a self-referencing canonical. I said that 2 hours ago!
That is all.
Regards Nigel
-
Use a self-referencing canonical
https://blog.seoprofiler.com/google-recommend-self-referencing-canonical-tags/
Please let me know if you want me to remove the image below?
you can use this one if needed http://bseo.io/c1vMSv
-
I've been told to pass on a URL, thanks for your help Thomas!
-
Hey man I understand is a big deal
could you do me a huge favor and run your site through screaming frog SEO spider send me a couple of pages with the domains whited out so I can tell you 100% what to do in this situation because I am basing this on what you have told me and honestly I would like to look at what a tool can show me and that will tell me what I need to do.
Or you can tell me if the mobile version of the site hit's Google's index yes or no?
respectfully,
Tom
-
So both mobile and desktop require a self referencing canonical(in both headers)?
Sorry for the questions, just need to make sure! It's a very touchy subject!
-
The single self-referencing URL will work.
-
What URLs are you using with the “alternate” tag on?
You said
”1. We have multiple brand sites, that have a similar setup. They all have mobile and desktop versions of the sites running on the same URL, both of which show the same content.2. The server determines whether if you're on a desktop or mobile devices using the header information, and points the user to the site relevant files for the given device.”
thats Dynamic serving same URL
Dynamic serving is a setup where the server responds with different HTML (and CSS) on the same URL depending on which user agent requests the page (mobile, tablet, or desktop).
that would NOT give you the mobile or m.example.com & www.example.com different URLs
**But If you do have a different m.example.com & www.example.com URLs you should use this code or XML site maps **
for different URLs use this:
Annotations in the HTML
On the desktop page (http://www.example.com/page-1), add the following annotation:
<linkrel="alternate"media="only screen="" and="" (max-width:="" 640px)"<="" span="">href="http://m.example.com/page-1"></linkrel="alternate"media="only>
On the mobile page (http://m.example.com/page-1), the required annotation should be:
<linkrel="canonical"href="http: www.example.com="" page-1"=""></linkrel="canonical"href="http:>
This rel="canonical" tag on the mobile URL pointing to the desktop page is required.
Or
Annotations in sitemaps
We support including the rel="alternate"annotation for the desktop pages in sitemaps like this:
<urlsetxmlns="http: www.sitemaps.org="" schemas="" sitemap="" 0.9"<="" span="">xmlns:xhtml="http://www.w3.org/1999/xhtml">
<loc>http://www.example.com/page-1/</loc>
<xhtml:linkrel="alternate"media="only screen="" and="" (max-width:="" 640px)"<="" span="">href="http://m.example.com/page-1"/></xhtml:linkrel="alternate"media="only></urlsetxmlns="http:>You should have the same URL on mobile and desktop
You should have the same rel canonical tag on your URLs unless and this is a big unless you're talking about using Google AMP?
If the URL you want to be indexed is the same URL point everything to that URL if that makes it easier to understand.
respectfully,
Tom
-
Just to confirm, are we suppose to have a canonical on desktop and mobile or just desktop?
This would mean removing the alternate?
Want to confirm everything before iterating this across to others.
We are not using AMP, just a standard site setup.
-
Unless you are using AMP?
Then you would add
Linking pages with
In order to solve this problem, we add information about the AMP page to the non-AMP page and vice versa, in the form of tags in the .
Add the following to the non-AMP page:
<link rel="amphtml" href="https://www.example.com/url/to/amp/document.html">
And this to the AMP page:
<link rel="canonical" href="https://www.example.com/url/to/full/document.html">
are you using AMP pages?
https://support.google.com/webmasters/answer/139066?hl=en
https://www.ampproject.org/docs/fundamentals/discovery
I hope that helps you if not please let me know.
Respectfully,
Tom
-
Cool, that's what I thought when I heard your description I just wanted to be very thorough because sometimes you get very little information and I appreciate you letting me know that.
dynamic serving URLs are identical to each other so you should have a self-referencing canonical tag because the URL does not change the real canonical tag just decides what should be in the index and the same URL.
You're Rel canonical should be something like this example below
Example URL https://www.example.com/example-url/
because the end URL is the same and URL that you want to be indexed in Google you want to be certain that you have a self-referencing URL to prevent query strings and other things like that and you do not need to point a URL to an identical URL you just need a self-referencing canonical if that makes sense.
See: https://yoast.com/rel-canonical/
I hope that is of help,
Tom
-
Hi,
I can't give off too much information as it's not my call, but I can answer your questions without mentioning the brands.
1. We have multiple brand sites, that have a similar setup. They all have mobile and desktop versions of the sites running on the same URL, both of which show the same content.
2. The server determines whether if you're on a desktop or mobile devices using the header information, and points the user to the site relevant files for the given device.
3. Our sites would quite clearly fit in the dynamic serving category.
We have 301 redirects on none www to www and http to https.
-
This is the correct solution!
-
The URLs are identical it is just the content that is served that may be slightly different.
Since you can only specify one canonical for each URL it makes no difference. Just self-reference and that is it.
If you had to different URLs then it would be an issue where you woudl need a rel=alternative so there is nothing to worry about.
Regards
Nigel
-
You guys are fast I was going to answer this and had to do some other things but let me weigh in on couple things.
as you said
“We are in a predicament of how to properly use the canonical and alternate rel tags**. Currently we have a canonical on mobile and alternate on desktop, both of which have the same URL because both mobile and desktop use the same as explained in the first paragraph.”**
so what you’re saying is that you have a dynamic site so you don’t need to add “alternate"media” tags to the site.
https://developers.google.com/search/mobile-sites/mobile-seo/dynamic-serving
As it is not immediately apparent in this setup that the site alters the HTML for mobile user agents (the mobile content is "hidden" when crawled with a desktop user agent), it’s recommend that the server send a hint to request that Googlebot for smartphones also crawl the page, and thus discover the mobile content. This hint is implemented using the Vary HTTP header.
**you don’t need this **
Annotations in the HTML
On the desktop page (
http://www.example.com/page-1
), add the following annotation:<code dir="ltr"><linkrel="alternate"media="only screen="" and="" (max-width:="" 640px)"<br="">href="http://m.example.com/page-1"></linkrel="alternate"media="only></code>
On the mobile page (
http://m.example.com/page-1
), the required annotation should be:<code dir="ltr"><linkrel="canonical"href="http: www.example.com="" page-1"=""></linkrel="canonical"href="http:></code>
This
rel="canonical"
tag on the mobile URL pointing to the desktop page is required.Annotations in sitemaps
We support including the
rel="alternate"
annotation for the desktop pages in sitemaps like this:<code dir="ltr"><urlsetxmlns="http: www.sitemaps.org="" schemas="" sitemap="" 0.9"<br="">xmlns:xhtml="http://www.w3.org/1999/xhtml"> <url><loc>http://www.example.com/page-1/</loc> <xhtml:linkrel="alternate"media="only screen="" and="" (max-width:="" 640px)"<br="">href="http://m.example.com/page-1"/></xhtml:linkrel="alternate"media="only></url></urlsetxmlns="http:></code>
The required
rel="canonical"
tag on the mobile URL should still be added to the mobile page's HTML.**to be sure **
Are you willing to share your domain with us? Or one domain?
-
We're talking about multiple websites that all have the identical site structure or at least mobile and desktop site structure?
-
Your server is making the change for you?
-
Would you be kind enough to install this plug-in on chrome in order for you to show a couple examples of the canonical and the URL?
- https://chrome.google.com/webstore/detail/portents-seo-page-review/babgchcegnkbiojmdpnoilficladccfm?hl=en-US
- https://chrome.google.com/webstore/detail/link-redirect-trace/nnpljppamoaalgkieeciijbcccohlpoh?hl=en
In addition, would you be kind enough to run your site through the two tools here ( 100% free and very easy to use)
If you would not mind doing this and sending screenshots it would mean a lot to us and getting your canonical's straightened out.
screenshots https://snag.gy/ then upload to http://imgur.com/
everything is on the same server I'm assuming?
Of the three below how would you categorize your site?
- https://developers.google.com/search/mobile-sites/mobile-seo/separate-urls
- https://developers.google.com/search/mobile-sites/mobile-seo/dynamic-serving
- https://developers.google.com/search/mobile-sites/mobile-seo/responsive-design
Respectfully,
Tom
-
-
Would this mean we need canonical only on desktop or mobile site?
-
You are right - you could only use teh rel=alternate if there was an m. version or similar
Regards
Nigel
-
The self referencing canonical advice was solid and I 100% agree with it. The rel=alternate advice, I felt would cause problems (IMO). But as we all know, fiddly issues like this are highly subjective
-
Then there is no problem simply putting a self-referencing canonical. There is in effect no mobile version as there is a single URL so no need for a rel=alternate.
It's an even easier solution. Well, there isn't a problem in the first place.
rel=alternate is only necessary if you have two different URLs! The fact they are the same takes away the problem.
Regards
Nigel
-
Your problem is that you have two different sites loading on the same URL. If you are returning both the mobile and desktop / laptop site on the same URL, you would be expected to be using responsive design. In-fact, you may have re-invented another different way to implement responsive design which is probably, slightly less fluid yet slightly more efficient :')
Since your mobile and desktop pages both reside on exactly the same URL, I'd test the page(s) with this tool (the mobile friendly tool) and this tool (the page-speed insights tool). If Google correctly views your site as mobile friendly, and if within PageSpeed insights Google is correctly differentiating between the mobile and desktop site versions (check the mobile and desktop tabs) then both URLs should canonical to themselves (self referencing canonical) and no alternate tag should be used or deployed. Google will misread the alternate tag, which points to itself - as an error. That tag is to be used when your separate mobile site (page) exists on a separate URL, like an 'm.' subdomain or something like that
Imagine you are Googlebot. You are crawling in desktop mode, load the desktop URL version and find that the page says, it (itself) is also the mobile page. You'd get really confused
Check to see whether your implementation is even supported by Google using the tools I linked you to. If it is, then just use self referencing canonical tags and do not deploy alternate tags (which would make no sense, since both versions of the site are on the same URL). When people build responsive sites (same source code on the same URL, but it's adaptive CSS which re-organises the contents of the page based upon viewport widths) - they don't use alternate tags, only canonicals
Since your situation is more similar to responsive design (from a crawling perspective) than it is to separate mobile site design, drop the alt
-
The problem with this is, where you say "corresponding mobile URL" - there isn't one as OP has stated that, two different source codes (pages) can be rendered on the same URL depending upon the user's screen size / user-agent (however they are detecting mobile, and serving different pages)
-
Hi JH
This is very straightforward.
Use the following annotations:
- On the desktop page, add a rel=”alternate” tag pointing to the corresponding mobile URL. This helps Googlebot discover the location of your site’s mobile pages.
- On the mobile page, add a link rel=”canonical” tag pointing to the corresponding desktop URL.
It is that simple and doing this will not create duplicate content
More here: https://developers.google.com/search/mobile-sites/mobile-seo/separate-urls
Regards Nigel
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
-
Rel=canonical Question
Alright, so let's say we've got an event coming up. The URL is website.com/event. On that page, you can access very small pages with small amounts of information, like website.com/event/register, website.com/event/hotel-info, and website.com/event/schedule. These originally came up as having missing meta descriptions, and I was thinking a rel=canonical might be the best approach, but I'm not sure. What do you think? Is there a better approach? Should I have just added a meta description and moved on?
Intermediate & Advanced SEO | | MWillner0 -
Copied Content - Define Canonical
Hello, The Story I am working on a news organization. Our website is the https://www.neakriti.gr My question regards copied content with source references. Sometimes a small portion of our content is based on some third article that is posted on some site (that is about 1% of our content). We always put "source" reference if that is the case. This is inevitable as "news" is something that sometimes has sources on other news sites, especially if there is something you cannot verify or don't have immediate sources, and therefore you need to state that "according to this source, something has happened". Here is one article of ours that has a source from another site: https://www.neakriti.gr/article/ellada-nea/1503363/nekros-vrethike-o-agnooumenos-arhimandritis-stin-lakonia/ if you open the above article you will see we have a link to the equivalent article of the original source site http://lakonikos.gr/epikairothta/item/133664-nekros-entopistike-o-arximandritis-p-andreas-bolovinos-synexis-enimerosi Now here is my question. I have read in other MOZ forum articles that a "canonical" approach solves this issue... How can we be legit when it comes to duplicate content in the eyes of search engines? Should we use some kind of canonical link to the source site? Should the "canonical" be inside the link in some way? Should it be on our section? Our site has AMP equivalent pages (if you add the /amp keyword at the end of the article URL). Our AMP pages have canonical to our original article. So if we have a "canonical" approach how would the AMP be effected as well? Also by applying a possible canonical solution to the source URL, does that "canonical" effect our article as not being shown in search results, thus passing all indexing to the canonical site? (I know that canonical indicates what URL is to be indexed). Additionally, does such a canonical indication make us legit in such a case in the eyes of search engines? (i.e. it eliminates any possible article duplication for original content in the eyes of search engines?). Or simply put, having a simple link to the original article (as we have it now) is enough for the search engines to understand that we have reference to original article URL? How would we approach this problem in our site based on its current structure?
Intermediate & Advanced SEO | | ioannisanif0 -
Canonical Tags increased after putting the appropriate tag?
Hey, I noticed that the number of duplicate title tags increased from 14k to 30k in Google Search Console. These dup title tags derived from having the incorrect canonical tags. For instance, http://www.site.com/product-name/product-code/?d=Mens
Intermediate & Advanced SEO | | ggpaul562
http://www.site.com/product-name/product-code/?d=Womens These two are the same exact pages with two parameters (These are not unisex by the way). Anyway, when I viewed the page source, it had the parameter in the canonical tag so.... it would look like this So whether it be http://www.site.com/product-name/product-code/
http://www.site.com/product-name/product-code/?d=Mens
http://www.site.com/product-name/product-code/?d=Womens The canonical tag had the "?d=Womens" I figured that wasn't best practices, so for the canonical tag I removed the parameter so now the canonical tag is http://www.site.com/product-name/product-code/ for that specific page with parameter (if that makes sense). My question is, why did my number of errors doubled after what I thought fixed the solution?0 -
Why isn't the rel=canonical tag working?
My client and I have a problem: An ecommerce store with around 20 000 products has nearly 1 000 000 pages indexed (according to Search Console). I frequently get notified by messages saying “High number of URLs found” in search console. It lists a lot of sample urls with filter and parameters that are indexed by google, for example: https://www.gsport.no/barn-junior/tilbehor/hansker-votter/junior?stoerrelse-324=10-11-aar+10-aar+6-aar+12-aar+4-5-aar+8-9-aar&egenskaper-368=vindtett+vanntett&type-365=hansker&bruksomraade-367=fritid+alpint&dir=asc&order=name If you check the source code, there’s a canonical tag telling the crawler to ignore (..or technically commanding it to regard this exact page as another version of the page without all the parameters) everything after the “?” Does this url showing up in the Search Console message mean that this canonical isn’t working properly? If so: what’s wrong with it? Regards,
Intermediate & Advanced SEO | | Inevo
Sigurd0 -
Canonical Tags being indexed on paginated results?
On a website I'm working on which has a search feature with paginated results, all of the pages of the search results are set with a canonical tag back to the first page of the search results, however Google is indexing certain random pages within the result set. I can literally do a search in Google and find a deep page in the results, click on it and view source on that page and see that it has a canonical tag leading back to the first page of the set. Has anyone experienced this before? Why would Google not honor a canonical tag if it is set correctly? I've seen several SEO techniques for dealing with pagination, is there another solution that you all recommend?
Intermediate & Advanced SEO | | IrvCo_Interactive0 -
URL Question and Advice on Site Architecture
Good morning one and all, i have a specific question pertaining to my Domain Migration Website URL structure. I have a computer repair business that I am re branding and my question at this point is centrally focused on how to best handle my URL naming structure that will best suite my needs for my the Search Engines and also my customers UX while not looking SPAMMY I am a web developer and SEO and I am building a SILO Site Architecture in WordPress using Pages (not Posts) so no discussion is need on the Permalink structure. I am attaching several Images below of Screen Shots of the new site that I have designed so that you may look at them and see the Silo Architecture Layout in action for the most part. OK, here we go. Looking at the Silo Mast Head, we can see that the following Main Menu items each represent a specific Silo Theme Silo Theme # 1 - COMPUTER REPAIR Silo Theme # 2 - VIRUS REMOVAL Silo Theme # 3 - PHONE REPAIR Silo Theme # 4 - NETWORKING Silo Theme # 5 - DATA RECOVERY My specific question is, if /computer-repair/ is a main silo theme (WP -Parent Page) and /laptop-repair/ is a (Child Page) of Computer Repair is the following example below (the actual URL string) going to 'trigger' a SPAM signal to either the user or GOOGLE or both?? URL String: http://www.pcmedicsoncall.com/computer-repair/laptop-repair/ Here's another example with the VIRUS REMOVAL SILO http://www.pcmedicsoncall.com/virus-removal/malware-removal/ Seeing how computer repair is the main silo theme that cannot be changed in the URL Structure (it can) but I wont change it seeing how COMPUTER REPAIR is the single largest keyword phrase used by individuals when they are looking for computer repair. Secondly, - LAPTOP REPAIR is also a Keyword Phrase that that has HIGH search queries that I am trying to rank for and that too (ideally) should also not changed! How do I deal with this situation? Or, am I seeing this in a overly paranoid way? I currently have the site allowing only my IP Address so I am afraid that the screen shots below is all that I can do on this in lieu of actually visiting the Site Currently, I have my URL Structure where Wilmington NC immediately follows the targeted keyword phrase for the Silo Theme like below http://www.pcmedicsoncall.com/virus-removal-wilmington-nc/malware-removal/ The example above, - including the location after the keyword phrase does look much more attractive and breaks it up so it does not read SPAMMY and it will help with SEO but yet another problem exists using the location after the keyword phrase which I explain in detail Below. On top of doing a complete re-branding Domain Change I am actually going to be relocating myself and my business to Charlotte, NC at the end of the summer so I have serious doubts if using Wilmington NC within the URL structure would be a wise idea considering that I will be relocating and an internal 301 Redirect on a Newly Migrated site 2-3 months after the initial site migration and site setup may have some negative impact and confuse Google and compound the situation thus much further despite the fact that it would immediately help me bounce back up with my rankings after the migration process. Thoughts a suggestions on both explained scenarios please? I have asked this specif question once already but obviously people do not read my very detailed and well thought out questions. This can also be viewed here>http://www.seomoz.org/q/need-very-urgent-advice-on-wedsite-migration-questions-please#reply_150847> Thank you Sincerely, Marshall Thompson SEOMOZ-PC-MEDICS-ON-CALL-1.jpg SEOMOZ-PC-MEDICS-ON-CALL1.jpg
Intermediate & Advanced SEO | | MarshallThompson310 -
Do I need a canonical tag on the 404 error page?
Per definition, a 404 is displayed for different url (any not existing url ...). As I try to clean my website following SEOmoz pro advices, SEOmoz notify me of duplicate content on urls leading to a 404 🙂 This is I guess not that important, but just curious: should we add a cononical tag to the template returning the 404, with a canonical url such as www.mysite.com/404 ?
Intermediate & Advanced SEO | | nuxeo0 -
Hash as a Replacement for Absolute URL in Canonical Tags?
Any idea why companies like Skechers would be doing this: http://screencast.com/t/ooEkATGN7EX ? I suppose it makes sense, but I've never seen it done before. If this works, why on earth would we be using absolute URLs still?
Intermediate & Advanced SEO | | stevewiideman0