# Query string

Category: [Technical SEO](https://seo-geo-glossary.com/en/glossary/category/technical-seo/) › [URLs & domains](https://seo-geo-glossary.com/en/glossary/category/technical-seo/urls-domains/) · Also known as: query component

The **query string** is the part of a URL that starts with a question mark (`?`) and carries additional data as key and value pairs. In RFC 3986 this part is called the query component.

## How is a query string built?

```text
https://example.com/search?q=shoes&page=2
```

- `?` marks the start of the query string.
- `=` joins a key to its value.
- `&` separates multiple pairs.

The string ends at the fragment (`#`) or at the end of the URL. When a value contains special characters, they are percent-encoded. MDN notes that `URL.search` encodes a space as `%20`, whereas `URLSearchParams` uses `+`.

Single pairs inside it are what many SEO texts call URL parameters. The two terms are often used interchangeably, and some authors use "query string" for the whole part and "parameters" for each pair.

## Why does it matter for SEO?

Every different query string creates a different URL. Google recommends `=` and `&` as separators and advises trimming parameters that do not change the content to keep URLs short and prevent crawler bloat. Where parameters create many variations, the page-level handling covers canonical tags, robots.txt rules or internal linking.

## Example

For `https://example.com/search?q=shoes&page=2`, a script reads `q` as `shoes` and `page` as `2`. A search engine sees the URL as a separate address from `https://example.com/search`.

## Common mistakes

- **Parameters that do not change the content.** Google advises limiting parameters to those that affect the content, because otherwise many URLs exist for the same content.
- **Session IDs in URLs.** Google recommends avoiding them where possible and using cookies instead.
- **Inconsistent casing.** Google treats `/APPLE` and `/apple` as distinct URLs. Converting all text to the same case makes it easier for Google to see that URLs reference the same page.
- **Changing content through the fragment.** Google states that Search generally does not support URL fragments, so content that should change needs its own URL.

*Diagram: Anatomy of a URL.* A URL broken into its parts. RFC 3986 defines scheme, host, path, query and fragment. Only the browser evaluates the fragment after #, it is not sent to the server.

## Related terms

- [URL parameters](https://seo-geo-glossary.com/en/glossary/url-parameters/index.md)
- [UTM parameters](https://seo-geo-glossary.com/en/glossary/utm-parameters/index.md)
- [URL](https://seo-geo-glossary.com/en/glossary/url/index.md)
- [Fragment identifier](https://seo-geo-glossary.com/en/glossary/fragment-identifier/index.md)

## Sources

- [URL: search property – MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/URL/search)
- [RFC 3986, section 3.4 Query – IETF](https://www.rfc-editor.org/rfc/rfc3986#section-3.4)
- [URL structure best practices for Google Search – Google Search Central](https://developers.google.com/search/docs/crawling-indexing/url-structure)

---

Last updated: October 8, 2026
URL: https://seo-geo-glossary.com/en/glossary/query-string/
