URL parameters or query strings are the part of a URL that typically comes after a question mark (?) And are used to pass data along with the URL. They can be active parameters that modify the content of the page or passive parameters used mainly for tracking and do not modify the content.
They consist of key-value pairs, where the key indicates what data is being passed and the value is the data you are passing, such as an identifier. They look like? Key = value but can be separated by ampersands (&) like? Key = value & key2 = value2 if there is more than one pair.
In this guide, we’ll cover what you need to know about URL parameters.
How parameters are used
As mentioned in the introduction, the parameters can be active or passive. Let’s take a look at some examples of each.
Active parameters
Active parameters modify the content of the page in some way.
Filter. Removes some of the content, leaving more specific content on the page the user wants to see. An example of this is faceted browsing in e-commerce.
?color=yellow
To sort. Reorder the content in some way, such as by price or rating.
?sort=highest_rated
paginated. Divide the content into a series of related pages.
?p=2
To translate. Change the language of the content.
?lang=de
Research. Query a website for the information a user is looking for.
On our search engine, yep.com, we use the “q” key for the query and the value contains information about the user’s query.
?q=ahrefs
Passive parameters
Passive parameters do not change the content. They are typically used for monitoring. Let’s take a look at some examples of each.
Affiliate ID. It transmits an identifier used to track where sales and signups come from.
?id=ahrefs
Advertising tags. Keep track of advertising campaigns.
?utm_source=newsletter
Session ID. Identify a particular user. It is not common on modern websites to use session IDs to track users.
?sessionid=12345
Video timestamp. Skip to designated timestamp in a video.
?t=135
SEO implications
URL parameters can cause a number of different problems when it comes to SEO, especially in cases where multiple parameters are used. Here are some of the problems you may encounter.
Passive parameters can cause problems with duplicate content. Typically, you want them to be crawled, and each page should have a canonical set for the major version.
There may be times when you want to block the full crawl of these parameters using robots.txt, but only in situations where you may have issues with your crawl budget. We will talk about it later.
Google will choose a version of the page to index in a process called canonicalization and report how links will consolidate to that indexed version.
Active parameters can create pages with nearly duplicate content or content that is very similar to other content. They can also be completely different content. You will need to check what your parameters actually are for.
Internal links
You should avoid passive parameters such as those used for tracking on internal links (links from page to page on your site).
This is still an all too common practice on larger sites, but I want to point out that it’s an old and outdated practice that you shouldn’t be doing.
Most analytics systems have event tracking that you can use instead of logging data anyway without adding parameters to your URLs.
In most cases it is okay to use active parameters on internal links.
Crawling
Infinite URL paths with parameters or tons of different combinations can cause problems with crawling. Keep order consistent and have no paths that allow you to add additional parameters.
You can easily find potentially infinite paths using the Depth report under the Structure Explorer tool in Site Audit. It is not common for websites to have 9+ levels, so this is a strong indicator that there may be infinite paths or some other problem.
Google will make changes as it recognizes infinite paths or certain patterns when crawling. It will try to limit crawling of URLs it deems not useful or repetitive.
Internationalization
URL parameters are sometimes used for international websites. These are listed as an option for locale specific URLs. But even Google says it’s not recommended. It adds another layer of complexity where more things can go wrong. Additionally, you will not be able to geotarget these URLs in Google Search Console.
E-commerce
Parameters are commonly used in ecommerce for everything from tracking, pagination, to faceted navigation. These topics can be quite complex, so I recommend reading the blog posts I’ve linked to to understand them better.
JavaScript
Is there a growing trend where people use # instead of? as a fragment identifier, especially for passive parameters such as those used for tracking. This is generally not a good idea. But in specific cases, it might be okay to do this to override unnecessary parameters. I tend to advise against it due to all the problems.
The problem is anything after a # has been ignored by servers and many systems simply don’t recognize or can’t recognize parameters using a #.
Also, # already has a designated use case, which is to scroll to a part of the page. This is done on the client side and JavaScript developers can also use it to “route” to a page with different content.
Auditing
It is a good idea to check which parameters are used on your site. In site audits Page explorer tool, you can search for URLs that contain a question mark (?).
You can use advanced filters to find pages with multiple parameters or start excluding parameters to help you identify all the various parameters used on your website.
Once you know what parameters are used, I recommend that you check a few pages to see what the parameters actually do.
You can also check out the Duplicates report for exact or near duplicates. The visual makes it easy to see if you have many versions of the same or similar pages and whether or not they have matching canonical tags to choose a preferred version. You can click on each cluster to get more information.
There is also an option under “Batch Export” which allows you to export all duplicate content at once. I find this option easier to use for larger data sets.
Control parameters
Previously, Google had a URL parameter tool in Google Search Console where you could choose how to treat different parameters based on whether or not the page content changed. The tool was retired in early 2022. Here’s what Google said about it:
When the URL Parameters tool was launched in 2009 in Search Console’s predecessor, Webmaster Tools, the Internet was a much wilder place than it is today. SessionID parameters were very common, CMSs had trouble organizing parameters, and browsers often broke links. With the URL Parameters tool, site owners had granular control over how Google crawled their site by specifying how certain parameters affected their site’s content.
Over the years, Google has gotten a lot better at guessing which parameters are useful on a site and which, put simply, are useless. In fact, only about 1% of the parameter configurations currently specified in the URL Parameters tool are useful for crawling. Due to the low value of the tool for both Google and Search Console users, the URL parameters tool will be retired in 1 month.
While not mentioned, I suspect some users may have gotten hurt with the tool. I have come across this in the past where someone entered a wrong setting that said the content hasn’t changed, but it has. This removed a few hundred thousand pages from that site’s index. Oops!
You can let Google crawl and figure out how to manage parameters for you, but you also have some controls you can take advantage of. Let’s take a look at your options.
Canonical tags
A canonical tag can help consolidate signals to a chosen URL, but it requires crawling each additional version of a page. As mentioned above, Google may make changes as it recognizes patterns and these canonized URLs may be crawled less over time.
This is what I would opt for by default. But if a site has a lot of problems and the parameters are out of control, I might look into some of the other options.
Noindex
A noindex meta robots tag removes a page from the index. This requires scanning a page. But again, it may be scanned less over time. If you need signals to consolidate other pages, I will avoid using noindex.
Block in robots.txt
Parameter blocking in robots.txt means pages may still be indexed. They are unlikely to appear in normal searches.
The problem is that these pages will not be scanned and will not consolidate the signals. If you want to consolidate the signals, avoid locking the parameters.
Site verification
When you set up a project in Site Audit, there is a toggle in the scan settings called “Remove URL parameters” that you can use to ignore any parameterized URLs.
You can also exclude URLs parameterized in the crawl setup using pattern matching.
Side note.
Fun fact: we only count the canonical version of the pages in the crawl credits.
Final thoughts
To sum it up, URL parameters have many different use cases and may or may not cause problems for your site. Everything is situational.
write me on Twitter if you have any questions.