Back to Community

Fixing Broken Local WordPress Sites on Your Network

31 threads Sep 16, 2025 CoreLocalhost installs

Content

If you've set up a WordPress site on your local machine using XAMPP, MAMP, or another local server stack, you might run into a common but frustrating issue: the site looks perfect on the host computer but appears completely broken when accessed from another device on the same network. Images are missing, CSS styling is gone, and the layout is a mess. This guide will explain why this happens and walk you through the most reliable solutions.

Why Does This Happen?

The root cause is almost always the WordPress Address and Site Address settings. When you first install WordPress on a local server like XAMPP, it typically configures these addresses to use localhost or 127.0.0.1. These addresses are internal references that only point back to the computer itself.

When you visit the site from another computer on your Local Area Network (LAN), that computer's browser is told by WordPress to load crucial assets (like themes, images, and stylesheets) from localhost. Since localhost on that other computer points to itself and not your server, it fails to find these files, resulting in a broken, unstyled page.

How to Fix It: The Standard Solution

The most effective and common fix is to change the WordPress Address and Site Address to use the local IP address of the computer hosting the server.

  1. Find Your Server's Local IP Address: On the computer running XAMPP/MAMP, open a command prompt or terminal and type ipconfig (Windows) or ifconfig (Mac/Linux). Look for the IPv4 Address (e.g., 192.168.1.20).
  2. Access Your WordPress Database: Open phpMyAdmin from your local server dashboard (e.g., XAMPP control panel).
  3. Update the Settings: Find your WordPress database and look for the wp_options table (the prefix may be different if you changed it during installation). In this table, locate the siteurl and home rows. Change their values from http://localhost to http://YOUR-IP-ADDRESS (e.g., http://192.168.1.20).
  4. Save and Test: Save the changes. You should now be able to access your site from another computer on the network by navigating to http://YOUR-IP-ADDRESS in a web browser.

Alternative Method: Using the Hosts File

If you prefer to use a custom domain name like mysite.local on your network, you can edit the hosts file on every computer that needs access. This method is more advanced and requires configuration on each client machine.

  1. On the server computer, still change the siteurl and home values in the database to your custom name (e.g., http://mysite.local).
  2. On each computer that will access the site, you need to edit the hosts file. Its location is typically:
    • Windows: C:WindowsSystem32driversetchosts
    • Mac/Linux: /etc/hosts
  3. Add a new line to the file: SERVER-IP-ADDRESS mysite.local (e.g., 192.168.1.20 mysite.local). Save the file.
  4. You can now access the site on those computers by going to http://mysite.local.

Important Considerations and Warnings

  • Static IP: For either solution to work long-term, your server computer should have a static IP address on your local network. Otherwise, if its IP address changes (which can happen with DHCP), the links will break again. You can usually set a static IP in your computer's network settings or your router's administration panel.
  • Security Warning: Exposing a local server to the internet is a significant security risk. The advice in this article is strictly for making a site accessible on a private internal network (intranet). The 'Localhost Installs' team and many community members strongly advise against port forwarding your home router to make a local WordPress site public, as it can expose your entire local network to threats.
  • Plugin Limitations: Some plugins, like Jetpack, are designed for public websites and will not work on a local or private IP address. You may see errors such as "Your site host is on a private network."

By following these steps, you should be able to share your local WordPress development site with other devices on your network for testing and collaboration.

Related Support Threads Support