Sub topic 7
Lay out the keyword map
This chapter covers the structure of the keyword map: which columns it has, what goes in each one, and how to check the file so it stays usable. It assumes you can edit a CSV file or spreadsheet. It also assumes you have a rough keyword list, a site inventory, and an intent label for each keyword, all from earlier chapters. Here you decide where those results get recorded.
What the layout must do
A keyword map is a table with one row per page. A page is one URL that exists, or one URL you plan to create. Each row answers four questions:
- Which page is this?
- What is the one search topic it is meant to win?
- Which related phrases does it also cover?
- What does the searcher want, and is the page built yet?
If a row cannot answer these, the map will fail when you assign clusters to pages, look for cannibalization, or plan content. Cannibalization means two of your pages competing for the same search. Design the layout first, because every later step reads from it.
Use a flat table, not a nested outline. Spreadsheets and CSV files filter, sort, and count flat rows well. They also work with scripts, and you will use one later in this chapter. Put hierarchy in a column, not in the table's shape.
The core columns
The table below lists a working minimum. Add columns only when a decision depends on them.
| Column | What it holds | Rule |
|---|---|---|
| `url` | Path of the page, such as `/running-shoes/` | Unique in the file. Planned pages get the URL you intend to use. |
| `page_type` | `home`, `category`, `product`, `article`, `tool`, and so on | Use a short fixed list of values. |
| `primary_keyword` | The one topic the page targets | Exactly one per row. |
| `supporting_keywords` | Close variants and related phrases | Separate with semicolons. Keep them in the same cluster. |
| `intent` | `informational`, `commercial`, `transactional`, or `navigational` | One value, matching the intent of the primary keyword. |
| `status` | `existing` or `planned` | Separates what is live from what is a proposal. |
| `notes` | Free text for actions | Short and practical, such as "needs new intro copy". |
Why exactly one primary keyword
The primary keyword is a claim: "this page is the best answer for this topic on our site." Two pages with the same claim split the work, and search engines may rank neither well. A page can cover many phrases, but only one is the primary. The others go in supporting_keywords.
If you cannot choose between two phrases, check whether they belong to the same cluster. If they do, pick the one with the clearest intent and put the other in the supporting column. If they do not, you probably need two pages.
Why intent is a column
Intent keeps the page type honest. A commercial phrase such as "best running shoes" usually needs a category or comparison page. An informational phrase such as "how to choose running shoes" usually needs an article. When the page_type and intent columns disagree, that row needs a second look. A filter on the sheet will find those rows quickly.
Why status matters
Without status, a map mixes facts and plans. A reader cannot tell whether /running-shoes/trail/ is live. Two values are enough for most sites. If your team also needs to track pages that have been merged or removed, add a value such as retired, but add it to the documented list first.
A minimal map
This file follows the layout above. Each row is one page.
url,page_type,primary_keyword,supporting_keywords,intent,status,notes
/running-shoes/,category,running shoes,"best running shoes; buy running shoes",commercial,existing,needs new intro copy
/blog/how-to-choose-running-shoes/,article,how to choose running shoes,"running shoe fit; running shoe size guide",informational,existing,link to category
/running-shoes/trail/,category,trail running shoes,"trail shoes; off-road running shoes",commercial,planned,no page yetThree details are worth noting:
- Fields that contain commas or semicolons are wrapped in double quotes. Semicolons separate keywords inside a field, so the CSV commas never collide with them.
- The planned row has a real URL. You can now check that URL against the site's structure and against other rows before the page exists.
- Each primary keyword appears once in the whole file.
How the pieces feed the rows
Each column draws on work from an earlier step. The diagram shows where each value comes from.
The inventory fills url, page_type, and status for existing pages. Clusters supply the keywords. Intent labels come from checking the search results. For gaps, the work starts from a cluster that has no page, so you create a planned row with a proposed URL.
Filling the map in a sensible order
- Enter every existing page from the inventory, with
statusset toexisting. Leave the keyword columns empty for now if you have not assigned them. - Assign each cluster to one page, as described in the next chapter. Write the cluster's main phrase in
primary_keywordand the rest insupporting_keywords. - For clusters with no suitable page, add a new row with
statusset toplannedand a proposed URL. - Fill in
intentfrom your classification. - Run the validation script, then review the flagged rows by hand.
An existing page with an empty primary keyword is a finding in itself. It means the page has no stated purpose, and you must decide whether to assign it a topic, merge it into another page, or remove it.
Validate the layout with a script
A map of a few dozen rows can be checked by eye. A map of thousands cannot. This script reads the CSV and reports rows that break the rules above. It checks for duplicate primary keywords, duplicate URLs, missing values, and status or intent values outside the allowed lists.
import csv
from collections import defaultdict
ALLOWED_STATUS = {"existing", "planned"}
ALLOWED_INTENT = {"informational", "commercial", "transactional", "navigational"}
pages_by_keyword = defaultdict(list)
seen_urls = set()
with open("keyword_map.csv", newline="", encoding="utf-8") as f:
for line_no, row in enumerate(csv.DictReader(f), start=2):
url = row["url"].strip()
keyword = row["primary_keyword"].strip().lower()
if url in seen_urls:
print(f"line {line_no}: duplicate URL {url!r}")
seen_urls.add(url)
if not keyword:
print(f"line {line_no}: {url!r} has no primary keyword")
else:
pages_by_keyword[keyword].append(url)
if row["status"].strip() not in ALLOWED_STATUS:
print(f"line {line_no}: unknown status {row['status']!r}")
if row["intent"].strip() not in ALLOWED_INTENT:
print(f"line {line_no}: unknown intent {row['intent']!r}")
for keyword, urls in pages_by_keyword.items():
if len(urls) > 1:
print(f"{keyword!r} is the primary keyword of {len(urls)} pages: {urls}")Line numbers start at 2 because line 1 is the header. Keywords are lowercased and stripped before comparison, so "Running Shoes" and "running shoes " count as the same keyword. The script prints nothing for a clean file.
The script catches exact repeats only. It will not catch "running shoes" and "running shoe" as two entries for the same topic. Treat a clean result as proof that the layout is valid, not that the topics are distinct. For topic overlap, use the clustering and cannibalization steps.
Common errors
- Several primary keywords in one cell. Cells like "running shoes; trail shoes" in
primary_keywordhide the overlap that the script looks for. Move all but one into supporting keywords, or split the page. - One supporting keyword used by two rows. The script does not check this by default. Supporting phrases that appear on several rows often point to overlapping pages, so sort the sheet by that column occasionally.
- Planned pages without URLs. A row with a blank URL cannot be checked for duplicates or linked from the architecture. Always enter a proposed path.
- Free-text values in controlled columns. "Commercial," "commercial intent," and "comm." split your filters. Use a dropdown or the validation list.
- Metrics crammed into the main table. Volume and difficulty are useful, but they come from keyword-level data and change often. Keep them in a separate keywords sheet and look them up by keyword, rather than copying them onto every page row.
- Editing without a record. When several people edit the map, a changed primary keyword silently changes a page's target. Keep the file in version control, or keep a change-log column or sheet.
Decisions to make before you start
- Column names. Choose them once and do not rename them. Scripts and formulas depend on them.
- Controlled values. Write the allowed values for
page_type,intent, andstatusat the top of the sheet or in a README. - Ownership. Name one person who approves changes to primary keywords.
- URL format. Decide on trailing slashes and lowercase paths now, so the same page is never entered twice in two forms.
Exercise
A map has two rows. Row A is /running-shoes/ with primary keyword "running shoes". Row B is /blog/best-running-shoes/ with primary keyword "Running Shoes " (capital letters and a trailing space). The script from this chapter prints no duplicate warning. Is that right, and what should you do?
Show answer
The script does warn. It strips whitespace and lowercases each primary keyword, so both rows become "running shoes", and it prints that the keyword is the primary keyword of two pages. Treat this as planned cannibalization. Decide which page should own the topic. Usually the commercial phrase goes to the category page. Then change row B's primary keyword to a distinct informational topic, or move "running shoes" into its supporting keywords, or merge the pages if they serve the same intent.