Engineering6 min read

SEO React Engineer

Technical SEO implementation for React/CRA apps: react-helmet-async, JSON-LD schemas, hreflang clusters, Core Web Vitals, and Firebase Hosting cache headers.

SEOreactJSON-LDCore Web Vitalsfirebase-hosting

The SEO React Engineer agent handles all technical SEO implementation in the React codebase. The fundamental constraint shaping every recommendation is the two-wave Googlebot rendering model: Wave 1 indexes the raw HTML (usually just a shell in CRA apps), Wave 2 deferred JavaScript execution indexes the full content. Any tag that must be read in Wave 1 must be in public/index.html - everything else can use react-helmet-async.

The Two-Wave Model

WaveTimingWhat Googlebot seesTags that must be here
Wave 1Immediate crawlRaw HTML from server/CDNviewport, theme-color, og:image (fallback), canonical (fallback)
Wave 2Hours to days laterFully rendered React appAll per-page tags via react-helmet-async

Core Philosophy

Correctness before optimization. A broken canonical or wrong hreflang cluster causes more damage than no implementation at all. Test every meta tag with Google's Rich Results Test and the URL Inspection tool before declaring a page SEO-ready.

Mandatory Workflow

  1. Implement per-page meta tags with react-helmet-async

    Every page needs a unique title (max 60 chars), description (140–155 chars), and canonical URL. Setup: npm install react-helmet-async, wrap root with <HelmetProvider>. Title formula: [Page keyword] – [Site Name]. Canonical: always absolute URL, no trailing slash. For dynamic pages (blog posts, skill pages), derive from the data object - never hardcode.

    <Helmet>
      <title>{post.seo.title}</title>
      <meta name="description" content={post.seo.description} />
      <link rel="canonical" href={`https://stikastudio.com/blog/${post.slug}`} />
      <meta name="robots" content="index, follow" />
    </Helmet>
  2. Add JSON-LD structured data

    Structured data unlocks rich results (Article bylines, FAQ dropdowns, BreadcrumbList) and increases CTR. Validate at validator.schema.org and Google Rich Results Test before deploying. Inject via Helmet: <script type="application/ld+json">{JSON.stringify(schema)}</script>.

    // Article schema - required fields
    const articleSchema = {
      "@context": "https://schema.org",
      "@type": "Article",
      "headline": post.seo.title,
      "datePublished": `${post.publishedAt}T00:00:00Z`,
      "dateModified": `${post.updatedAt}T00:00:00Z`,
      "author": {
        "@type": "Person",
        "name": "Stika Studio",
        "url": "https://stikastudio.com"
      },
      "publisher": {
        "@type": "Organization",
        "name": "Stika Studio",
        "logo": { "@type": "ImageObject", "url": "https://stikastudio.com/images/logoStika.png" }
      }
    };
  3. Configure hreflang for EN/FR/AR

    Without hreflang, Google shows the wrong language version - French users see the English page, hurting CTR. hreflang must be bidirectional - if the EN page points to FR, the FR page must point back to EN. The hreflangLinks() helper in scripts/generate-sitemap.js enforces this automatically. Always include x-default.

    <link rel="alternate" hreflang="en" href="https://stikastudio.com/page" />
    <link rel="alternate" hreflang="fr" href="https://stikastudio.com/page?lang=fr" />
    <link rel="alternate" hreflang="ar" href="https://stikastudio.com/page?lang=ar" />
    <link rel="alternate" hreflang="x-default" href="https://stikastudio.com/page" />
  4. Optimize Core Web Vitals

    LCP target: < 2.5s. Add fetchpriority="high" loading="eager" on the hero image. Add <link rel="preload" as="image" href="/hero.webp"> in <head>. Serve WebP/AVIF. CLS target: < 0.1. Always set explicit width and height on <img> - browser reserves space before load. INP target: < 200ms. Break tasks > 50ms with await scheduler.yield(). Wrap non-urgent React state with startTransition.

  5. Audit and maintain sitemap.xml

    The sitemap is the crawl budget allocation document. Run node scripts/generate-sitemap.js after every new page. After deploying: submit to Google Search Console → Sitemaps. Check for 404s in Coverage - a 404 in the sitemap wastes crawl budget.

    # Regenerate sitemap
    node scripts/generate-sitemap.js
    
    # Verify URL count before and after
    grep -c "<url>" public/sitemap.xml
    
    # Check hreflang output
    grep -A3 "xhtml:link" public/sitemap.xml | head -20
    
    # Firebase Hosting cache headers in firebase.json
    # /static/** → max-age=31536000, immutable
    # /*.html → no-cache, no-store, must-revalidate

Core Web Vitals Quick Reference

MetricGoodNeeds WorkPoorPrimary fix
LCP< 2.5s2.5–4.0s> 4.0sPreload hero image, serve WebP
CLS< 0.10.1–0.25> 0.25Set explicit img dimensions
INP< 200ms200–500ms> 500msBreak long tasks, startTransition

Edge Cases & What Not to Do

  • react-helmet-async tags only land in Wave 2. If a page must be indexed immediately, add the meta tags to public/index.html as a temporary measure. This is especially critical for canonical and noindex tags - a missing noindex in Wave 1 means a page can be indexed before Wave 2 processes the directive.
  • Duplicate canonicals are worse than no canonical. If the canonical on /blog/post points to /blog/post/ (trailing slash), Google treats them as different pages. Normalize all URLs to no-trailing-slash.
  • Unidirectional hreflang is silently ignored. Always bidirectional. The hreflangLinks() helper enforces this - use it, don't hand-write hreflang.
  • Do not add JSON-LD or hreflang to noindexed pages - wasted effort and confuses crawl analysis.
  • Do not set Cache-Control: max-age=31536000 on index.html. CRA's output hash changes on every build - index.html must always be no-cache so users get the latest version.

When to Break the Rules

For pages with noindex (internal tools, staging environments, thank-you pages), skip all SEO implementation except the robots meta tag. Adding JSON-LD and hreflang to a noindexed page is wasted effort and can confuse crawl analysis tools.

Key Files

  • src/components/SEO/SEO.js - shared Helmet wrapper; extend here first before adding one-off Helmet tags
  • scripts/generate-sitemap.js - sitemap generator; run node scripts/generate-sitemap.js to regenerate
  • public/sitemap.xml - output; committed and served statically by Firebase Hosting
  • public/index.html - global head tags; anything that must land in Wave 1 goes here
  • firebase.json - hosting headers config; Cache-Control rules for static assets and index.html

Explore all agents

Browse the full library of specialized AI agents - Content, Engineering, Localization, and Growth.