Moz Q&A is closed.
After more than 13 years, and tens of thousands of questions, Moz Q&A closed on 12th December 2024. Whilst we’re not completely removing the content - many posts will still be possible to view - we have locked both new posts and new replies. More details here.
What is the correct Canonical tag on m.site?
-
We have 2 separate sites for desktop (www.example.com) and mobile (m.example.com)
As per the guideline, we have added Rel=alternate tag on www.example.com to point to mobile URL(m.example.com) and Rel=canonical tag on m.example.com to point to Desktop site(www.example.com).However, i didn't find any guideline on what canonical tag we should add ifFor Desktop sitewww.example.com/PageA - has a canonical tag to www.example.com/PageBOn this page, we have a Rel=alternate tag m.example.com/pageAWhat will be the canonical we should add for the mobile version of Page Am.example.com/PageA - Canonical tag point to www.example.com/PageA -or www.example.com/PageB?Kalpesh
-
Hi, I hope this helps,
Do NOT point desktop pages to m. pages via a
rel="canonical" tags use rel="alternate" for that & make sure
rel="canonical"tag on the m. URL pointing to the corresponding desktop URL
Annotations for desktop and mobile URLs
- 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
rel="canonical"
tag pointing to the corresponding desktop URL.
We support two methods to have this annotation: in the HTML of the pages themselves and in sitemaps. For example, suppose that the desktop URL is
https://example.com/page-1
and the corresponding mobile URL ishttps://m.example.com/page-1
. The annotations in this example would be as follows.Annotations in the HTML
On the desktop page (
https://www.example.com/page-1
), add the following annotation:<code dir="ltr"><linkrel="alternate"media="only screen="" and="" (max-width:="" 640px)"<br="">href="https://m.example.com/page-1"></linkrel="alternate"media="only></code>
On the mobile page (
https://m.example.com/page-1
), the required annotation should be:<code dir="ltr"><linkrel="canonical"href="https: www.example.com="" page-1"=""></linkrel="canonical"href="https:></code>
This
rel="canonical"
tag on the mobile URL pointing to the desktop page is required.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? I strongly recommend having a canonical link element on every page and Google has confirmed that’s best. That’s because most Sites & CMS’s will allow URL parameters without changing the content.
So all of these URLs would show the same content:
-
https://www.example.com/page-1
-
https://www.example.com/page-1/?isnt=it-awesome
-
https://www.example.com/page-1/?cmpgn=twitter
-
https://www.example.com/page-1/?cmpgn=facebook
Using a mobile website version of their desktop version, they need to implement a canonical tag on their mobile website page with an URL of the desktop version.
For example,
Your main domain: iamexample.com
Your mobile version: m.iamexample.com
Then, have this tag in the section of your main domain -
And, have this tag in the section of your mobile version page -
Mobile-Specific URLs, Such as AMP Pages or a Mobile-Specific Subdomain
Creating content with mobile in mind is a marketing must -- just be sure to remember to set your canonical URLs when you have pages that are specific to mobile but have the same content as a page on the desktop version of your website. For AMP pages specifically, Google also provides detailed guidelines on how to correctly differentiate your Accelerated Mobile Page from your standard webpage.
SEE:
- https://developers.google.com/search/mobile-sites/mobile-seo/separate-urls
- https://yoast.com/rel-canonical/
- https://moz.com/blog/cross-domain-rel-canonical-seo-value-cross-posted-content
- https://moz.com/learn/seo/canonicalization
- https://moz.com/blog/rel-canonical
Hope this helps,
Tom
- On the desktop page, add a
-
You shouldn't have canonical tags on either pointing to the other IMO. A canonical tag, deployed on a web-page, says to Google "I am the non-canonical version of a page. Unless you have signals like links which contradict this tag strongly, don't index this non-canonical page at all. Only index the canonical URL which I am pointing you to"
So the page which you place the canonical tag on, becomes (itself) non canonical and therefore gives a medium-to-strong signal to Google that it should be de-indexed. As such, if you plaster your mobile site in canonical tags, you are essentially telling Google that the entire mobile site is non-canonical and thereby probably not a great candidate for indexation. Do you want your mobile site to rank? I assume you do
I don't know what guidance you have read. Google's guidance is often woefully out of date as their documentation update cycle for organic-search stuff is really poor. If it was something here on Moz, I personally disagree with it
I would just stick with the alternate tags. Anyway if you have canonicals going in two directions, you will create a soft redirect loop where both URLs specify themselves as non-canonical. That could make things way worse than they are now
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
-
If I'm using a compressed sitemap (sitemap.xml.gz) that's the URL that gets submitted to webmaster tools, correct?
I just want to verify that if a compressed sitemap file is being used, then the URL that gets submitted to Google, Bing, etc and the URL that's used in the robots.txt indicates that it's a compressed file. For example, "sitemap.xml.gz" -- thanks!
Technical SEO | | jgresalfi0 -
Do you need a canonical tag for search and filter pages?
Hi Moz Community, We've been implementing new canonical tags for our category pages but I have a question about pages that are found via search and our filtering options. Would we still need a canonical tag for pages that show up in search + a filter option if it only lists one page of items? Example below. www.uncommongoods.com/search.html/find/?q=dog&exclusive=1 Thanks!
Technical SEO | | znotes0 -
Seo For Forum Sites
I have forum site.I've opened it 2 months ago.But there is a problem.Therefore my content is unique , my site's keyword ranking constantly changing..Sometimes my site's ranking drops from first 500.After came to 70s. I didn't make any off page seo to my site.What is the problem ?
Technical SEO | | tutarmi0 -
Staging site and "live" site have both been indexed by Google
While creating a site we forgot to password protect the staging site while it was being built. Now that the site has been moved to the new domain, it has come to my attention that both the staging site (site.staging.com) and the "live" site (site.com) are both being indexed. What is the best way to solve this problem? I was thinking about adding a 301 redirect from the staging site to the live site via HTACCESS. Any recommendations?
Technical SEO | | melen0 -
Correct linking to the /index of a site and subfolders: what's the best practice? link to: domain.com/ or domain.com/index.html ?
Dear all, starting with my .htaccess file: RewriteEngine On
Technical SEO | | inlinear
RewriteCond %{HTTP_HOST} ^www.inlinear.com$ [NC]
RewriteRule ^(.*)$ http://inlinear.com/$1 [R=301,L] RewriteCond %{THE_REQUEST} ^./index.html
RewriteRule ^(.)index.html$ http://inlinear.com/ [R=301,L] 1. I redirect all URL-requests with www. to the non www-version...
2. all requests with "index.html" will be redirected to "domain.com/" My questions are: A) When linking from a page to my frontpage (home) the best practice is?: "http://domain.com/" the best and NOT: "http://domain.com/index.php" B) When linking to the index of a subfolder "http://domain.com/products/index.php" I should link also to: "http://domain.com/products/" and not put also the index.php..., right? C) When I define the canonical ULR, should I also define it just: "http://domain.com/products/" or in this case I should link to the definite file: "http://domain.com/products**/index.php**" Is A) B) the best practice? and C) ? Thanks for all replies! 🙂
Holger0 -
The Mysterious Case of Pagination, Canonical Tags
Hey guys, My head explodes when I think of this problem. So I will leave it to you guys to find a solution... My root domain (xxx.com) runs on WordPress platform. I use Yoast SEO plugin. The next page of root domain -- page/2/ -- has been canonicalized to the same page -- page/2/ points to page/2/ for example. The page/2/ and remaining pages also have this rel tags: I have also added "noindex,follow" to page/2/ and further -- Yoast does this automatically. Note: Yoast plugin also adds canonical to page/2/...page/3/ automatically. Same is the case with category pages and tag pages. Oh, and the author pages too -- they all have self-canonicalization, rel prev & rel next tags, and have been "noindex, followed." Problem: Am I doing this the way it should be done? I asked a Google Webmaster employee on rel next and prev tags, and this is what she said: "We do not recommend noindexing later pages, nor rel="canonical"izing everything to the first page." (My bad, last year I was canonicalizing pages to first page). One of the popular blog, a competitor, uses none of these tags. Yet they rank higher. Others following this format have been hit with every kind of Google algorithm I could think of. I want to leave it to Google to decide what's better, but then again, Yoast SEO plugin rules my blog -- okay, let's say I am a bad coder. Any help, suggestions, and thoughts are highly appreciated. 🙂 Update 1: Paginated pages -- including category pages and tag pages -- have unique snippets; no full-length posts. Thought I'd make that clear.
Technical SEO | | sidstar0 -
Header Tags
Ok so I am writing different pages and the first heading is an H3 just because I wanted to it be a certain size. Then as you see the content, I have an H1 tag. Example page: http://www.oxfordmshomes.net/condos/acadia-court-Oxford-MS you can see that "Acadia First" is the first thing you see on the page and it uses an H3 element. Long story short, my hierarchy is wrong. Does this have any negative effect on my SEO efforts?
Technical SEO | | blake-766240 -
What are the pros and cons of moving one site onto a subdomain of another site?
Two sites. One has weaker sales. What would the benefits and problems for SEO of moving the weak site from its own domain to a subdomain of the stronger site?
Technical SEO | | GriffinHansen0