I have an adaptive website, and in the mobile version, we put the same data as the desktop version, but in special tabs which are accessible via route URL change.

For example, we have the profile page, in desktop, it's only the /profile page. But in the mobile page, there are several tabs. For example: /profile?tab=about, /profile?tab=posts, and more.

The canonical for the mobile page is exactly as same as the currently active tab (ex: /profile?tab=posts) and for the desktop version is /profile

Google use SmartPhone bot to crawl the website, so it gets multiple canonical, and in the website, it handled that without redirecting or anything else, it shows the page. For example when desktop user come to /profile?tab=posts, he or she will see the desktop content of /profile which is for desktop.

Is this a good way to handle mobile and desktop canonical? or for all pages, I need to use only /profile

  • What is the reason that the mobile site has the tabs? Is it because of screen real-estate, or download speed, or something else? – Stephen Ostermiller Sep 20 '19 at 14:41
  • @StephenOstermiller It's our design system, and for providing better mobile version and for UX purposes we use tab. – Mohammad Kermani Sep 21 '19 at 6:45
  • @StephenOstermiller So how would you handle that? What I'm doing here is wrong? – Mohammad Kermani Sep 21 '19 at 6:47

If you have two site variants, for desktop and for mobile devices, you should have any logic to route users to certain site version. Lets assume, it is media query, which decides, which site version is to deliver. That is the method to deliver canonical:

  • if deliver desktop version - include the desktop canonical,
  • if deliver mobile version - include mobile canonical.

Google describes pretty detailedly how to deal with canonicals in this setup: https://developers.google.com/search/mobile-sites/mobile-seo/separate-urls

  • Where does Google address a setup with a many-to-one URL mapping between mobile and desktop? – Stephen Ostermiller Sep 20 '19 at 14:59
  • i would say, it implies using own canonical for each page. I wouldn't call it many-to-one - they are just different. Or have i a logic bug? – Evgeniy Sep 20 '19 at 15:02
  • 1
    They say they break a desktop page up into several tabs on mobile and each tab gets its own URL. – Stephen Ostermiller Sep 20 '19 at 15:14
  • So i would create canonical according to current url. Something like <link rel="canonical" href=" <?php $url = "//$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]$_SERVER['QUERY_STRING']"; $escaped_url = htmlspecialchars($url, ENT_QUOTES, 'UTF-8'); echo $escaped_url; ?> " /> – Evgeniy Sep 20 '19 at 15:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.