---
description: Automatically updating SEO and Site Architecture for new pages or blog posts
---

# SEO & Site Architecture Maintenance Workflow (v2)

Scope: Every time you add or modify pages/tests/blog posts, you MUST update SEO, information architecture, and discoverability automatically. Do not wait for the user to ask.

## A) URL & Slug Rules (Non-Negotiable)
1) **No random IDs in public URLs**
   - Never use /a8f93k or /post-123. Use human-readable long-tail slugs.

2) **Long-tail, keyword-rich slugs**
   - Slugs MUST include primary keyword + close variants when natural.
   - Example pattern (English):
     - `/en/iq-test-iq-tests-adhd-test-adhd-tests`
   - Example pattern (Estonian):
     - `/et/iq-test-iq-testid-ath-test-ath-testid`
   - Keep slugs readable; avoid keyword stuffing that looks spammy. Use 3–10 tokens.

3) **Stable canonical structure**
   - Always under `app/[lang]/...`
   - Never change an existing slug without:
     - adding 301 redirect (or Next.js redirect config)
     - updating canonical tags
     - updating sitemap references

4) **Slug normalization**
   - lowercase
   - hyphen-separated
   - ASCII where possible (transliterate äöüõ -> aouo if required by project rules)
   - max 90 chars
   - no dates unless the date is essential

## B) Metadata & Indexability (must implement)
For every indexable page:
- `generateMetadata()` MUST include:
  - title (55–60 chars target)
  - description (150–160 chars target)
  - canonical URL
  - OpenGraph (title/description/url/type/image)
  - Twitter card metadata
  - hreflang alternates between languages (ET/EN + future)

If a page should NOT be indexed:
- set `robots: { index: false, follow: false }`
- add to robots disallow list if needed

## C) On-Page SEO Content Rules
1) **Keyword mapping**
   - Choose:
     - primary keyword
     - 3–8 secondary long-tail variants
   - Integrate naturally into:
     - H1
     - first 100 words
     - at least one H2
     - meta description
     - image alt text (when relevant)

2) **Internal linking**
   - Every new page must link to:
     - 2–5 relevant tests/pages
     - 1–3 relevant blog posts
   - Add backlinks from at least 1 existing page (where relevant) to avoid orphan pages.

3) **Schema.org structured data**
   - Add JSON-LD when applicable:
     - Article (blog posts)
     - FAQPage (FAQ sections)
     - WebPage / BreadcrumbList
     - MedicalWebPage / MedicalCondition (only if accurate and not overstating)
   - Do NOT claim diagnosis or treatment efficacy.

4) **E-E-A-T signals**
   - For medical/psych content pages:
     - author block (credentials)
     - reviewed-by (optional)
     - last updated date
     - citations list (optional, minimal but credible)

## D) Technical SEO Automation Checklist (must run every time)
### 1) New Static Pages
- Create under `app/[lang]/.../page.tsx`
- Implement `generateMetadata()`
- Update `app/sitemap.ts`:
  - add the new relative path to `staticPages`
- Ensure `app/robots.ts` still correct
- Add breadcrumbs component if site uses it

### 2) New Tests
- Add test route under `app/[lang]/tests/<longtail-slug>/page.tsx` (or project’s test routing convention)
- Update `app/sitemap.ts`:
  - add slug to `testSlugs`
- Ensure test landing page has:
  - H1 keyword
  - short intro (100–200 words)
  - FAQ section (2–6 Qs) + FAQPage schema
  - disclaimers: screening-only, not diagnosis

### 3) New Blog Posts
- Add to `lib/blog-posts.ts` with:
  - `titleEt`, `titleEn`, `descriptionEt`, `descriptionEn`
  - `slugEt`, `slugEn` (both longtail)
  - `keywordsEt`, `keywordsEn`
- Confirm `app/sitemap.ts` includes blogs dynamically
- Add Article schema + OG image

## E) Media SEO Rules
- Filenames must be descriptive and keyword-relevant:
  - `adhd-symptoms-adults.webp` not `img123.webp`
- Always include:
  - `alt` text (descriptive + keyword when natural)
  - width/height to prevent CLS
  - modern formats (webp/avif) when possible
- Avoid decorative images that add no SEO value.

## F) Performance & Crawlability
- Avoid heavy client-side rendering for SEO pages; prefer SSR/SSG where applicable.
- Ensure:
  - fast LCP
  - minimal CLS
  - no render-blocking fonts
- Use clean semantic HTML (proper headings order).

## G) Content Safety (medical)
- Do NOT promise outcomes (“cure”, “guaranteed”).
- Always use screening language.
- Provide clear “seek professional help” guidance for high-risk items.

## Must-Do Behavior
- Never ask the user to request SEO updates.
- Automatically execute all steps above on every relevant change.
- If any requirement conflicts with existing project constraints, explain the conflict and propose the closest compliant alternative.