SEOmediumtechnical
Limit unnecessary URL parameters
rule · parameters
URL parameters are query string values appended to a URL path. While often necessary for functionality, they can generate hundreds or thousands of near-duplicate URLs, so parameter handling usually belongs in the same discussion as canonical-url and paginated URL strategy.
Code Examples
Tracking Parameters — Always Strip
HTML
<!-- URL: /products?utm_source=newsletter&utm_campaign=summer -->
<!-- ✅ Canonical strips tracking params -->
<link rel="canonical" href="https://example.com/products" />Filter Parameters — Canonicalize to Base
HTML
<!-- URL: /shoes?color=red&size=10 -->
<!-- ✅ Canonical points to base category page -->
<link rel="canonical" href="https://example.com/shoes" />
<!-- OR self-canonicalize if filtered content is indexable -->
<link rel="canonical" href="https://example.com/shoes?color=red&size=10" />Pagination — Self-Canonicalize
HTML
<!-- URL: /blog?page=3 -->
<!-- ✅ Each page self-references -->
<link rel="canonical" href="https://example.com/blog?page=3" />Search Results — Often Noindex
HTML
<!-- URL: /search?q=sourdough -->
<!-- ✅ Search result pages are usually noindexed to avoid thin content -->
<meta name="robots" content="noindex, follow" />Why It Matters
Uncontrolled URL parameters generate duplicate content that wastes crawl budget and splits PageRank across URL variants. Google's URL parameter guidance (opens in a new tab) is the main reference for deciding which parameterized URLs deserve canonical-url consolidation.
Parameter Categories
| Type | Examples | SEO Impact |
|---|---|---|
| Tracking | utm_source, fbclid, gclid, ref | Duplicate content, always strip from canonical-url |
| Session | sessionid, sid, PHPSESSID | Duplicate content, strip from canonical-url |
| Filtering | color=red, size=large | May change content; canonicalize to base |
| Sorting | sort=price, order=asc | Same items, different order; canonicalize to base |
| Pagination | page=2, p=3 | Different content; self-canonicalize or include |
| Search | q=shoes, search=dress | Unique results; usually noindex |
Next.js Canonical with Clean URL
TSX
// Strip tracking params before setting canonical-url
function getCanonicalUrl(url: URL): string {
const trackingParams = ['utm_source', 'utm_medium', 'utm_campaign',
'utm_term', 'utm_content', 'fbclid', 'gclid', 'ref']
const cleanUrl = new URL(url)
trackingParams.forEach(p => cleanUrl.searchParams.delete(p))
return cleanUrl.toString()
}
export async function generateMetadata({ request }): Promise<Metadata> {
const canonical-url = getCanonicalUrl(new URL(request.url))
return {
alternates: { canonical-url },
}
}Parameter Detection Audit
- Use Google Search Console → Legacy tools → URL Parameters (if available)
- Use Screaming Frog (opens in a new tab): Configuration → Spider → Crawl within subfolder, check URLs containing
? - Review your analytics for top parameter combinations
- Check server logs for crawled parameter variants
Exceptions
- Staging, utility, login, account, or internal search pages may intentionally use different crawl or index signals if they are not meant to rank.
- Temporary migration states can produce noisy intermediate signals; flag the live production URL pattern, not one-off transition artifacts.
- When redirects, canonicals, robots directives, or indexability signals conflict, fix the strongest final signal first instead of reporting every downstream symptom as a separate blocker.
Standards
- Use these references as the standard for the final search-facing HTML, metadata, and crawl behavior.
- Check the implementation against Google Search Central: URL parameters before treating the rule as satisfied.
- Check the implementation against Google Search Central: Consolidate duplicate URLs before treating the rule as satisfied.
Verification
Automated Checks
- Inspect rendered HTML and HTTP headers to confirm the expected metadata or crawlability signal is present.
- Test the affected URL with Google Search Console or equivalent tooling where relevant.
- Re-crawl a representative page set after deployment.
Manual Checks
- Confirm the change does not create conflicting canonical-url, robots, or structured-data signals.