Can Yoast move campaign tracking parameters into URL fragments?

The Citead team, updated

In short. Yoast can move UTM tracking parameters into URL fragments, with analytics behavior depending on client-side support.

Definition: Yes. Yoast SEO's Advanced: URL cleanup setting can redirect Google Analytics tracking parameters from the URL query to a fragment, such as changing ?utm_medium=email to #utm_medium=email.

Key facts

  • Yoast describes URL cleanup as an advanced Crawl optimization feature intended to reduce the impact of URL parameters on performance and security, and warns that incorrect configuration can hurt a site (Yoast's URL cleanup documentation).
  • The same documentation says the cleanup feature can remove unknown query parameters with a 301 redirect, while registered parameters and requests from logged-in users are excluded from that automatic removal.
  • Yoast says it does not remove the commonly used gclid tracking parameter, and it documents a separate setting for optimizing UTM tracking parameters.
  • Google's Analytics Data API documentation says session manual campaign, medium, and source dimensions are populated by utm_campaign, utm_medium, and utm_source URL parameters (Google's API dimensions and metrics).
  • RFC 3986 defines a fragment as the part after # and says the fragment is separated before dereferencing and handled solely by the user agent (RFC 3986).

How does Yoast perform the conversion?

The setting is part of Yoast SEO's Advanced: URL cleanup controls. The documentation describes a redirect from a query parameter to its hash equivalent. Its example is:

?utm_medium=email
#utm_medium=email

The source presents this as a setting for sites that use Google Analytics campaign tagging. It says Google Analytics supports the approach out of the box and connects it with improved crawl efficiency. The same page describes URL parameters as information added to a URL, including values used to identify where traffic comes from.

This control is separate from the removal of unknown parameters. Yoast says the removal feature redirects an unknown parameter such as example.com/?nonsense=true to example.com with a 301 redirect. Registered query parameters remain, logged-in requests are excluded, and Yoast says the commonly used gclid tracking parameter is not removed. UTM handling is documented separately through the hash conversion setting.

What is the analytics implication?

Yoast's documentation specifically describes Google Analytics support for the hash conversion. Google's Analytics Data API documentation, last updated 13 October 2026, maps the manual session dimensions to UTM URL parameters: utm_campaign populates the session manual campaign name, utm_medium populates the session manual medium, and utm_source populates the session manual source.

The URL form still matters to other parts of a measurement stack. RFC 3986 says the query ends at #, while the fragment is separated from the rest of the URI before dereferencing and is handled by the user agent. A client-side analytics script can therefore process a fragment when the documented integration supports it, but a server-side system that relies on the retrieved request URL needs its own test because the fragment is outside that retrieval processing.

The available documentation establishes Yoast's claim for Google Analytics. It does not establish equivalent behavior for every analytics product, tag configuration, proxy, or server-side collector.

What should you test before enabling it?

Yoast recommends extensive testing when a site relies on query parameters for key functionality or tracking, because automatic removal can cause problems if a critical parameter is removed. For the hash conversion, test a tagged landing URL in the actual analytics property and inspect the resulting campaign dimensions named in Google's documentation: session manual source, session manual medium, and session manual campaign name.

Also compare the browser-visible URL with the request data available to server-side logs or middleware. RFC 3986's client-side treatment of fragments means these two observations can differ even when the page and analytics script work as documented.

FAQ

Does the setting delete UTM parameters?

No. The documented setting redirects the tracking values into a fragment, while the cleanup page treats UTM handling separately from the removal of unknown parameters.

Can server-side analytics read the converted values?

RFC 3986 says fragment information is separated before dereferencing and handled by the user agent. A server-side collector therefore needs a product-specific test before relying on values that have moved after #.

Does the setting work with every analytics system?

The Yoast documentation names Google Analytics and says it supports the approach out of the box. It does not document the behavior of other analytics systems.

Sources

  1. Yoast, "Advanced Crawl optimization settings: URL cleanup", 7 April 2026
  2. Google for Developers, "API dimensions and metrics", 13 October 2026
  3. RFC Editor, "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax", January 2005

Check how a page reads to answer engines. Open the GEO score analyzer

Test a page and see what to fix first

The analysis usually takes less than 10 seconds and needs no account.

400,000+ pages scored in the public benchmark