← Back to Docs / Technical / Seo Fix Plan

SEO Fix Plan

Priority: CRITICAL -- These bugs are actively damaging the live site Fix these BEFORE any other work


FIX 1: Meta Description i18n Key Resolution (CRITICAL)

Problem

All pages except the homepage show raw i18n keys instead of actual descriptions:

Root Cause

In src/components/SEO.astro, the page slug is extracted from Astro.url.pathname. The extraction logic includes .html in the slug on some pages, causing the translation key to become meta.services.html.description instead of meta.services.description.

Files to Fix

Investigation Steps

  1. Read SEO.astro and find where the meta description key is built
  2. Read page.config.ts and find useLanguagePage() function
  3. Check how Astro.url.pathname is parsed for the page name
  4. The fix likely involves stripping .html suffix and handling the empty slug case (homepage)

Acceptance Criteria


FIX 2: Arabic Language Switcher URL (CRITICAL)

Problem

On /ar (Arabic homepage), the EN language switcher link is /.html instead of /.

Root Cause

getLanguageSwitchLink() in page.config.ts doesn't handle the homepage special case. When the current path is /ar or /ar/, the extracted slug is empty, producing /.html.

Files to Fix

Fix Logic

If current path is /ar or /ar/ (Arabic homepage):
  return "/" (English homepage)
If current path is / (English homepage):
  return "/ar" (Arabic homepage)
Otherwise:
  strip /ar/ prefix, return /{slug} or /ar/{slug}

Acceptance Criteria


FIX 3: Hreflang Alternate URLs (CRITICAL)

Problem

Arabic pages have broken hreflang:

<link rel="alternate" hreflang="ar" href="https://urwhats.com/ar/.html">
<link rel="alternate" hreflang="en" href="https://urwhats.com/.html">

Root Cause

Same slug extraction issue as Fix 1. The hreflang URLs are built using the same broken page slug.

Files to Fix

Fix Logic

Acceptance Criteria


FIX 4: Canonical URL for Arabic Pages (HIGH)

Problem

Arabic homepage canonical: https://urwhats.com/ar.html (should be /ar)

Files to Fix

Acceptance Criteria


FIX 5: Create OG Image (HIGH)

Problem

SEO.astro references urWhats-og-image.png but the file doesn't exist.

Solution

Create a 1200x630px PNG image:

Acceptance Criteria


FIX 6: Remove Fake AggregateRating (HIGH)

Problem

Schema.org structured data claims 4.8/5 from 150 reviews with no actual review source. Google may flag this as spam.

Files to Fix

Acceptance Criteria


FIX 7: Remove Duplicate Robots Meta Tag (MEDIUM)

Problem

Two <meta name="robots"> tags in <head> on every page.

Files to Fix

Acceptance Criteria


FIX 8: Remove Duplicate Sitemap (MEDIUM)

Problem

Both public/sitemap.xml (static) and src/pages/sitemap-index.xml.ts (dynamic) exist.

Solution

Delete public/sitemap.xml and keep only the dynamic version.

Acceptance Criteria


FIX 9: Normalize URL Casing (MEDIUM)

Problem

/Privacy and /Terms use PascalCase, all other routes use lowercase.

Solution

  1. Rename src/pages/Privacy.astro to src/pages/privacy.astro
  2. Rename src/pages/Terms.astro to src/pages/terms.astro
  3. Rename src/pages/ar/Privacy.astro to src/pages/ar/privacy.astro
  4. Rename src/pages/ar/Terms.astro to src/pages/ar/terms.astro
  5. Add 301 redirects in public/_redirects: /Privacy /privacy 301 and /Terms /terms 301
  6. Update all internal links referencing these pages

Acceptance Criteria