Skip to content

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)

Section titled “FIX 1: Meta Description i18n Key Resolution (CRITICAL)”

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

  • /services shows: meta.services.html.description
  • /prices shows: meta.prices.html.description
  • /ar shows: meta..html.description (double dots — empty slug)

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.

  • src/components/SEO.astro — where the meta key is constructed
  • src/config/page.config.ts — where useLanguagePage() extracts page info
  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)
  • npm run build succeeds
  • Every page’s <meta name="description"> shows actual English/Arabic text
  • Every page’s og:description shows actual text
  • Every page’s twitter:description shows actual text
  • Schema.org WebPage.description shows actual text
  • Arabic homepage meta key resolves correctly (not meta..html.description)

FIX 2: Arabic Language Switcher URL (CRITICAL)

Section titled “FIX 2: Arabic Language Switcher URL (CRITICAL)”

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

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.

  • src/config/page.config.tsgetLanguageSwitchLink() function
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}
  • 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

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">

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

  • src/components/SEO.astro — where hreflang links are generated
  • Strip .html from all generated URLs
  • Handle empty slug (homepage) to produce / not /.html
  • Ensure URLs don’t have double slashes (//)
  • hreflang="en" points to https://urwhats.com/{slug} (no .html)
  • hreflang="ar" points to https://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)

Section titled “FIX 4: Canonical URL for Arabic Pages (HIGH)”

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

  • src/components/SEO.astro — canonical URL generation
  • All canonical URLs are clean (no .html suffix)
  • English pages: https://urwhats.com/{slug}
  • Arabic pages: https://urwhats.com/ar/{slug}

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

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
  • File exists at public/assets/images/logos/urWhats-og-image.png
  • Image is 1200x630px
  • og:image meta tag resolves to a valid image URL

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

  • src/components/SEO.astro — remove AggregateRating from SoftwareApplication schema
  • public/.well-known/schema.json — remove aggregateRating
  • public/.well-known/ai-plugin.json — remove aggregateRating
  • No AggregateRating in any JSON-LD output
  • Rich Results Test passes without fake review warnings

FIX 7: Remove Duplicate Robots Meta Tag (MEDIUM)

Section titled “FIX 7: Remove Duplicate Robots Meta Tag (MEDIUM)”

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

  • src/components/SEO.astro — find and remove one of the duplicates
  • Only one <meta name="robots"> tag per page

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

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

  • Only src/pages/sitemap-index.xml.ts exists
  • robots.txt references the correct sitemap URL
  • Build produces a valid sitemap

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

  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
  • All routes are lowercase
  • Old PascalCase URLs redirect to lowercase
  • All internal links updated
  • Sitemap uses lowercase URLs