Sometimes you need to work on a WordPress website before the domain name is fully active. Maybe the DNS settings are still updating, or the domain has not yet been purchased. In such cases, accessing the website using just the server’s IP address becomes a useful option.
This approach allows developers to start designing, testing, or troubleshooting a website without waiting for the domain to resolve. It is especially helpful during early development, staging, or migration tasks. However, opening a WordPress site through its IP address is not as simple as typing it into your browser.
WordPress is tightly linked to its site URL and home address, which are often saved using the domain name. When accessed through an IP address, the site may behave unexpectedly. You might see broken styles, missing images, or even get redirected back to the domain.
In this guide, you will learn the practical ways to open your WordPress site using its IP address and how to avoid common issues that come with it.
Common Challenges When Using IP
Opening a WordPress website using its IP address might seem like a quick fix, but it often leads to a range of unexpected problems. WordPress uses a specific site URL, which site owners usually set to a domain name. When you try to access the site through the IP, WordPress may not behave the way you expect. Here are some of the most common issues that developers and site owners face in this situation.
Redirection back to the domain
One of the first problems you might notice is that the site keeps redirecting to the domain name, even though you entered the IP address in the browser. This happens because WordPress stores the site URL and home address in its settings, and it continues to use them to build all internal links.
Broken styles and media files
Another major issue is that the site may look completely broken. Images do not load, stylesheets fail, and the layout collapses. This is because WordPress uses absolute URLs to load these assets, and those URLs are still pointing to the domain instead of the IP.
Login and session errors
Trying to log in to the admin dashboard through the IP can also cause trouble. The browser ties cookies to the configured domain, so a mismatch can prevent you from staying logged in or accessing admin features.
SSL certificate warnings
If you set up the site for HTTPS, the browser will likely show a warning when you use the IP. Certificate authorities issue SSL certificates for domain names, not IP addresses, so they cannot verify the connection.
Web server confusion
Some servers are not configured to respond properly to direct IP access. They may show a generic page or nothing at all.
Need Help Migrating or Setting Up WordPress?
Our expert team can migrate, configure, and optimize your WordPress website to run smoothly and securely.
Step-by-Step Methods to Open WordPress Site by IP Instead of Domain Name

When you want to open a WordPress site by its IP address, there is no single solution that works for everyone. It depends on how your server is configured, how your WordPress installation is set up, and whether you are working on a live site or a local environment.
Below are multiple approaches to help you access your site through the IP address. You can use one or a combination of these methods depending on your specific needs. Each one is explained clearly so you can choose what works best for your setup.
Step 1: Update the wp-config.php File
The most direct method is to override the site’s URL settings in the WordPress configuration file. This approach helps WordPress recognize the IP as the base address and stops it from redirecting to the domain name.
Open the wp-config.php
file located in the root folder of your WordPress installation. Add these two lines just before the “stop editing” comment:
define('WP_HOME','http://123.123.123.123');
define('WP_SITEURL','http://123.123.123.123');
Replace the sample IP address with the actual IP of your server.
By doing this, WordPress will load everything using the IP address, including media files, internal links, and admin pages. This method is safe, reversible, and especially useful when DNS has not been updated yet.
Once your domain is ready, make sure to remove these lines and let WordPress return to using its default settings.
Step 2: Edit the Web Server Configuration
Your server might not be set up to respond to requests made directly to its IP. To fix this, you will need to configure your web server accordingly.
For Nginx Users
Open your Nginx configuration file and make the following adjustments:
server {
listen 80 default_server;
server_name _;
root /var/www/html;
index index.php index.html;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php8.1-fpm.sock;
}
}
This tells Nginx to serve your WordPress site as the default response when the server receives an IP request.
For Apache Users
Create or edit a virtual host file that listens to the server’s IP:
<VirtualHost 123.123.123.123:80>
DocumentRoot "/var/www/html"
<Directory "/var/www/html">
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Restart the server after applying the changes. Your WordPress site should now load properly when accessed through the IP address.
Step 3: Modify the Hosts File Locally
If you want to simulate domain access on your own machine without altering global DNS settings, this method is perfect. It only affects your local environment.
On macOS or Linux:
sudo nano /etc/hosts
On Windows, open this file using Notepad in administrator mode:
C:\Windows\System32\drivers\etc\hosts
Then add a line like this:
123.123.123.123 example.test
Now when you enter http://example.test
in your browser, your system will connect directly to the IP address. WordPress will behave normally because it thinks it’s being accessed via a domain.
This method is useful for testing themes, plugins, and content without waiting for a live domain.
Step 4: Change Site URLs in the Database
Another reliable method is to update the site URL and home URL directly in your WordPress database. This can be done using phpMyAdmin or any other MySQL tool.
Run these two queries:
UPDATE wp_options SET option_value = 'http://123.123.123.123' WHERE option_name = 'siteurl';
UPDATE wp_options SET option_value = 'http://123.123.123.123' WHERE option_name = 'home';
Be cautious if your site uses plugins that store serialized data, as changing URLs this way can break those plugins. Always back up your database before making any changes.
Once the domain is ready, you can run a search-and-replace to change the IP back to the proper URL.
How to Switch Back Once Domain Is Ready
After your domain is live and DNS is properly configured, it’s important to revert all temporary settings. Here’s how to switch back:
- Remove the IP-related lines from your
wp-config.php
file if you added them. - Log in to your WordPress admin panel using the domain name.
- Go to Settings and update the Site Address and WordPress Address with the actual domain.
- If you edited the database directly, use a search-and-replace plugin to swap all instances of the IP with the correct domain.
- Reconfigure your web server to serve the domain instead of the IP.
- Clear browser and plugin caches to prevent loading issues.
These steps ensure that your WordPress site works correctly with its domain, and all links, assets, and functions are restored to their proper state.
Troubleshooting Common Issues
Even after setting things up properly, you may encounter a few problems. Here’s how to troubleshoot the most common ones:
Redirection to the domain
If your site keeps redirecting to the domain, it means WordPress is still using the old URL settings. Recheck your wp-config.php
and database entries.
Styles and media not loading
Broken images or missing styles usually indicate that the browser is still trying to load assets from the domain. Updating the site URL or clearing browser cache can help.
Admin login not working
Login issues often happen when the session cookies do not match the IP-based URL. Use a different browser, or log in directly using the correct URL set in WordPress.
Server shows a default page
This means your web server is not configured to recognize the IP request. Double-check your virtual host or server block settings.
Browser SSL warnings
SSL certificates do not support IP addresses. Stick to HTTP when working with IP, or install a temporary self-signed certificate if needed.
Solving these issues will help you build and test your site smoothly until the domain setup is complete.
SEO and Usability Considerations
Running a WordPress site on an IP address may work for development, but it is not ideal for live websites. Here’s why:
Search engine confusion
If Google indexes your site via the IP, it may create duplicate content issues when the domain goes live. Use a robots.txt
file to block indexing temporarily.
User trust
Visitors expect to see a branded domain. An IP address in the browser can look suspicious and reduce trust.
SSL and security
Most SSL certificates are not valid for IPs. You will get browser warnings when accessing secure content through an IP.
Plugin compatibility
Some plugins and themes rely on domain-specific functions. Running them on an IP might cause unexpected errors.
To avoid these risks, always treat the IP access as a temporary measure. Move to a domain-based setup as soon as your domain is ready and active.
Conclusion and Next Steps
Opening a WordPress site using the server’s IP address is a practical solution when your domain name is not yet ready. Whether you are setting up a new website, migrating to a new host, or building in a staging environment, IP-based access allows you to get started without delay.
However, WordPress is built to work with a specific site URL, and accessing it via IP can create challenges like redirects, broken layouts, and login issues. Fortunately, these problems can be resolved with a few targeted fixes. Updating the wp-config.php file, configuring your web server, modifying the hosts file, or adjusting the database are all valid methods depending on your situation.
Once your domain is live, be sure to remove all temporary settings and restore your original site configuration. This will ensure your website runs smoothly, maintains proper security, and performs well in search engines.
If you ever feel stuck, our WordPress experts are here to help.