Replace

Replace query parameters

Replace one repeated query parameter value with another across many URLs.

What this template solves

Use this template when the same query parameter appears across many URLs in docs, config, logs, or test fixtures and needs to be updated consistently.

Open the workspace with this template preloaded, then refine it for your own file and text pattern.

Sample input

https://api.example.com/users?debug=true
/debug?debug=true&mode=fast

Prompt to start from

Replace debug=true with debug=false in the file

Expected command

sed 's/debug=true/debug=false/g'

Tags

replacequeryurlsapi

Best for

  • Update repeated query parameters in API examples.
  • Rewrite tracking or debug flags in copied URLs.
  • Replace stale query parameter values in docs or fixtures.

How to use this template

  1. 1Identify the exact query parameter string to replace.
  2. 2Copy the sed replacement command for the repeated query value.
  3. 3Preview the rewritten URLs on sample input before applying the file-edit command.

Template FAQ

How do I replace a repeated query parameter value with sed?

A common pattern is `sed 's/debug=true/debug=false/g'`, which works well when the same query parameter value appears repeatedly across URLs in docs, config, logs, or fixtures.

When is a replace-query-param template most useful?

It is most useful when you need to update one repeated query flag or tracking value across many URLs without manually editing each example line by line.

Related templates

Explore nearby sed workflows that target similar replace, cleanup, filtering, or rewrite tasks.

Replace query parameters Sed Template | AskSed