← Back to Test Matrix
⚠️ Issue: hreflang_target_robots_blocked

Hreflang Target Robots Blocked Test Page

This page's hreflang points to a French target that is blocked by robots.txt.

What's wrong?

The Conflict:

Hreflang says: "Show French users this French page"

Robots.txt says: "Do not crawl this path"

Search engines cannot use a page they're not allowed to crawl!

Expected Detection:

Check: hreflang (automatic)

Status: Fail

Severity: Warning

Issue Type: hreflang_target_robots_blocked

How to Fix:

Choose one of these solutions:

Robots.txt Entry:

User-agent: *
Disallow: /blocked-by-robots/  # ❌ Blocks the hreflang target

Fixed Robots.txt:

User-agent: *
# Allow the French target:
Allow: /blocked-by-robots/french-target  # ✅ Explicitly allow
Disallow: /blocked-by-robots/           # Block other paths

Current (Invalid) Metadata:

alternates: {
  canonical: "https://mock.okok.now/issues/hreflang-target-robots-blocked",
  languages: {
    en: "https://mock.okok.now/issues/hreflang-target-robots-blocked",
    fr: "https://mock.okok.now/blocked-by-robots/french-target",  // ❌ Blocked
  }
}

Rule:

Never point hreflang to pages blocked by robots.txt.

Search engines need to crawl pages to understand and index them. Blocked pages cannot be used for hreflang targeting.

→ Try visiting the blocked target (may work for users but not crawlers)