How to Find and Replace Text in Bulk
A company changes its name, a product is renamed, a URL moves. The Find and Replace Tool swaps one string for another throughout a block of text, which is simple right up to the moment it is not.
The partial-match trap
This is the mistake that causes real damage. Replacing "cat" with "dog" also changes "category" into "dogegory", "catalogue" into "dogalogue" and "duplicate" into "duplidoge".
It happens because a plain replacement matches anywhere, not at word boundaries. The fix is to make the search string unambiguous: include the surrounding spaces, or search for a longer phrase that cannot appear inside another word. If the word can appear at the start of a sentence, at the end, followed by a comma and followed by a full stop, you have four cases rather than one - and this is exactly where the Regex Tester earns its place, because a word-boundary pattern handles all four at once.
Order matters more than people expect
Running several replacements in sequence means each one works on the output of the last, and that can cascade.
Replace A with B, then B with C, and everything that was originally A is now C. Rename "old" to "new" and then "new" to "latest", and you have renamed two different things into one. The rule is to check whether any replacement creates text that a later replacement will match, and if it does, reorder them or use a temporary placeholder that appears nowhere in the text.
Case is a decision, not a detail
Replacing "London" does not touch "london" or "LONDON" unless the match is case-insensitive. Sometimes that is what you want - leaving code identifiers alone while fixing prose. Sometimes it means missing a third of the occurrences.
And if you match case-insensitively, the replacement is written exactly as you typed it, so a sentence-initial "london" becomes mid-sentence capitalisation or the reverse. Worth a read-through afterwards rather than a glance.
Count first, then replace
Before committing, search for the string and look at how many matches there are and where. A number much higher than you expected is the partial-match problem announcing itself before it does any harm.
Afterwards, compare the before and after with the Text Diff Checker. It takes a few seconds and shows you every change, which is the only way to be sure the one you did not intend is not in there.
Common questions
Can I replace a line break?
Not reliably with a plain text search. Collapsing or normalising whitespace is a job for the Whitespace Trimmer.
How do I delete a string rather than replace it?
Replace it with nothing. Watch for the double space left behind when you remove a word from the middle of a sentence.
Is my text sent anywhere?
No. The replacement happens in your browser.
What if I need different replacements in different places?
Then a blanket replacement is the wrong tool, and you want to edit those places deliberately.
Got a word to change everywhere?