Technical SEO MasteryCore Web Vitals, mobile-first indexing and security · Lesson 15 of 18

Mobile-first indexing, HTTPS and security headers

Article · 12 min · 8 min lecture

Video lecture

Mobile-first indexing, HTTPS and security headers

14 chapters · about 8 min · full transcript

Coming soon

Chapter 1 of 14

Mobile-first, HTTPS and security

  • Mobile parity
  • HTTPS essentials
  • Security headers and hack monitoring

The narrated lecture is in production

Every chapter is scripted and ready. Browse the chapters and read the full transcript now — the video will appear here when it’s published.

Chapters

Mobile-first indexing in practice

Google predominantly uses the mobile version of content, crawled with the smartphone Googlebot, for indexing and ranking. For responsive sites where the same HTML serves every device, this is mostly a non-issue. Problems appear when the mobile experience differs from desktop.

The parity checklist

Your mobile version should have the same:

  • Primary content — text, images, videos. Content hidden in accordions or tabs for mobile UX is fine as long as it is in the HTML; content removed from mobile is effectively removed from Google.
  • Meta data — titles, meta descriptions, robots meta. A mobile template that accidentally outputs noindex affects the whole index.
  • Structured data — same markup, pointing to mobile URLs on separate-URL setups.
  • Internal links — a slimmed-down mobile menu that drops links to key categories reduces discovery and internal link signals.
  • Images — same quality, supported formats, descriptive alt text; lazy-loading that works without user interaction.
  • Lazy-loaded content — loaded based on visibility in the viewport, not on swipe or click.

For legacy separate mobile sites (m.example.com), you need rel="alternate" from desktop to mobile and rel="canonical" from mobile to desktop, plus equivalent content. Migrating to responsive design removes a whole class of errors and is recommended.

How to check: use URL Inspection (which uses the smartphone crawler), crawl with a mobile user agent, and compare content, links and directives against a desktop crawl.

Intrusive interstitials

Full-screen pop-ups that block content right after a user arrives from search create a poor experience. Legally required interstitials (cookie consent, age verification) are acceptable; design them to be small and dismissible. Keep the underlying content in the HTML so it can still be crawled.

HTTPS

HTTPS is a lightweight ranking signal and a baseline of trust. Checklist:

  1. Valid certificate covering all hosts (www and non-www, subdomains).
  2. Sitewide 301 from HTTP to HTTPS in a single hop.
  3. Canonicals, hreflang, sitemaps and internal links all use https:// URLs.
  4. No mixed content (HTTP images, scripts or iframes on HTTPS pages); browsers block or warn.
  5. Modern TLS configuration (TLS 1.2 minimum, TLS 1.3 preferred).

Security headers

Security headers are not ranking factors in their own right, but they protect users and your site's reputation, and a hacked site suffers severely in search (spam injections, malware warnings, manual actions). A sensible baseline:

Strict-Transport-Security: max-age=31536000; includeSubDomains
Content-Security-Policy: default-src 'self'; img-src 'self' https://cdn.example.com data:; script-src 'self' https://www.googletagmanager.com; frame-ancestors 'self'
X-Content-Type-Options: nosniff
Referrer-Policy: strict-origin-when-cross-origin
Permissions-Policy: camera=(), microphone=(), geolocation=()

Notes:

  • HSTS forces HTTPS for returning browsers. Start with a short max-age, confirm every subdomain supports HTTPS, then increase. Only add preload when you are certain — preload lists are slow to undo.
  • CSP prevents many script injection attacks; deploy first as Content-Security-Policy-Report-Only to discover what would break (tag managers and third-party widgets often need allow-listing).
  • frame-ancestors in CSP supersedes the older X-Frame-Options for clickjacking protection.
  • Set a Referrer-Policy that keeps origin data for analytics while not leaking full URLs cross-site.

Hacked-site and spam monitoring

  • Watch Search Console's Security issues and Manual actions reports; enable email notifications.
  • Use site:example.com searches with spam terms (pharma, casino, replica) occasionally to spot injected pages; also check for unfamiliar URLs in the Page indexing report and Performance queries in languages you do not publish in.
  • Keep CMS, themes and plugins patched; remove unused plugins; enforce multi-factor authentication for admin accounts.
  • If compromised: clean, close the vulnerability, then request a review in Search Console.

Hands-on: a mobile parity and header check

# pip install requests beautifulsoup4
import requests
from bs4 import BeautifulSoup

URL = "https://www.example.com/collections/cushions/"
UAS = {"mobile": "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0 Mobile Safari/537.36",
       "desktop": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0 Safari/537.36"}
out = {}
for name, ua in UAS.items():
    r = requests.get(URL, headers={"User-Agent": ua}, timeout=20)
    s = BeautifulSoup(r.text, "html.parser")
    out[name] = {"status": r.status_code,
                 "links": len({a["href"] for a in s.find_all("a", href=True)}),
                 "words": len(s.get_text(" ", strip=True).split()),
                 "jsonld": len(s.find_all("script", type="application/ld+json")),
                 "robots": (s.find("meta", attrs={"name": "robots"}) or {}).get("content"),
                 "canonical": (s.find("link", rel="canonical") or {}).get("href")}
    if name == "mobile":
        for h in ["Strict-Transport-Security", "Content-Security-Policy", "X-Content-Type-Options", "Referrer-Policy"]:
            print(f"{h:28} {r.headers.get(h, 'MISSING')}")
for k in out["mobile"]:
    print(f"{k:10} mobile={out['mobile'][k]!s:40} desktop={out['desktop'][k]!s}")

This checks raw HTML only — for JavaScript sites also compare rendered output (Lesson 1.2). Big gaps in links, words or JSON-LD between mobile and desktop are parity findings.

Worked example 2: a Karachi retailer's slimmed mobile menu

A Karachi electronics retailer (illustrative) launched a "cleaner" mobile menu showing only six top categories; desktop linked to 40 subcategories. Because Google indexes the mobile version, subcategory pages lost most of their internal links, and crawl frequency of those pages fell in the logs. The fix kept the clean UI but rendered the full subcategory links inside an accessible, collapsible menu present in the HTML. Parity checks were added to the release checklist.

Common mistakes

  • A mobile template with fewer internal links or missing structured data.
  • Mixed content after a CDN or image domain change.
  • Setting HSTS with includeSubDomains before a legacy subdomain supports HTTPS — it becomes unreachable for returning visitors.
  • Believing security headers themselves will lift rankings; their value is protection.

Key takeaways

  • Google indexes the mobile version; content, links, meta and structured data must match desktop.
  • Content hidden in tabs is fine if it is in the HTML; content removed on mobile is lost to Google.
  • HTTPS needs single-hop redirects, HTTPS URLs everywhere and no mixed content.
  • Security headers protect users and reputation rather than directly boosting rankings; roll out HSTS and CSP carefully.

Check your understanding

Quick questions to lock in the lesson. They don’t count towards your certificate.

  1. A responsive redesign hides the FAQ section on mobile using CSS display:none but keeps it in the HTML. Impact on mobile-first indexing?
  2. What is the safest way to introduce a Content Security Policy?

Put it into practice

Compare mobile and desktop crawls of your site for word count, internal link count, structured data and robots directives on five templates; list any parity gaps.

Enrol for free to save your progress

Reading is always free. Enrol to keep your place, take the final assessment and earn a verifiable certificate.