Mobile site and mobile-first indexing best practices

Google predominantly uses the mobile version of a site's content, crawled with the smartphone agent, for indexing and ranking. This is called mobile-first indexing.

While it's not required to have a mobile version of your pages to have your content included in Google's Search results, it is very strongly recommended. These best practices apply to mobile sites in general, and by definition to mobile-first indexing.

Mobile-first indexing is enabled by default for all new websites (new to the web or previously unknown to Google Search). For older or existing websites, we continue to monitor and evaluate pages based on the best practices detailed in this guide. We inform site owners in Search Console of the date when their site was switched to mobile-first indexing.

To make sure that your users have the best experience, follow the best practices detailed in this guide.

Create a mobile-friendly site

If you haven't already, create a mobile-fiendly website so your users visiting your site through a mobile phone can have a stellar experience. There are three configurations you can choose from to create a mobile-friendly site:

  • Responsive design: Serves the same HTML code on the same URL regardless of the users' device (for example, desktop, tablet, mobile, non-visual browser), but can display the content differently based on the screen size. Google recommends Responsive Web Design because it's the easiest design pattern to implement and maintain.
  • Dynamic serving: Uses the same URL regardless of device. This configuration relies on user-agent sniffing and the Vary: user-agent HTTP response header to serve a different version of the HTML to different devices.
  • Separate URLs: Serves different HTML to each device, and on separate URLs. Like dynamic serving, this configuration relies on the user-agent and Vary HTTP headers to redirect users to the device-appropriate version of the site.

The contents of this guide only apply to dynamic serving and separate URL configurations. In case of responsive design, the content and the metadata are the same on the mobile and desktop version of the pages.

Make sure that Google can access and render your content

Make sure that Google can access and render your mobile page content and resources.

  • Use the same robots meta tags on the mobile and desktop site. If you use a different robots meta tag on the mobile site (especially the noindex or nofollow tags), Google may fail to crawl and index your page when your site is enabled for mobile-first indexing.
  • Don't lazy-load primary content upon user interaction. Google won't load content that requires user interactions (for example, swiping, clicking, or typing) to load. Make sure that Google can see lazy-loaded content.
  • Let Google crawl your resources. Some resources have different URLs on the mobile site from those on the desktop site. If you want Google to crawl your URLs, make sure that you're not blocking the URL with the disallow rule.

Make sure that content is the same on desktop and mobile

Even with the equivalent content, differences in DOM or layout between desktop and mobile page can result in Google understanding the content differently. However having the same content on the desktop and mobile version ensures that the two versions can rank for the same keywords.

  • Make sure that your mobile site contains the same content as your desktop site. If your mobile site has less content than your desktop site, consider updating your mobile site so that its primary content is equivalent to your desktop site. You can have a different design on mobile to maximize user experience (for example, moving content into accordions or tabs); just make sure that the content is equivalent to the desktop site, since almost all indexing on your site comes from the mobile site.
  • Use the same clear and meaningful headings on the mobile site as you do on the desktop site.

Check your structured data

If you have structured data on your site, make sure that it's present on both versions of your site. Here are some specific things to check:

  • Make sure that your mobile and desktop sites have the same structured data. If you have to prioritize which types you add to your mobile site, start with Breadcrumb, Product, and VideoObject structured data.
  • Use correct URLs in structured data. Make sure that URLs in the structured data on the mobile versions are updated to the mobile URLs.
  • If you use Data Highlighter, train it on your mobile site. If you use Data Highlighter to provide structured data, regularly check the Data Highlighter dashboard for extraction errors.

Put the same metadata on both versions of your site

Make sure that the title element and the meta description are equivalent across both versions of your site.

Check the placement of your ads

Don't let ads harm your mobile page ranking. Follow the Better Ads Standard when displaying ads on mobile devices. For example, ads at the top of the page can take up too much room on a mobile device, which is a bad user experience

Check visual content

Check your images

Make sure that the images on your mobile site follow the image best practices. In particular, we recommend that you:

  • Provide high quality images. Don't use images that are too small or have a low resolution on the mobile site.
  • Use a supported format for images. Don't use unsupported formats or tags. For example, Google supports SVG format images, but our systems can't index a .jpg image in the <image> tag inside an inline SVG.
  • Don't use URLs that change every time the page loads for images. Google won't be able to process and index your resources properly if you use constantly-changing URLs for them.
  • Make sure that the mobile site has the same alt text for images as the desktop site. Use descriptive alt text for images on your mobile site as you do on your desktop site.
  • Make sure that the mobile page content quality is as good as the desktop page. Use the same titles, captions, filenames, and text relevant to the images on the mobile site as you do for the desktop site.

Check your videos

Make sure that the videos on your mobile site follow the video best practices. In particular, we recommend that you:

  • Don't use URLs that change every time the page loads for your videos. Google won't be able to process and index your resources properly if you use constantly changing URLs for them.
  • Use a supported format for your videos and put videos in supported tags. Videos are identified in the page by the presence of an HTML tag, for example: <video>, <embed>, or <object>.
  • Use the same video structured data on both your mobile site and desktop site. For more information, check your structured data.
  • Place the video in an easy to find position on the page when viewed on a mobile device. For example, it might harm the video's ranking if users need to scroll down too much to find the video on mobile page.

Additional best practices for separate URLs

If your site has separate URLs for the desktop and mobile versions of a page (also known as m-dot), we recommend the following additional best practices:

  • Make sure that the error page status is the same on both the desktop and mobile sites. If a page on your desktop site serves normal contents and your mobile site's version of that page serves an error page, this page will be missing from the index.
  • Make sure that your mobile version doesn't have fragment URLs. The fragment part of the URL is the end of the URL that starts with #. Most of the time, fragment URLs are not indexable, these pages will be missing from the index after your domain is enabled for mobile-first indexing.
  • Ensure that the desktop versions that serve different contents have equivalent mobile versions. If different URLs redirect to the same URL (for example, to the homepage on mobile devices) after your domain is enabled for mobile-first indexing, all these pages will be missing from the index.
  • Verify both versions of your site in Search Console to make sure that you have access to data and messages for both versions. Your site may experience a data shift when Google switches to mobile-first indexing for your site.
  • Check hreflang links on separate URLs. When you use rel=hreflang link elements for internationalization, link between mobile and desktop URLs separately. Your mobile URLs' hreflang must point to mobile URLs, and similarly desktop URL hreflang must point to desktop URLs.

    Here's an example of hreflang for the homepage of a site with separate URLs for mobile and desktop.

    Mobile

    In this example, the mobile site URL is https://m.example.com/.

    <link rel="canonical" href="https://example.com/">
    <link rel="alternate" hreflang="es" href="https://m.example.com/es/">
    <link rel="alternate" hreflang="fr" href="https://m.example.com/fr/">
    <link rel="alternate" hreflang="de" href="https://m.example.com/de/">
    <link rel="alternate" hreflang="th" href="https://m.example.com/th/">

    Desktop

    In this example, the desktop site URL is https://example.com/.

    <link rel="canonical" href="https://example.com/">
    <link rel="alternate" media="only screen and (max-width: 640px)" href="https://m.example.com/">
    <link rel="alternate" hreflang="es" href="https://example.com/es/">
    <link rel="alternate" hreflang="fr" href="https://example.com/fr/">
    <link rel="alternate" hreflang="de" href="https://example.com/de/">
    <link rel="alternate" hreflang="th" href="https://example.com/th/">
  • Ensure that your mobile site has enough capacity to handle a potential increase in crawl rate on the mobile version of your site.
  • Verify that your robots.txt rules work as you intend for both versions of your site. The robots.txt file lets you specify which parts of a website may be crawled or not. In most cases, use the same robots.txt rules for both mobile and desktop versions of your site.
  • Use the correct rel=canonical and rel=alternate link elements between your mobile and desktop versions. The desktop URL is always the canonical, and the mobile version is the alternate of that URL.

    Here's an example of rel=canonical and rel=alternate for a separate URLs site setup.

    Mobile

    In this example, the mobile site URL is https://m.example.com/ and includes a link element that points to the desktop URL as the canonical URL.

    <link rel="canonical" href="https://example.com/">

    Desktop

    In this example, the desktop site URL is https://example.com/ and includes a link element that points to itself as the canonical URL, followed by another link element that points to the mobile version as the alternate version of this URL.

    <link rel="canonical" href="https://example.com/">
    <link rel="alternate" media="only screen and (max-width: 640px)" href="https://m.example.com/">

Troubleshooting

Here's a list of the most common errors that can stop sites from being enabled for mobile-first indexing or could cause a drop in ranking after a site is enabled for mobile-first indexing. If your site isn't enabled for mobile-first indexing yet, you've seen a drop in ranking after your site is enabled for mobile-first indexing, or you've received a message in Search Console, check the list of common errors and resolve possible errors you may have.

Errors

Missing structured data

What caused the issue: The mobile page doesn't have all the structured data markup that the desktop page has.

Fix the issue

  1. Verify that the structured data is present on both versions of your site (desktop and mobile).
  2. Make sure that your mobile and desktop sites have the same structured data.
  3. Use correct URLs in structured data. Make sure that URLs in the structured data on the mobile versions are updated to the correct URLs.
  4. Check extraction errors for your structured data. If you use Data Highlighter to provide structured data, regularly check the Data Highlighter dashboard for extraction errors.
  5. Use the URL Inspection tool to check that the content is visible on the rendered page (the rendered page is how Google sees your page).

noindex tag on pages

What caused the issue: A mobile page is blocked from indexing by a noindex tag.

Fix the issue: Use the same robots meta tags on the mobile site and the desktop site. Don't use the noindex tag on the mobile page (otherwise, Google won't index your page when your site is enabled for mobile-first indexing).

Missing image

What caused the issue: The mobile page doesn't have all the important images that the desktop page has.

Fix the issue

  1. Make sure that your mobile site contains the same content as your desktop site. If your mobile site has less content than your desktop site, consider updating your mobile site so that its primary content is equivalent with your desktop site. Only the content shown on the mobile site is used for indexing.
  2. Use the same robots meta tags on the mobile site and the desktop site. Don't use the nofollow tag on the mobile page (otherwise, Google won't crawl and index the images on your page when your site is enabled for mobile-first indexing).
  3. Use a supported format and tag for images. For example, Google supports SVG format images, but our systems can't index a .jpg image in the <image> tag inside an inline SVG.
  4. Don't lazy-load primary content upon user interaction. Google won't load content that requires user interactions (for example, swiping, clicking, or typing) to load. Make sure that Google can see lazy-loaded content.

Blocked image

What caused the issue: An important image on the mobile page is blocked by robots.txt.

Fix the issue: Let Google crawl your resources. Some images have different URLs on the mobile site from those on the desktop site. If you want Google to crawl your URLs, don't block the URL with the disallow rule.

Low quality image

What caused the issue: An important image on the mobile page is too small or low resolution.

Fix the issue: Provide high quality images. Don't use images that are too small or have a low resolution on the mobile site.

Missing alt text

What caused the issue: An important image on the mobile page is missing alt text.

Fix the issue: Use the same alt text for images on your mobile site as you do on your desktop site.

Missing page title

What caused the issue: A mobile page is missing a title.

Fix the issue: Make sure that the titles and meta descriptions are equivalent across both versions of your site.

Missing meta description

What caused the issue: A mobile page is missing the meta description.

Fix the issue: Make sure that the titles and meta descriptions are equivalent across both versions of your site.

Mobile URL is an error page

What caused the issue: The mobile page is an error page.

Fix the issue: Make sure error page status is the same across desktop and mobile site. If a page on your desktop site serves normal contents and your mobile site's version of that page serves an error page, this page will be missing from the index.

Mobile URL has anchor fragment

What caused the issue: The mobile URL includes an anchor fragment; Google can't index URLs that include fragments.

Fix the issue: Make sure your mobile version doesn't have fragment URLs. Most of the time, fragment URLs are not indexable, and these pages will be missing from the index after your domain is enabled for mobile-first indexing.

Mobile page blocked by robots.txt

What caused the issue: The mobile page is blocked by a robots.txt rule.

Fix the issue: Verify that your robots.txt rules and robots meta tags work as you intended for both versions of your site. Use the same robots.txt rules for both mobile and desktop versions of your site.

Duplicate mobile page target

What caused the issue: Multiple desktop pages redirect to the same mobile page.

Fix the issue: Ensure desktop versions which serve different contents have equivalent mobile versions. If different URLs redirects to the same URL, on mobile devices, after your domain is enabled for mobile-first indexing, all these pages will be missing from the index.

Desktop site redirects to the mobile homepage

What caused the issue: Most or all pages on your desktop site redirect to the mobile site's homepage.

Fix the issue: Ensure the desktop version has an equivalent mobile version. If different URLs redirect to the homepage on mobile devices, all these pages will be missing from the index after your domain is migrated for mobile-first indexing.

Page quality issues

What caused the issue: The mobile page has issues with ads, missing content, titles, or descriptive elements for images on the page.

Fix the issue:

  1. Don't let ads harm your mobile page ranking. Follow the Better Ads Standard when displaying ads on mobile devices.
  2. Make sure your mobile site contains the same content as your desktop site. If your mobile site has less content than your desktop site, consider updating your mobile site so that its primary content is equivalent with your desktop site. Only the content shown on the mobile site is used for indexing.
  3. Make sure you use the same clear and meaningful headings on the mobile site as you do on the desktop site.
  4. Use the same titles, captions, filenames, and text relevant to the images on the mobile site you do for the desktop site.

Video issues

What caused the issue: The mobile page has a video that is not in a supported format, is placed in a difficult to find location, is missing meta descriptions, or is very slow to load.

Fix the issue:

  1. Use a supported format for your videos and put them in supported tags. Videos are identified in the page by the presence of an HTML tag, for example: <video>, <embed>, or <object>.
  2. Don't lazy-load primary content upon user interaction. Google won't load content that requires user interactions (for example, swiping, clicking or typing) to load. Make sure Google can see lazy-loaded content.
  3. Place the video in an easy to find location on your mobile site. For example, it might harm the video's ranking if users need to scroll down too much to find the video on mobile page.

Hostload issues

What caused the issue: Some of the hosts don't have enough hostload.

Fix the issue: Ensure that your mobile site has enough capacity to handle a potential increase in crawl rate on the mobile version of your site.