Sub topic 9
URL variants and duplicate content
This chapter assumes you know basic HTML structure, how query strings work, and what HTTP status codes mean. It explains why one page can end up with many URLs, and what that does to search indexing. The next chapter covers the canonical tag, which is the main fix.
One page, many URLs
A search engine identifies a page by its URL. If the same content loads at several URLs, the engine sees several pages. These copies are called duplicate content. A site does not need to copy anything on purpose. Duplicates usually come from how URLs are built.
Each URL below can return the same product page:
| Variant type | Example |
|---|---|
| Protocol | `http://www.example.com/shoes` and `https://www.example.com/shoes` |
| Host | `https://example.com/shoes` and `https://www.example.com/shoes` |
| Trailing slash | `/shoes` and `/shoes/` |
| Letter case | `/Shoes` and `/shoes` |
| Tracking parameters | `/shoes?utm_source=newsletter` |
| Sort or filter parameters | `/shoes?sort=price` and `/shoes?color=red` |
| Session IDs | `/shoes?sid=8f3a2c` |
| Index files | `/shoes/` and `/shoes/index.html` |
| Print or mobile versions | `/shoes/print` and `/m/shoes` |
Fragments (#reviews) are not in this list. Browsers do not send them to the server, and search engines ignore them when identifying a page.
Why duplicates cause problems
Duplicates do not usually trigger a penalty. The problems are practical:
- Split signals. Links and other signals may be spread across several URLs instead of one.
- Wasted crawling. The crawler spends requests on copies and may reach your new pages later.
- Wrong URL shown. The engine picks one URL to show, and it may pick the one with tracking parameters.
- Muddled reporting. Analytics and search reports are split across variants.
Engines group near-identical pages into a cluster and choose one URL from it to index and show. This chosen URL is the canonical URL. If you give no guidance, the engine chooses for you.
Variants that change the content
Not every parameter makes a duplicate. Compare these:
?utm_source=newsletterchanges nothing on the page. It is a duplicate.?color=redshows a different set of products. It is a distinct page if people might search for it.?page=2shows different items. It is not a duplicate of page 1.?sort=priceshows the same items in another order. It is a near-duplicate.
The test is whether the main content differs in a way a searcher would care about. This test drives the choice of canonical target, covered later in this tutorial.
Finding variants on your own site
Start from the sources of variants: server settings, link generation, and campaign tagging. Check these:
- Request the
http://and non-wwwversions. Do they redirect, or return a page? - Compare
/pageand/page/. Does one redirect to the other? - Look through internal links for parameters, such as links built from filtered views.
- Search for
site:example.com inurl:utm_to see whether tracking URLs are indexed.
Here is a short script that groups URLs by a normalized form so you can see clusters in a crawl export:
from urllib.parse import urlsplit, parse_qsl, urlencode
TRACKING = {"gclid", "fbclid", "sid"}
def normalize(raw):
parts = urlsplit(raw)
query = sorted(
(k, v) for k, v in parse_qsl(parts.query)
if not k.startswith("utm_") and k not in TRACKING
)
host = parts.netloc.lower().removeprefix("www.")
path = parts.path.rstrip("/") or "/"
return f"https://{host}{path}" + (f"?{urlencode(query)}" if query else "")
urls = [
"http://example.com/shoes/",
"https://www.example.com/shoes?utm_source=news",
"https://www.example.com/shoes?sort=price",
]
clusters = {}
for u in urls:
clusters.setdefault(normalize(u), []).append(u)
for key, members in clusters.items():
print(key, len(members))The first two URLs land in one cluster. The sort URL stays separate because the script does not treat sort as noise. You decide that per site.
Exercise
A store has /jackets, /jackets?utm_campaign=spring, /jackets?size=m, and /jackets?page=2. Which URLs are duplicates of /jackets, and which are distinct pages?
Show answer
/jackets?utm_campaign=spring is a duplicate because the tracking parameter does not change the content. /jackets?size=m and /jackets?page=2 show different products, so they are distinct pages, though a filter page like size=m may be a weak candidate for indexing.