A query string is the portion of a URL that begins with ? and contains parameters as key=value pairs separated by &. Servers and scripts read it to filter, search, sort or track.
Why it matters
Query strings let one page serve many views, like ?page=2 or ?q=shoes. They are also used for marketing tags such as utm_source. Many parameter combinations can create duplicate URLs for search engines, and sensitive data must never be placed in them.
When building URLs in code, use your language's URL or parameter-encoding functions rather than string concatenation, which is the usual source of broken encoding.
Example
https://example.com/search?q=blue+shoes&sort=price&page=2
Spaces become + or %20. A literal ampersand in a value must be written as %26.
Common mistakes
- Putting passwords or tokens in the query string, where logs and referrers expose them.
- Forgetting to percent-encode special characters.
- Letting tracking parameters create thousands of duplicate indexable URLs.
Related
Get notified when this term updates
Plus occasional practical tips on uptime and monitoring, nothing else. Unsubscribe anytime.
This page is general information written by our editorial team and updated when documentation changes. Servers and providers differ, so test changes safely first. See our editorial policy and disclaimer.