Why Your WordPress Site Breaks When the Server IP Changes
When a server's public or internal IP address changes, it doesn't just affect network routing; it can break specific dependencies within your application stack. In the case of a WordPress site on a home intranet where the index page loads but CSS and the admin panel fail, the root cause is almost certainly stored references to the old IP address in the database or file system.
WordPress relies heavily on caching mechanisms to improve performance, and these caches often store absolute URLs based on the hostname or IP provided during site initialization. If your server was previously accessible via http://192.168.1.10 and has since been reassigned to a new address, any cached URL pointing to the old IP will result in 404 errors for assets like stylesheets and JavaScript files. Similarly, if you configured a static hostname or IP mapping in your wp-config.php file, that configuration is now stale.
The most common culprit is the "Site URL" and "Home" settings stored directly in the wp_options table. When WordPress loads, it checks these options to determine where to redirect requests and where to load assets from. If the database still holds the old IP address as the canonical host, the application attempts to fetch resources relative to that dead endpoint, causing the CSS to fail to load while the core PHP logic (which might be cached in memory or served via a different mechanism) continues to function partially.
To resolve this without waiting for backups, you can manually update the configuration in the database using an SQL query. Navigate to your site's root directory where your wp-config.php file resides and open it in a text editor. Look for the WP_HOME and WP_SITEURL constants. If they are defined there with the old IP, comment them out or update them to reflect the new address. However, relying solely on the configuration file is often insufficient because the database values override these constants during runtime.
The definitive fix involves updating the wp_options table in your MySQL or MariaDB database. You will need access to your database server and the ability to run SQL commands. Execute the following queries to update both the site URL and home URL options:
UPDATE wp_options SET option_value = 'http://NEW_IP_ADDRESS' WHERE option_name = 'siteurl';
UPDATE wp_options SET option_value = 'http://NEW_IP_ADDRESS' WHERE option_name = 'home';
Replace wp_options with your actual table name if you have a custom prefix, and substitute NEW_IP_ADDRESS with the correct new IP. After running these commands, clear any object caches (such as Redis or Memcached) that might be serving stale serialized data containing the old URLs.
There is also the possibility of hardcoded paths in theme files or plugins referencing the old IP. While less common in standard installations, custom development sometimes embeds server-specific IPs directly into template strings. A quick search using grep can identify these:
grep -r "OLD_IP_ADDRESS" . --include="*.php" --include="*.js" --include="*.css"
If matches are found, update them to the new IP or, preferably, switch to using environment variables or a centralized configuration file if your architecture supports it. This approach makes future migrations significantly easier.
Finally, verify that your firewall or reverse proxy (like Nginx or Apache) is not forcing redirects based on the old IP. If you use a virtual host configuration, ensure the server_name directive matches the new access method. Once the database and file system are aligned with the new IP, refresh your browser with hard reloads (Ctrl+F5) to clear the client-side cache and confirm that the CSS and admin panel load correctly.