Fixing WordPress When Changing DNS

I ran into an issue with WordPress yesterday when I reset my router. In short, the reset changed my IP Address. I updated the pointers for my domains and all started working again – except for my WP sites, which I access by IP Address rather than domain name.

Basically, the first page’s content would download, but then the server would start looking for things at the old IP Address. Since it couldn’t make contact, loading eventually timed out.

It turns out that WP stores the domain name (even if it’s just an IP address) in the database and uses this as the default root when loading up files and modules.

The solution is to update the site’s option_value field for the first 2 rows (‘siteurl’, ‘home’) in the wp_options table with the new IP Address.