Columbia Games · WordPress / 14 May 2026

A domain stored in the WordPress database always comes back to bite local development

A production database dump kept trying to redirect the local stack back to the live domain. Safe URL normalization became part of development startup.

2 min read
Columbia Games · WordPress
WordPressURLDockerstartup

Situation

WordPress stores `home` and `siteurl` in the database, while content and plugin configuration can contain absolute URLs too. Starting locally from a production dump can therefore send the browser straight back to the real site. That is more than an inconvenience: unnoticed redirects can trigger genuine production requests during development.

Approach

I added a startup normalization step that checks the environment-specific WordPress URLs and adjusts them to the local domain. The goal was not a blind global search-and-replace, but controlled rewriting of values known to be environmental. The script was made idempotent so restarts did not accumulate further changes.

Outcome

The local stack reliably stayed on the local domain and needed fewer manual database edits. Startup moved closer to a single-command workflow, which also improved handover and onboarding for other developers.