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:
/servicesshows:meta.services.html.description/pricesshows:meta.prices.html.description/arshows:meta..html.description(double dots -- empty slug)
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
src/components/SEO.astro-- where the meta key is constructedsrc/config/page.config.ts-- whereuseLanguagePage()extracts page info
Investigation Steps
- Read
SEO.astroand find where the meta description key is built - Read
page.config.tsand finduseLanguagePage()function - Check how
Astro.url.pathnameis parsed for the page name - The fix likely involves stripping
.htmlsuffix and handling the empty slug case (homepage)
Acceptance Criteria
-
npm run buildsucceeds - Every page's
<meta name="description">shows actual English/Arabic text - Every page's
og:descriptionshows actual text - Every page's
twitter:descriptionshows actual text - Schema.org
WebPage.descriptionshows actual text - Arabic homepage meta key resolves correctly (not
meta..html.description)
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
src/config/page.config.ts--getLanguageSwitchLink()function
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
- From
/ar, clicking EN goes to/(not/.html) - From
/, clicking AR goes to/ar - From
/ar/services, clicking EN goes to/services - From
/services, clicking AR goes to/ar/services - All language switcher links work on all 22 pages
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
src/components/SEO.astro-- where hreflang links are generated
Fix Logic
- Strip
.htmlfrom all generated URLs - Handle empty slug (homepage) to produce
/not/.html - Ensure URLs don't have double slashes (
//)
Acceptance Criteria
-
hreflang="en"points tohttps://urwhats.com/{slug}(no .html) -
hreflang="ar"points tohttps://urwhats.com/ar/{slug}(no .html) -
hreflang="x-default"points to English version - Homepage hreflang is
/and/ar(not/.html)
FIX 4: Canonical URL for Arabic Pages (HIGH)
Problem
Arabic homepage canonical: https://urwhats.com/ar.html (should be /ar)
Files to Fix
src/components/SEO.astro-- canonical URL generation
Acceptance Criteria
- All canonical URLs are clean (no
.htmlsuffix) - English pages:
https://urwhats.com/{slug} - Arabic pages:
https://urwhats.com/ar/{slug}
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:
- Green background (#45b33d or gradient)
- urWhats logo (white)
- Tagline: "WhatsApp Business API Platform"
- "Meta Technical Provider" badge
- Place at:
public/assets/images/logos/urWhats-og-image.png
Acceptance Criteria
- File exists at
public/assets/images/logos/urWhats-og-image.png - Image is 1200x630px
-
og:imagemeta tag resolves to a valid image URL
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
src/components/SEO.astro-- remove AggregateRating from SoftwareApplication schemapublic/.well-known/schema.json-- remove aggregateRatingpublic/.well-known/ai-plugin.json-- remove aggregateRating
Acceptance Criteria
- No AggregateRating in any JSON-LD output
- Rich Results Test passes without fake review warnings
FIX 7: Remove Duplicate Robots Meta Tag (MEDIUM)
Problem
Two <meta name="robots"> tags in <head> on every page.
Files to Fix
src/components/SEO.astro-- find and remove one of the duplicates
Acceptance Criteria
- Only one
<meta name="robots">tag per page
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
- Only
src/pages/sitemap-index.xml.tsexists -
robots.txtreferences the correct sitemap URL - Build produces a valid sitemap
FIX 9: Normalize URL Casing (MEDIUM)
Problem
/Privacy and /Terms use PascalCase, all other routes use lowercase.
Solution
- Rename
src/pages/Privacy.astrotosrc/pages/privacy.astro - Rename
src/pages/Terms.astrotosrc/pages/terms.astro - Rename
src/pages/ar/Privacy.astrotosrc/pages/ar/privacy.astro - Rename
src/pages/ar/Terms.astrotosrc/pages/ar/terms.astro - Add 301 redirects in
public/_redirects:/Privacy /privacy 301and/Terms /terms 301 - Update all internal links referencing these pages
Acceptance Criteria
- All routes are lowercase
- Old PascalCase URLs redirect to lowercase
- All internal links updated
- Sitemap uses lowercase URLs