Dry-run first
Previewing a destructive operation — how many matches, where, and how many — became the most transferable habit in my toolkit.

A find-and-replace across a live site is a small, sharp tool. The failure mode is not subtle: you replace the wrong exact string and something quietly breaks in two hundred posts. The fix was not more confirmation dialogs. It was showing the consequences before causing them.
What a dry run has to show
A count is not enough. "312 matches" tells you nothing about whether you are about to do something foolish. A useful preview lists which posts, how many matches in each, and enough surrounding text for a human to recognise the mistake before it happens.
Guardrails that stop and ask
Some patterns can disturb layout — a fragment that appears inside markup, a marker that only exists in one editor's output. Detecting those and stopping, rather than proceeding with a warning, felt fussy while building it. It has since prevented two genuine messes, which is the entire return on the effort.
- Preview before every bulk operation, with real counts and real context.
- Refuse ambiguous patterns instead of guessing at intent.
- Make the safe path the default one, not the one you have to remember to take.
- Keep a record of what was changed, so it can be reasoned about later.
The habit generalised past plugins. Anywhere I now write something that changes many things at once, the preview comes first and the write happens behind it.
Mentioned in this post
Gloss
Three small plugins that treat content with care
Archived