# Template Cannibalization Guide

**Last Updated:** 2026-02-23

Guide for detecting and resolving keyword cannibalization across template pages. Based on Yoast, Moz, and SerpSmoothie best practices.

---

## When to Combine vs. Keep Separate

### Combine (Merge or 301) When

- **Identical search intent** – Multiple pages target the same keyword with the same user need
- **Same primary keyword** – SISTRIX primary matches exactly (e.g. "stundenzettel vorlage")
- **Consolidation boosts authority** – Merging can increase clicks (up to 466% per studies)

**Actions:** 301 redirect to canonical, merge content into one page, or add canonical tag.

### Keep Separate When

- **Different search intents** – Users have distinct goals
- **Different primary keywords** – Each template targets a unique head term
- **Different use cases** – e.g. Dienstplan (duty roster) vs. Schichtplan (shift work) vs. Stundenzettel (time tracking)

**Example:** Dienstplan, Schichtplan, Wochenplan, Stundenzettel – all separate. Different intents per web research.

---

## How to Detect Cannibalization

### 1. Overlap Script (Candidate Keywords)

```bash
php v2/scripts/templates/analyze-template-keyword-overlap.php [--threshold=70]
```

Uses `template-candidate-keywords.json`. Output: `template-merge-recommendations.json` with `merge_candidates` (overlap ≥ threshold).

### 2. SISTRIX-Based Overlap

```bash
php v2/scripts/templates/analyze-template-keyword-overlap.php --use-sistrix
```

Compares `template-data/{id}/data/keywords-sistrix.json`. Adds `sistrix_overlap_candidates` when overlap > 50%. Surfaces cannibalization from actual SISTRIX data.

### 3. Google Search Console

- **Performance** → Filter by query
- Check if multiple Ordio URLs compete for the same query
- Document pages with overlapping impressions

### 4. Manual SERP Review

Search primary keywords (incognito). Note which Ordio URLs appear and whether they compete.

---

## Keyword Assignment Rules

### No Cross-Template Pollution

**Rule:** A template's secondary keywords must NOT include the primary keyword of another template.

**Example (fixed 2026-02-23):** Schichtplan had "wochenplan erstellen vorlage kostenlos" (Wochenplan's primary) in secondary. Removed to prevent cannibalization.

### Before Adding Secondary Keywords

1. Check `template-candidate-keywords.json` for all templates
2. Ensure the keyword is not another template's primary
3. Run `analyze-template-keyword-overlap.php --use-sistrix` after changes

### Data Flow

```
template-candidate-keywords.json
    → collect-template-keywords-sistrix.php (SISTRIX API)
    → template-data/{id}/data/keywords-sistrix.json
```

Polluted candidates lead to polluted SISTRIX data. Fix candidates first.

---

## Consolidation Checklist

When merging or 301-redirecting templates:

- [ ] **Registry** – Set deprecated template `status: "deprecated"`
- [ ] **.htaccess** – Add 301 redirect: `RewriteRule ^vorlagen/old-slug/?$ /vorlagen/new-slug [R=301,L,QSA]`
- [ ] **Canonical** – Ensure canonical page has consolidated content
- [ ] **Content merge** – If merging content, add sections from deprecated page to canonical
- [ ] **sitemap-pages.json** – Remove old URL, keep canonical
- [ ] **llms.txt, llms-full.txt** – Update template URLs
- [ ] **Internal links** – Grep for old slug, update to canonical
- [ ] **submit-template.php** – Remove from `$pageNameMap` if applicable
- [ ] **templates-index-config.php** – Remove from `$publishedTemplatesForIndex`
- [ ] **Redirect test** – Run `test-template-redirects.py`

---

## Current Consolidation Decisions

| Deprecated/Redirect | Canonical | Primary Keyword |
|---------------------|-----------|-----------------|
| shift-planning-advanced | wochenplan-vorlage | wochenplan erstellen vorlage kostenlos |
| wochenplan-premium-vorlage | wochenplan-vorlage | wochenplan erstellen vorlage kostenlos |
| time-tracking-basic | stundenzettel-excel-vorlage | stundenzettel vorlage |
| zeiterfassung-vorlage-excel | stundenzettel-excel-vorlage | stundenzettel vorlage |
| vacation-planning | (content merge) | urlaubsantrag vorlage – add urlaubsplanung section |

---

## References

- [Yoast: Keyword Cannibalization](https://yoast.com/keyword-cannibalization/)
- [Moz: Keyword Cannibalization](https://moz.com/blog/keyword-cannibalization)
- [SerpSmoothie: Find and Fix Cannibalization](https://www.serpsmoothie.com/blog/keyword-cannibalization/)
- [TEMPLATE_PRIORITY_LIST.md](../../v2/systems/excel-template-generator/docs/TEMPLATE_PRIORITY_LIST.md)
- [TEMPLATE_SLUG_MIGRATION_GUIDE.md](TEMPLATE_SLUG_MIGRATION_GUIDE.md)
- [template-merge-recommendations.json](template-merge-recommendations.json)
