If your WordPress site displays its raw IP address (like http://192.0.2.1) in the browser address bar instead of your domain name, the fix is to update the Site Address (URL) in WordPress settings and, if needed, correct your DNS and server configuration. This usually happens after moving a site, changing hosts, or misconfiguring the database, and it can break links, SSL, and SEO if left alone.
Why This Happens
WordPress stores two key URLs in the database: Site Address (URL) and WordPress Address (URL). The Site Address is what visitors see in their browser; the WordPress Address is where the core files live. When you install WordPress or migrate it, these values are set to whatever was used during setup. If you originally accessed the site via an IP (e.g., during a temporary install or a server test), WordPress will keep using that IP until you tell it otherwise.
Other common triggers include:
- Editing
wp-config.phpwith a hardcoded IP in theWP_HOMEorWP_SITEURLconstants. - Moving a site from a staging server to a live domain without updating the database.
- Using a plugin that overwrites the home URL, or a caching plugin that serves stale redirects.
- DNS misconfiguration where the domain doesn’t point to your server, so the browser falls back to the IP you typed.
Quick Fix via wp-admin
The simplest fix works if you can still log into the dashboard. Go to Settings → General and check the two URL fields:
- Set WordPress Address (URL) to
https://yourdomain.com(orhttpif you’re not using SSL). - Set Site Address (URL) to the same domain.
- Click Save Changes.
WordPress will immediately redirect to the new URL. If you get a “database update required� screen, that’s normal—just click the button and continue. If you can’t log in (because the IP redirects you away), use the database method below.
Fixing via phpMyAdmin (Database)
When the dashboard is unreachable, edit the wp_options table directly. In phpMyAdmin (or your host’s database manager):
- Open your WordPress database.
- Find the
wp_optionstable (the prefix may differ if you changed it). - Look for
siteurlandhomerows. - Edit both to your full domain, e.g.,
https://yourdomain.com. - Save and clear any caching plugin’s cache.
Be careful not to change other rows. A safer alternative is to run an SQL query in the SQL tab:
UPDATE wp_options SET option_value = 'https://yourdomain.com' WHERE option_name IN ('siteurl', 'home');
This updates both at once. If you have a multi-site network, the relevant options are in wp_sitemeta instead.
Using wp-config.php Constants
You can also force the URLs by adding these lines to wp-config.php before the “That’s all, stop editing� comment:
define('WP_HOME', 'https://yourdomain.com');
define('WP_SITEURL', 'https://yourdomain.com');
This overrides the database values. It’s a reliable method during troubleshooting, but once the site works, you can remove the lines and use the settings page instead—otherwise, future changes in the dashboard won’t take effect.
DNS and Server Checks
If the URL is correct in WordPress but the browser still shows the IP, the problem is outside WordPress. Check that your domain’s DNS records point to your server’s IP address. You can use an online DNS lookup tool or your domain registrar’s dashboard. If the A record is missing or wrong, the domain won’t resolve, and you’ll have to type the IP to reach the site.
Also, ensure your web server (Apache, Nginx) is configured to respond to the domain name. On Apache, the virtual host must include ServerName yourdomain.com. On Nginx, the server_name directive should match. If the server only listens for the IP, it may ignore the domain or redirect to the IP.
Common Pitfalls and Misconceptions
One common mistake is editing only the Site Address and leaving the WordPress Address as the IP. Both must be set to the same domain, otherwise WordPress will still load assets or redirect from the old IP. Another pitfall is forgetting to update the database after moving a site—even if you change the DNS, the database still holds the old IP.
A misconception is that the IP address in the browser is caused by a plugin or theme. While some caching plugins can store redirects, they rarely cause the IP to appear in the address bar. That’s almost always a URL setting or DNS issue. Also, don’t confuse this with the “Server IP� shown in hosting panels—that’s just your server’s address, not a WordPress setting.
Preventing It in the Future
To avoid this issue when migrating or setting up a new site:
- Always use the final domain name during installation, even if you’re testing on a temporary URL.
- If you must install with an IP, update the URLs immediately after moving.
- Use a migration plugin that automatically updates URLs in the database, or run a search-replace tool (like WP-CLI’s
wp search-replace) to change all IP references to the domain. - Keep a backup of
wp-config.phpand the database before making changes.
Frequently Asked Questions
Why does my WordPress site show the IP address after I changed the domain?
WordPress stores the URLs in the database, so changing the domain in the registrar or DNS alone doesn’t update the site. You must update the Site Address and WordPress Address in Settings, or edit the database directly.
Can I fix this without phpMyAdmin access?
Yes. If you can still log in to wp-admin, use the Settings page. If not, you can add the WP_HOME and WP_SITEURL constants to wp-config.php via FTP or your host’s file manager.
Will changing the Site Address break my site?
It can temporarily break links or images if there are hardcoded IP references in your content or theme. Use a search-replace plugin to update all occurrences, and clear caches after saving.
What if the IP address appears with a port number (e.g., :8080)?
That indicates your server is running WordPress on a non-default port, often during development. You’ll need to configure your web server to listen on port 80 (HTTP) or 443 (HTTPS) and update the URL accordingly.
Is it safe to have my site accessible via IP?
It’s not ideal for production because SSL certificates are issued for domains, not IPs, and search engines may index the IP version. It can also confuse users. Fix the URL to your domain for security and consistency.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.
More cards in this drawer
- Philips DST7060/20 7000 Series Iron: Specs & Fit
- Coal Fueled Jet Aircraft: Could It Work?675 L
- Remote Desktop on Raspberry Pi: How to Enable It
- Word Select Last Line in Paragraph?
- Google Assistant IFTTT Recipes: 7 Useful Automations
- OLED TVs in Dark Rooms: Why They Look Better and When They Don’t