Technical SEO MasteryCore Web Vitals, mobile-first indexing and security · Lesson 15 of 18
Mobile-first indexing, HTTPS and security headers
Video lecture
Mobile-first indexing, HTTPS and security headers
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
Transcript of the narration, chapter by chapter.
0:00 Mobile-first, HTTPS and security
Google predominantly indexes the mobile version of your site. So if your mobile pages show less content, fewer links or different tags than desktop, that's what Google sees. In this lecture you'll learn how mobile-first indexing works in practice, the parity checklist, what to do about interstitials, the HTTPS essentials, a sensible baseline of security headers, and how to monitor for hacked content, because a compromised site suffers badly in search.
0:31 Mobile-first indexing
Mobile-first indexing means Google uses the mobile version of content, crawled by 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. Think of it like a shop window. If your street-facing window shows only half your stock, passers-by assume that's all you sell, even if the back room is full.
1:01 Parity checklist
The parity checklist. Primary content should be the same. Hiding content in tabs or accordions is fine if it's in the HTML; removing it from mobile removes it from Google. Metadata should match: titles, descriptions and robots meta, and a mobile template that accidentally outputs noindex affects your whole index. Structured data should match. Internal links should match, because a slimmed mobile menu that drops category links reduces discovery. And images and lazy-loaded content should load without swipes or clicks.
1:36 Separate mobile sites
Legacy separate mobile sites, like m dot example dot com, need rel alternate from desktop to mobile and rel canonical from mobile to desktop, plus equivalent content. Honestly, migrating to responsive design removes a whole class of errors, and it's what most sites should do. To check parity, use URL Inspection, which uses the smartphone crawler, and crawl with a mobile user agent, comparing content, links and directives with a desktop crawl.
2:07 Interstitials
Intrusive interstitials. Full-screen pop-ups that block content right after someone arrives from search make a poor experience. Legally required interstitials, like cookie consent or age verification, are acceptable, but design them to be small and dismissible, and keep the underlying content in the HTML so it can still be crawled. A consent banner that covers the whole screen and pushes content around can also hurt CLS.
2:36 HTTPS essentials
HTTPS essentials. It's a lightweight ranking signal and a baseline of trust. Have a valid certificate covering all hosts. Redirect HTTP to HTTPS sitewide in a single hop. Make canonicals, hreflang, sitemaps and internal links all use HTTPS. Eliminate mixed content, meaning HTTP images, scripts or iframes on HTTPS pages. And use a modern TLS configuration, at least TLS one point two, preferably one point three.
3:05 Security header baseline
Security headers aren't ranking factors in their own right, but a hacked site suffers severely, with spam injections, malware warnings and manual actions. A sensible baseline: Strict-Transport-Security to force HTTPS, starting with a short max-age before increasing, and adding preload only when you're certain. A Content Security Policy, deployed first in report-only mode, because tag managers and widgets often need allow-listing. X-Content-Type-Options nosniff. A Referrer-Policy like strict-origin-when-cross-origin. And frame-ancestors in CSP to prevent clickjacking.
3:37 Hands-on: parity + header check
Hands-on. The lesson text includes a Python parity and header check. It fetches a URL with a mobile and a desktop user agent, and compares status, number of links, word count, JSON-LD blocks, robots meta and canonical. For the mobile response it also prints the key security headers or flags them as missing. It checks raw HTML only, so for JavaScript sites compare rendered output too.
4:06 Example 1: mixed content after a CDN change
Worked example one, simple. A Leeds charity moved images to a new CDN domain, but some templates still reference the old HTTP image URLs. Browsers block or warn on mixed content, and some images disappear on mobile. A crawl for HTTP resources on HTTPS pages finds them in minutes. The fix is updating templates to the HTTPS CDN URLs and adding an upgrade-insecure-requests directive as a safety net.
4:36 Example 2: slimmed mobile menu (illustrative)
Worked example two, with illustrative details. A Karachi electronics retailer launched a cleaner mobile menu showing only six top categories, while desktop linked to forty subcategories. Because Google indexes the mobile version, subcategory pages lost most of their internal links, and their crawl frequency fell in the logs. The fix kept the clean look, but rendered all the subcategory links inside an accessible, collapsible menu present in the HTML. Parity checks were added to the release checklist.
5:09 Monitoring and mistakes
Hacked-site monitoring and common mistakes. Watch Search Console's Security issues and Manual actions reports with email alerts on. Occasionally search your site for spam terms, and look for unfamiliar URLs or queries in languages you don't publish in. Keep your CMS and plugins patched and enforce multi-factor authentication. Common mistakes: a mobile template with fewer links or missing structured data, mixed content after a domain change, setting HSTS with include subdomains before a legacy subdomain supports HTTPS, and believing security headers lift rankings.
5:45 Watch me do it: parity + headers
Watch me do it. I'll run a mobile parity and header check on three templates. Step one: I run the parity script for the home page, a category and a product. The home page matches. The category page shows mobile links forty-two, desktop one hundred and eighteen. The product page shows mobile JSON-LD blocks zero, desktop two. Step two: I open the category on a phone-sized viewport in DevTools and inspect the menu. The mobile menu only includes top-level categories. Subcategory links aren't in the HTML at all. Step three: for the product, I view the mobile source. The structured data include lives in a desktop-only template partial. Step four: headers. The script shows Strict-Transport-Security present with a one-year max-age and include subdomains. Content-Security-Policy is missing. X-Content-Type-Options is present. Referrer-Policy is missing. Step five: I check whether every subdomain supports HTTPS, because include subdomains is already on. The old careers subdomain doesn't. That's urgent. Step six: tickets. Render full subcategory links in an accessible collapsible mobile menu. Move the JSON-LD include into the shared template. Fix HTTPS on the careers subdomain. And roll out CSP in report-only mode first.
7:07 The HSTS trap
Let's talk about the HSTS trap in a bit more detail, because it catches experienced teams. Strict-Transport-Security tells browsers to use HTTPS for your domain for a period of time. Add include subdomains, and every subdomain must support HTTPS too. If you have an old subdomain, maybe a legacy blog or an internal tool, that only works on HTTP, returning visitors suddenly can't reach it at all. And if you've submitted your domain to the browser preload list, undoing that is slow. So roll out in stages: short max-age, confirm every subdomain, then increase, and add preload only when you're certain.
7:51 Recap and try this now
Recap. Google indexes your mobile version, so make it equal in content, metadata, structured data and links. Keep interstitials small, HTTPS clean, and security headers sensible, and monitor for hacks. Try this now. Run the parity script on one URL from each main template, and fix any template where mobile has noticeably fewer links, words or JSON-LD blocks than desktop.
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
noindexaffects 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:
- Valid certificate covering all hosts (www and non-www, subdomains).
- Sitewide 301 from HTTP to HTTPS in a single hop.
- Canonicals, hreflang, sitemaps and internal links all use
https://URLs. - No mixed content (HTTP images, scripts or iframes on HTTPS pages); browsers block or warn.
- 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 addpreloadwhen you are certain — preload lists are slow to undo. - CSP prevents many script injection attacks; deploy first as
Content-Security-Policy-Report-Onlyto discover what would break (tag managers and third-party widgets often need allow-listing). frame-ancestorsin CSP supersedes the olderX-Frame-Optionsfor clickjacking protection.- Set a
Referrer-Policythat 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.comsearches 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
includeSubDomainsbefore 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.
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.