Content Consolidation Analyser
Find groups of queries whose search results share the same URLs, scored 0 to 100 as consolidation candidates.
#about
Groups queries whose search results keep showing the same URLs, a sign one page could target them all, and scores each group from 0 to 100.
Queries link when they share at least four URLs (the default), and groups are found both as loose chains and as cliques where every query overlaps every other.
The score weighs shared URLs, connectivity, size and overlap with other groups.
It runs from the command line.
- Platform
- Python script (requires Python 3.x)
- Input
- SERP or GSC data CSV
- Output
- CSV with one row per query per cluster and 14 columns: cluster_id, cluster_type, query, total_urls, shared_url_count, shared_urls (first five), min_shared_urls, max_shared_urls, avg_shared_urls, connectivity_score, cluster_size, is_in_multiple_clusters, consolidation_score, consolidation_recommendation. Unclustered queries are listed under NO_CLUSTER. Sorted by score, highest first.
- Category
- Content
Use cases
- Identifying keyword cannibalisation issues
- Planning content consolidation projects
- Improving rankings by merging competing pages
- Reducing content debt on large sites
#features
- Clusters queries that share SERP URLs (--min-urls threshold, default 4)
- Connected component and clique detection, both written to the output
- Consolidation scoring 0-100 with recommendation bands
- Connectivity metrics (actual vs possible query connections)
- Overlapping clusters allowed, flagged via is_in_multiple_clusters
- Configurable query and URL column names for any SERP or GSC export
#how-to-use
- Export SERP or GSC data as CSV with one row per query and ranking URL
- Run the script with --input (wildcards supported for multiple files)
- Set --query-col and --url-col unless your columns match the SERP API defaults
- Adjust --min-urls to control clustering sensitivity (default 4 shared URLs)
- Review query clusters with consolidation scores and recommendations
- Check the CSV output; unclustered queries appear under NO_CLUSTER
#faq
- What input format does it expect?
- A CSV (or several, via a wildcard like data/*.csv) with one row per query and ranking URL pair, i.e. a query column and a URL column. The default column names are search.q and result.organic_results.link, which match a flattened SERP API export. For Search Console or rank tracker data you must pass --query-col and --url-col, otherwise the read fails because those exact columns are not found.
- Does it cluster pages or keywords?
- Keywords. Two queries are joined when their result sets share at least --min-urls URLs (default 4), and each output row is a query, not a page. The cluster_id is the shortest query in the cluster; a repeat within the same cluster type is numbered, for example running socks (2). A cluster of queries whose SERPs keep surfacing the same URLs is the signal that one page could target all of them.
- Why does the same query appear in more than one row?
- Two clustering strategies both run and both write to the output: connected components (loose chains of overlap) and cliques (every query overlaps every other). The same group of queries can therefore appear once as cluster_type connected_component and again as clique, and overlapping cliques are allowed. Filter on cluster_type if you want a single view, and use is_in_multiple_clusters to spot queries claimed by several clusters.
- How is the 0-100 consolidation score built?
- Up to 50 points from average shared URLs (5 points per shared URL, capped), up to 30 points from connectivity (the fraction of query pairs in the cluster that actually overlap), up to 20 points from cluster size (5 points per query beyond two), minus up to 10 points when queries also sit in another cluster of the same type (5 points per query). Recommendations map to fixed bands: 80+ strong candidate, 60+ good, 40+ possible, 20+ weak, below 20 keep separate.
- Is there a practical size limit?
- Two steps slow down on large inputs. Similarity is computed for every pair of unique queries, so that part grows with the square of the query count. The clique search then tries combinations of each query's overlapping neighbours, which grows much faster when many queries overlap each other. A few thousand queries across mixed topics is fine; a large set of closely related queries can take far longer. Pre-filter to one topic or folder for big exports. Also note the shared_urls column lists only the first five shared URLs; shared_url_count has the true number.
/contact
Want me to run this for you? I run this tool as a managed service, or build something custom around your data. You get the insights without touching the code.