Printing your own markup from cached values, and the one trap to avoid.
How we tested it
Names matter more than cleverness. When a function says exactly what it returns, the template that calls it reads like a sentence and the bug has nowhere to hide. We renamed more than we rewrote on this project, and the reviewers noticed. Six months from now that will be worth more than any micro-optimisation we could have shipped.
Migrations fail in the details: serialized data, hard-coded URLs and that one plugin nobody remembers installing. We make an inventory before we move anything, then we move it twice, once for practice. The rehearsal always finds something. Finding it on a Wednesday at a desk is much better than finding it on launch night with the client watching.
wp cron event list --fields=hook,next_run_relative
wp transient delete --expired
wp cache flush
What we would do differently
Good defaults are a kindness to the next person. If a feature only works after someone reads a long page of setup notes, then for most sites it does not work at all. We would rather ship something modest that behaves well on a fresh install than something impressive that needs a careful afternoon before it shows anything.
The numbers moved less than we hoped, and that is worth saying plainly. Posts like this tend to end with a dramatic chart, but real work mostly produces a steady, unglamorous improvement. The page got a little faster, the logs got a lot quieter and the support inbox stopped filling up on Monday mornings. We will take that.
The boring fix
Logs are the cheapest witness you have. Before anyone proposes a theory, we turn on debug logging on a copy of the site, repeat the problem once and read what it left behind. Half the time the answer is sitting there in plain words, and the other half we at least know which theories to stop discussing.
Tomas Lindqvist Aug 23, 2025
Good write-up. I would add a note about checking the logs before you clear anything.
Omar Haddad Oct 11, 2025
Tried this on a client site this morning. The query count dropped straight away.
Noah Bennett Nov 29, 2025
I disagree slightly on the rollback plan, but the rest matches what we do.
Noah Bennett Jan 17, 2026
Thanks for showing the failed attempts as well. That is the useful part.
Aisha Khan Jun 13, 2026
The point about small diffs is the one I keep having to repeat at work.
Lena Fischer Mar 07, 2026
Could you share the checklist as a plain text file? I would like to adapt it.
Tomas Lindqvist Apr 25, 2026
We do something similar with WP-CLI in our deploy step and it has been solid.
Omar Haddad Aug 01, 2026
Sending this to a colleague who is about to start a migration next week.
Grace Tanaka Sep 19, 2026
Nice. One small correction: that hook fires earlier than the post suggests.