What Are URL Parameters?
URL parameters (or query strings) are the letters, numbers, and symbols that pass additional information about a URL. They are located at the end of a URL and begin with a question mark ?
, followed by a key-value pair.
Bijvoorbeeld, ?category=yoga is the URL parameter in the URL below.
https://yourdomain.com/products?category=yoga
In the above URL:
?
indicates the beginning of the URL parametercategory=yoga
is the key-value paircategorie
is the key=
is the value separatoryoga
is the value of the key
A URL parameter can contain multiple key-value pairs. In such cases, the key-value pairs will be separated by an ampersand &
. For example, the URL below contains two key-value pairs, category=yoga en difficulty=beginner.
https://yourdomain.com/products?category=yoga&difficulty=beginner
Types of URL Parameters
There are two types of URL parameters:
- Active or content-modifying parameters
- Passive or tracking parameters
1 Content-Modifying Parameters (Active Parameters)
Content-modifying parameters are parameters that alter the content displayed on the webpage. They are commonly used on ecommerce sites to filter the products shown to visitors.
For example, the content-modifying parameter below modifies an ecommerce page to display only medium-sized yellow t-shirts.
https://yourdomain.com/t-shirts/?color=yellow&size=medium
2 Tracking Parameters (Passive Parameters)
Tracking parameters are parameters used to track the source of a click. They are commonly added to URLs included in emails, ads, and other marketing campaigns.
For example, the tracking parameter below indicates the URL is part of a summer sale ad campaign, and the traffic resulted from an email click.
https://yourdomain.com/?utm_source=email&utm_campaign=summer_sale
Importance of Active URL Parameters
Active or content-modifying URL parameters allow visitors to customize a webpage. This is helpful on sites that use faceted navigation. Such sites provide visitors with filters that allow them to modify the content displayed on the page.
Active URL parameters are commonly used on ecommerce sites. They are also used on search results pages. For example, this is what the URL on a Google results page looks like.
Active URL parameters are used on sites that create dynamic pages. Such pages are typically created specifically for that visitor. They are different from static pages, which are webpages that appear the same way to everyone.
Importance of Passive URL Parameters
Passive or tracking URL parameters allow bloggers and marketers to track clicks and other analytic reports related to their ads and marketing campaigns.
This gives them insights into their marketing and allows them to make data-driven decisions. For instance, they could adjust their marketing campaign using the information from the passive URL parameter.
Without passive URL parameters, bloggers and marketers would rely on third-party systems for their analytic reports. Optionally, they could create different URLs for everyone in the campaign. However, this is not sustainable and will not work in most cases.
SEO Implications of URL Parameters
Active and passive URL parameters can cause duplicate or near-duplicate content issues. For example, the active URL parameters below would generate pages with similar content. Specifically, both pages would display large-sized blue-colored yoga mats.
- https://yourdomain.com/yoga-mats?size=large&color=blue
- https://yourdomain.com/yoga-mats?color=blue&size=large
Similarly, the passive URL parameters below lead to the same webpage.
- https://yourdomain.com/yoga-mats?session_id=123
- https://yourdomain.com/yoga-mats?session_id=191
- https://yourdomain.com/yoga-mats?session_id=251
Search engines treat parameter URLs as different pages. So they can crawl en inhoudsopgave the above URLs separately. Considering most sites can generate infinite amounts of active and passive URL parameters, you can quickly find yourself with hundreds, thousands, or even millions of duplicate pages.
Search engines can waste your crawl budget on these duplicate and unimportant pages while leaving nothing for your important pages. This essentially means your important pages would not appear on search results pages.
You can typically avoid this by following technical SEO best practices and specifying your canonical URLs among those duplicate pages. That way, search engines can identify your original page and handle your link gelijkheid en PageRank appropriately.
URL Parameters Best Practices
While URL parameters have their merits, they do have their demerits. Specifically, they can have serious consequences for your SEO and user experience. To avoid those, make sure to follow the best practices listed below.
1 Do Not Include Parameters in Your Internal Links
Internal links should point to clean URLs without any parameters. For the most SEO-friendly and user-friendly experience, ensure the URL is canonical. This is crucial as search engines consider your internal links a signal for determining your canonical URL.
2 Use Lowercase Letters in Your URL Parameters
URLs can be case-sensitive. To avoid confusion, use lowercase letters in your parameters. This ensures consistency with your site’s standard URL pattern and avoids issues that may pop up when search engines or visitors attempt to access mixed-case URLs.
3 Keep Parameters Short and Descriptive
Parameters should use short, clear, and descriptive key-value pairs. This is more important with active parameters that modify a page’s content. Visitors and search engines should be able to understand the sort of content on the page by just glancing at the URL.
4 Display Key Parameters Early in the URL
Include important key-value pairs at the beginning of the URL parameter. For example, the parameter ?lang=en
indicates the webpage should be served in English. It is an important key-value pair and should appear before, say, a tracking parameter.
5 Avoid Unnecessary Parameters
Unnecessary parameters can make your URLs longer than they should. This could cause confusion, slow down page speed, and may even cause you to duplicate key-value pairs in your URLs. Extra parameters can also create redundant URL variations, which will create additional duplicate pages.