← Retour au blog
tech 9 May 2026

Why I Banned Query Strings in URLs

Query strings in URLs can be a nuisance. Learn why and how to avoid them for better site management.

Article inspired by the original source
I’ve banned query strings ↗ chrismorgan.info

Introduction

Query strings are ubiquitous on the web. You've probably seen them: those sequences of characters that follow a question mark in a URL. But why do some developers choose to ban them? This article explores the reasons behind this decision and possible alternatives.

What is a Query String?

A query string is a part of a URL that contains key-value pairs, separated by &. For instance, in https://example.com/page?utm_source=google&utm_campaign=spring_sale, the part after the ? is the query string. It's often used for marketing tracking or passing parameters to servers.

Problems with Query Strings

1. Invasive Tracking

Query strings are often used for tracking users via UTM (Urchin Tracking Module) parameters. According to a 2023 study, about 50% of URLs containing query strings are used for marketing and tracking purposes, which can pose privacy issues.

2. Complexity and Security

Adding query strings can also introduce security vulnerabilities. For example, they can be manipulated to execute Cross-Site Scripting (XSS) attacks. Moreover, they add unnecessary complexity to URLs, making debugging and maintenance more difficult.

Alternatives to Query Strings

1. Using Headers

Information typically transmitted via query strings can often be sent through HTTP headers. This keeps URLs clean while transmitting necessary data to the server.

2. Server-Side Storage

For sites requiring session or user tracking, server-side data storage is a more secure alternative. This eliminates the need to transmit sensitive information in URLs.

Implementing a No Query String Policy

Chris Morgan, a web developer, recently decided to ban query strings on his site. Using a Caddy server, he configured his site to ignore any unauthorized query strings. This approach ensures that only necessary information is transmitted and stored.

Conclusion

Banning query strings might seem radical, but it brings numerous advantages in terms of security, privacy, and simplicity. If you are a developer or site owner, consider how you can implement these practices to improve your site.

Let's discuss your project in 15 minutes.

query strings URL security web development privacy HTTP headers
Deepthix newsletter · 100% AI · every Monday 8am

An AI agent reads tech for you.

Our AI agent scans ~200 sources per week and ships the best articles to your inbox Monday 8am. Free. One click to unsubscribe.

Visit the newsletter page →

Want to automate your operations?

Let's talk about your project in 15 minutes.

Book a call