Canonicalization for Mobile Sites and Mobile-First Indexing
Mobile Site and Mobile-First Indexing Best Practices: A Deep Dive
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 for inclusion in Google Search results, it is strongly recommended. This guide outlines best practices for mobile sites, specifically with mobile-first indexing in mind.
1. Create a Mobile-Friendly Site
A mobile-friendly site provides a seamless user experience for visitors browsing on smartphones. There are three main configurations for mobile-friendly sites:
a. Responsive Design (Recommended):
Single HTML Code: Uses the same HTML code across all devices (desktop, tablet, mobile, non-visual browsers).
Dynamic Display: Adapts the content layout based on screen size, providing an optimized view for each device.
Example:
HTML (Example.com/page):
styles.css:
b. Dynamic Serving:
Single URL: Uses the same URL for all devices.
User-Agent Sniffing: Detects the user's device type and serves a different version of the HTML based on this information.
Vary: User-Agent Header: This HTTP header signals to browsers that different versions of the content might be served based on the user-agent.
Example:
Desktop User-Agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36
Mobile User-Agent:
Mozilla/5.0 (Linux; Android 11; SM-G991B) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Mobile Safari/537.36
Server Code (Python Example):
c. Separate URLs:
Different URLs: Each device type (desktop, mobile) has a distinct URL.
User-Agent and Vary Headers: Similar to dynamic serving, these headers redirect users to the appropriate version of the site based on their device.
Example:
Desktop URL:
www.example.com/page
Mobile URL:
m.example.com/page
Server Code (Python Example):
Note: This guide focuses on dynamic serving and separate URL configurations. Responsive design does not require specific adjustments as the content and metadata are identical for both mobile and desktop versions.
2. Ensure Google Can Access and Render Your Content
Google needs to access and render your mobile page content and resources to index it properly.
a. Robots Meta Tags:
Consistency: Use the same
robots
meta tags on both the mobile and desktop sites.Avoid Noindex and Nofollow: Be cautious with
noindex
ornofollow
tags on the mobile site, as they can prevent Google from crawling and indexing your pages.
b. Lazy-Loading:
Avoid Lazy-Loading Primary Content: Google cannot index content that requires user interaction (e.g., swiping, clicking, typing). Ensure primary content is readily visible to Google.
Example: Loading images only when the user scrolls down is fine for secondary content, but essential information like product descriptions should be visible immediately.
c. Resource Crawling:
URL Consistency: If your mobile site uses different URLs for resources compared to the desktop site, ensure Google can access them by not blocking them with
disallow
rules in yourrobots.txt
file.
3. Consistent Content Between Desktop and Mobile
Even with equivalent content, differences in DOM structure or layout between desktop and mobile pages can lead to Google interpreting the content differently.
a. Content Equivalence:
Equivalent Content: Ensure the mobile site contains the same primary content as the desktop site.
Design Differences: Design variations (like moving content into accordions or tabs) are acceptable on mobile for usability, but maintain content equivalence.
Example:
Desktop: A product page might have a detailed description, specifications, reviews, and images.
Mobile: The same product page might organize the description, specifications, and reviews using tabs or accordions to optimize space. The images should be the same.
b. Heading Consistency:
Clear and Meaningful Headings: Use the same clear and meaningful headings (H1, H2, etc.) on both versions of your site.
4. Structured Data: Consistency and Correct URLs
Structured data helps Google understand the content of your pages, and it should be present on both your desktop and mobile versions.
a. Consistency:
Same Structured Data: Use the same structured data types on both versions of your site.
Prioritization: If you need to prioritize structured data types on the mobile site, focus on Breadcrumb, Product, and VideoObject.
b. Correct URLs:
Updated URLs: Ensure the URLs used in structured data on the mobile site match the actual mobile URLs.
Example:
Desktop:
<link rel="canonical" href="https://www.example.com/product">
Mobile:
<link rel="canonical" href="https://m.example.com/product">
Structured Data (JSON-LD Example):
c. Data Highlighter:
Regular Checks: If you use Data Highlighter, regularly check the Data Highlighter dashboard for extraction errors, particularly on your mobile site.
5. Metadata Consistency: Title and Description
Both the title
element and meta description
should be equivalent across your desktop and mobile versions to ensure consistency in search results.
6. Ad Placement: Follow Best Practices
Avoid hindering mobile page ranking by adhering to the Better Ads Standard when displaying ads on mobile devices. For example, avoid excessive ads at the top of the page, as this can negatively impact user experience.
7. Visual Content: Images and Videos
a. Image Best Practices:
High-Quality Images: Use high-quality images (not too small or low resolution) on your mobile site.
Supported Formats: Use supported image formats (e.g., SVG). Avoid unsupported formats or tags. Google can't index a .jpg image placed within an inline SVG, for instance.
URL Consistency: Avoid URLs that change every time the page loads for images, as this hinders indexing.
Alt Text: Use descriptive alt text for images on the mobile site, mirroring the desktop site.
Content Quality: Maintain the same image titles, captions, filenames, and related text on both mobile and desktop versions.
b. Video Best Practices:
URL Consistency: Don't use URLs that change for your videos.
Supported Formats and Tags: Use supported video formats (e.g., MP4, WebM) and embed them in supported tags (e.g.,
<video>
,<iframe>
).Example (HTML):
8. Mobile-First Indexing: Considerations
Temporary Image Traffic Loss: If your site uses different image URLs for desktop and mobile, you may experience a temporary image traffic loss during the transition to mobile-first indexing. This is due to Google indexing new image URLs, and it takes time for them to gain search results history.
Solution: Use the same image URLs for both versions of your site to avoid this temporary loss.
Traffic Loss with Reduced Content: If your mobile site intentionally has less content than the desktop site, you can expect some traffic loss with mobile-first indexing. Google will have less information to index.
Alternatives: Instead of removing content, consider moving it into accordions or tabs to optimize space.
By following these best practices, you can optimize your mobile site for mobile-first indexing, ensuring that your content is effectively crawled, indexed, and ranked by Google. This leads to a more engaging user experience and improved visibility in search results.
Last updated