# Share a local WordPress site with a client without deploying it

> Show a client your local WordPress site through a single-use qURL link, and stop WordPress sending them to localhost with WP_HOME and WP_SITEURL.

Source: https://layerv.ai/guides/share-a-local-wordpress-site/

---

[← All guides](https://layerv.ai/guides/) 

# Share a local WordPress site with a client without deploying it

## Why qURL here

Your WordPress site stays on your machine, with no copy to host and nothing for the client to install: they open one link, once, in their browser, and your WordPress login still applies. Two defines in wp-config.php keep WordPress-generated URLs on their address, and removing them puts the site back the way it was.

[See how qURL compares to ngrok →](https://layerv.ai/compare/qurl-vs-ngrok/)

Copies a prompt for any agent that runs commands. 

## What you need

- A WordPress site running on this machine and answering on a localhost port (MAMP, Docker, wp server, or Local in its localhost Router Mode); the example uses 8888
- Write access to that site’s wp-config.php and a web server bound to loopback. For Docker, bind the published port to 127.0.0.1 so LAN clients cannot reach the preview directly
- The qURL CLI 4.0.0 or later

Content updated November 23, 2026.

## The WordPress settings this guide touches

__The WordPress settings this guide touches__
| Setting              | What it does                                                                                                                                                                          | What to set for a qURL review                                                                                                                |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| WP\_HOME             | Overrides the home option, the address WordPress builds its links from, without changing the database. WordPress says the URL reverts to the database value if the line is removed.   | The HTTPS origin from the client’s address bar, only for requests through qURL                                                               |
| WP\_SITEURL          | Overrides the siteurl option, where WordPress’s own files are: wp-admin, wp-login.php, scripts and styles. Also an override that leaves the database alone.                           | The same origin, plus the subdirectory if WordPress is not at the root of the port                                                           |
| $\_SERVER\['HTTPS'\] | What is\_ssl() reads. WordPress’s HTTPS documentation says a site behind a reverse proxy that provides SSL, hosted itself without SSL, otherwise goes into an infinite redirect loop. | 'on' inside the same block: the client’s browser is on https, while the request reaches WordPress over http                                  |
| COOKIE\_DOMAIN       | The domain set on WordPress cookies, which WordPress offers for unusual domain setups.                                                                                                | Leave it unset. Cookies are then host-only for the hostname in the client’s address bar, so the login cookie stays on their preview address. |

## Steps

WordPress builds links and canonical redirects from its home and siteurl options, so a local site opened through a tunnel can send the browser back to localhost. InstaWP avoids this by hosting a copy; ngrok rewrites the Host header to localhost; Local Live Links need a Local account. With qURL™ by LayerV, publish the site, send the client one single-use link, and set WP\_HOME and WP\_SITEURL in wp-config.php to their exact browser origin.

1. ### Find the port your local WordPress answers on  
`qurl publish` accepts only a loopback address: http://127.0.0.1:PORT, http://localhost:PORT or \[::1\]. MAMP, Docker and wp server each pick their own port; the example uses 8888\. Local’s default Router Mode answers on a .local domain through a router on port 80 that picks the site by hostname, which a qURL request does not carry. Its help page describes a second mode under Preferences > Advanced > Router Mode, localhost, in which each site is reached directly at localhost on a dedicated port such as 10005; Local notes that sites in that mode can’t use HTTPS or Live Links. Use that mode and port for Local. Replace 8888 below with yours.  
```  
curl -sS -o /dev/null -w "%{http_code}\n" http://127.0.0.1:8888/
```

**Check:** The command prints 200, or 301 or 302 if the front page redirects. “Connection refused” means nothing listens on that port: check the port in your local WordPress tool.
2. ### Install the qURL CLI  
On macOS, install it with Homebrew. On Linux and Windows, download the package for your platform from the latest release; the CLI page lists each one. Nothing asks you to sign up.  
```  
brew install layervai/tap/qurl
brew upgrade qurl
qurl --version
```
3. ### Publish the site  
The first `qurl publish` creates this device’s identity, starts a background service that keeps serving after you close the terminal, and prints the site’s CRID. The name is the public text the client sees on the opener page before the site loads, so name the project, not the client. The resource is private: nobody can open it until you share a link. Publishing the same address again reuses the resource and its CRID.  
```  
qurl publish http://127.0.0.1:8888 --name "Spring site" -o json
```

**Check:** The reply shows private: true and the resource’s CRID.
4. ### Prepare WordPress to show the client their preview hostname  
Bind the web server to loopback for MAMP, wp server and Docker alike; the Host check is not access control. On your local development site, put this block before wp-settings.php and before any existing WP\_HOME or WP\_SITEURL definitions. Move those existing local definitions after this block and guard each one, for example defined("WP\_HOME") || define("WP\_HOME", "http://localhost:8888"); do the same for WP\_SITEURL with its existing value. PHP constants can be defined only once per request. Leave the preview origin empty for the first visit. Requests through qURL will show a short message before WordPress or its plugins can redirect the browser to localhost. Local visits still use your existing settings.  
```  
// wp-config.php, before existing URL definitions and wp-settings.php (development only)
$preview_origin = '';
$request_host = parse_url( 'http://' . ( $_SERVER['HTTP_HOST'] ?? '' ), PHP_URL_HOST );
if ( is_string( $request_host ) && substr( strtolower( $request_host ), -10 ) === '.qurl.site' ) {
    if ( $preview_origin === '' ) {
        header( 'Cache-Control: no-store' );
        header( 'Content-Type: text/plain; charset=utf-8' );
        exit( 'Send the site owner the hostname in your address bar and keep this tab open.' );
    }
    define( 'WP_HOME', $preview_origin );
    define( 'WP_SITEURL', $preview_origin );
    $_SERVER['HTTPS'] = 'on';
}
```

**Check:** Open the site locally. The homepage still loads with its original address.
5. ### Send the client one link and ask for the hostname in their address bar  
\--ttl is how long the link waits to be opened; --session-duration is how long the visit lasts. Send it in a direct message, not a public channel: whoever opens it first uses it. Avoid email and apps that preview links, because a scanner that runs the page could use its one opening. Don’t open it yourself to check it, for the same reason. Ask the client to open the link in their browser, copy just the hostname from the preview message tab, and keep the tab open.  
```  
qurl share <CRID> --ttl 4h --session-duration 2h
```

**Check:** The client sees the message from wp-config.php on an HTTPS qurl.site subdomain.
6. ### Set the preview origin for this client  
Set $preview\_origin in the block to https:// followed by the exact hostname the client saw. Use an HTTPS origin with no trailing slash or path, and verify that its hostname ends in .qurl.site; the Host PHP receives identifies the connector and differs from the client’s browser hostname. WordPress now uses WP\_HOME for site links and WP\_SITEURL for core files. If the core files are installed in a subdirectory, append that path to WP\_SITEURL. The HTTPS flag tells WordPress that the browser used HTTPS even though its local connection uses HTTP. The database keeps its original settings. This block supports one preview origin at a time.

**Check:** Use the actual origin from this visit. A new share link can have a different origin.
7. ### Ask the client to reload the same tab  
If the preview message persists immediately after the edit, allow PHP’s opcode cache to revalidate and reload the same tab. The styles arrive, WordPress-generated site links use their preview address, and wp-admin asks for the WordPress login as it does for you. Give them a WordPress account with only the role the review needs; qURL decides who reaches the site, and your login decides what they can do in it.

**Check:** On the client’s side: pages, their links and the wp-admin login all stay on the recipient’s HTTPS origin, with no mixed-content warning and no jump to localhost.
8. ### Remove the block when the review ends  
Remove the block when finished. For another review, clear $preview\_origin first. WordPress says the URL reverts to the database value as soon as the line is gone, so nothing needs undoing in the database. An unopened link ends at its --ttl and the client’s session at its --session-duration. `qurl stop` stops serving the site until `qurl start`; `qurl delete` retires the resource for good after asking you to confirm.  
```  
qurl stop <CRID>     # pause; qurl start <CRID> resumes
qurl delete <CRID>   # permanent; asks you to confirm
```

## What the recipient sees

The client opens the link in a browser, sees the resource’s name and your publisher name on the opener page, and sees a message asking for the preview hostname.

After you set the origin in wp-config.php, the client reloads the same tab to see the site. WordPress page links, stylesheets and the wp-admin login use the preview origin. Opening the same link again shows “Access link invalid”.

## Ways to show a client a local WordPress site

Each row follows the vendor’s own pages in the sources below, checked on 2026-11-19.

__Ways to show a client a local WordPress site__
| Option           | Where the site runs                                           | What the client needs                                | Notes from the vendor’s docs                                                                                                                                                                                                                                                                                             |
| ---------------- | ------------------------------------------------------------- | ---------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Local Live Links | On your machine, while the site and the Local app are running | A browser and the Privacy Mode username and password | Needs a Local account. Each link is HTTPS with Privacy Mode enabled, and the URL stays the same across sessions. Local staff on the community forum say the link stays up only while the site and Local app run and the machine is online, and that Live Links are not meant as a long-term, permanent view of the site. |
| InstaWP          | A copy of the site in InstaWP’s cloud                         | A browser; InstaWP says no login and no setup        | Temporary sites expire after 2 days by default; a permanent site stays until you delete it. Starts at a $2 sandbox; an InstaWP blog post says it no longer offers a free plan for new sites.                                                                                                                             |
| ngrok            | On your machine, through an ngrok endpoint URL                | A browser                                            | ngrok’s WordPress example uses a Traffic Policy that rewrites the Host header of every request to localhost so WordPress accepts them, and ngrok then rewrites the Location header of responses to match the endpoint URL. The --host-header flag is marked deprecated in favour of traffic policy.                      |
| qURL             | On your machine                                               | A browser; the link opens once                       | No account for you or the client. WP\_HOME and WP\_SITEURL are set to the client’s browser origin in wp-config.php, and the site’s own WordPress login still applies.                                                                                                                                                    |

Sources: [Local: Live Links](https://localwp.com/help-docs/local-features/live-links/) , [Local: Live Links overview](https://localwp.com/live-links/) , [Local community forum: Live Link troubleshooting (staff reply)](https://community.localwp.com/t/live-link-troubleshooting/43182) , [InstaWP](https://instawp.com/) , [InstaWP docs: permanent site](https://docs.instawp.com/sites/permanent-site) , [InstaWP blog: choosing a site plan](https://instawp.com/choosing-right-instawp-site-plans/) , [ngrok docs: WordPress example](https://ngrok.com/docs/universal-gateway/examples/wordpress) , [ngrok docs: HTTP endpoints](https://ngrok.com/docs/gateway/endpoints/http) , [ngrok docs: agent CLI](https://ngrok.com/docs/agent/cli/) , [qURL access behaviour](https://layerv.ai/guides/share-localhost-with-temporary-access-link/#access-behaviour) , [CLI README](https://github.com/layervai/qurl-integrations/blob/main/apps/cli/README.md).

## Troubleshooting

__Troubleshooting__
| If you see                                                        | Do this                                                                                                                                                                                                                                                                                                                                                                                                          |
| ----------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| The client clicks a link or opens wp-admin and lands on localhost | WP\_HOME and WP\_SITEURL are not in effect for this host. Check that the block sits above the require\_once of wp-settings.php, that the configured origin matches the one the client sent, and that the hostname your server passes to PHP ends in .qurl.site. WordPress builds links from the home option and the canonical redirect from the site URL, so until the override applies they point at localhost. |
| The client’s browser reports too many redirects                   | is\_ssl() is false: WP\_HOME says https while WordPress believes the request is http, so it redirects between the two. Keep $\_SERVER\['HTTPS'\] = 'on' in the block. The X-Forwarded-Proto check from WordPress’s HTTPS documentation does not help here, because qURL forwards http.                                                                                                                           |

__More troubleshooting__
| If you see                                                                                                             | Do this                                                                                                                                                                                                                                                                                                                                                                                                                               |
| ---------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| The page loads but styles are missing, or the browser warns about mixed content                                        | Asset URLs are being built with http. Check that both defines start with https:// and that $\_SERVER\['HTTPS'\] = 'on' is in the block. If a page cache serves HTML built before the change, clear it or disable it for the review.                                                                                                                                                                                                   |
| wp-admin login loops back to the login page, or says cookies are blocked                                               | A cookie set for another host is not sent back. Remove any COOKIE\_DOMAIN define that names localhost or your .local domain so cookies stay host-only for the client’s hostname, then ask them to clear cookies for the preview address and sign in again.                                                                                                                                                                            |
| The client’s browser went to localhost before they could copy the address                                              | A redirect fired on the first request: a redirect, maintenance or coming-soon plugin, or a site that requires login on every page. Leave $preview\_origin empty and place the block before wp-settings.php loads. Check the web server for redirects that run before PHP. Leave the site’s access controls enabled.                                                                                                                   |
| The web server or a security plugin answers with a host error or 400                                                   | Something checks the Host header before WordPress does. The request reaches your machine with Host c-….qurl.site, so allow that host, or the .qurl.site suffix, in the server block or plugin setting that rejects it. Local’s router picks sites by hostname: use its localhost Router Mode and port instead. [Allow a tunnel’s hostname in your dev server →](https://layerv.ai/guides/allow-tunnel-hostname-in-dev-server/)        |
| qurl publish says the local app is not accepting TCP connections                                                       | Start the app first and check that curl works on the same address. qurl publish connects to localhost as 127.0.0.1, so if your app listens only on IPv6 (on macOS or Linux, lsof -iTCP -sTCP:LISTEN -nP shows \[::1\]), publish 'http://\[::1\]:PORT' instead, or start the dev server with --host 127.0.0.1 and publish that address. Neither requires listening on your LAN. Keep the quotes: zsh treats the brackets as a pattern. |
| The recipient sees “Access link invalid”                                                                               | The link was already used or has expired. Run qurl share again and send the new link.                                                                                                                                                                                                                                                                                                                                                 |
| The recipient sees “Resource not found”                                                                                | The resource was deleted after the link was made. Publish the app again, then run qurl share and send the new link.                                                                                                                                                                                                                                                                                                                   |
| publish rejects http://127.0.0.1 with “only HTTPS URLs are allowed”, asks you to log in, or prints no Access: line     | Your qURL CLI is out of date. On macOS run brew update, then brew upgrade qurl; elsewhere install the latest release. After updating, qurl --version prints 3.4.1 or later, and every publish is private by default.                                                                                                                                                                                                                  |
| publish says this Linux session “can’t reach a systemd user manager”                                                   | You are in a container or sandbox without a user service manager. Run qurl publish with --foreground; sharing lasts as long as that process runs. [Container and CI setup →](https://layerv.ai/guides/share-from-a-container-or-ci/)                                                                                                                                                                                                  |
| publish says “Quota Exceeded” with “protected resource limit reached”, or “Your qURL account has reached a plan limit” | You can see this without an account: a device with no account can keep up to 3 active resources, with links that last up to 24 hours. Run qurl list --status active, then qurl delete <CRID> for any you no longer need (it asks you to confirm; --yes skips that). qurl stop keeps the resource, so it does not free a slot.                                                                                                         |

## Frequently Asked Questions

Why does WordPress redirect my client to localhost? 

WordPress stores its address in the home and siteurl options and builds absolute URLs from them: the links on every page, the stylesheet and script URLs, the login redirect, and the canonical redirect, which WordPress describes as redirecting incoming links to the proper URL based on the site url. On your machine those options say localhost, so a page opened on any other hostname sends the browser there. WP\_HOME and WP\_SITEURL in wp-config.php override them for the review without changing the database.

Can I build WP\_HOME from $\_SERVER\['HTTP\_HOST'\] instead of a fixed value? 

Not through qURL. The client’s browser uses its own preview hostname, but the request reaches WordPress with Host c-….qurl.site, so a WP\_HOME built from HTTP\_HOST produces c-… links the browser cannot use. WordPress also warns that HTTP\_HOST is created dynamically by PHP from the request’s Host header and can allow file inclusion vulnerabilities. Match a fixed suffix and set a fixed value, as the block in this guide does.

Does the client need an account or an install? 

No. A qURL link from qurl share opens in a browser with no account and nothing to install, and the first qurl publish creates your device identity without an account either. The client signs in to WordPress only if they open wp-admin, with the WordPress account you give them.

Can the client look without any wp-config change? 

Only partly. The front page comes through the qURL link, but its stylesheet and script URLs point at localhost, so it arrives without styles, and any absolute link, the login, or a canonical redirect sends them to localhost. The two defines take a minute and come out again when the review ends, so make the change.

Who else can reach my app while the link is open? 

Opening the link starts a session for that browser, which lasts 1 hour by default. After a browser opens it, another browser on the same public IP cannot use its access. A script or agent that opens the link without a browser is admitted by its network address instead, which other devices on that public IP share until the session ends. A link admits whoever opens it: the API’s IP and country rules do not apply to the signed links qurl share issues. Keep your app’s own sign-in for anything sensitive.

How do Local Live Links work? 

Local describes Live Links as a way to share the progress of a Local site with a client or teammate without moving it to a remote server. You need a Local account and to log in from the Local app; each link is HTTPS with Privacy Mode enabled, so the client enters a username and password; and each site gets a continuous, unique link that stays the same across sessions. A Local staff reply on the community forum says the link stays up only while the site and the Local app are running and the machine is online, and that Live Links are not meant as a long-term, permanent view of the site. Local’s documentation does not say which plan tiers or limits apply. In Local’s localhost Router Mode, which this guide uses, Local notes that sites can’t use Live Links.

Does my computer have to stay on? 

Yes. The app is served from your machine, so the machine and the app must be running and connected. The background service reconnects after sleep, but the app is unavailable while the machine is asleep.

## Related Resources

[Guide: Share a dev server with a client →](https://layerv.ai/guides/share-dev-server-with-client/) [Guide: Share a local app with nested routes, redirects and sign-in →](https://layerv.ai/guides/share-local-app-nested-routes/) [Guide: Make a one-time link for a demo →](https://layerv.ai/guides/one-time-link-for-a-demo/) [qURL vs ngrok →](https://layerv.ai/compare/qurl-vs-ngrok/) [Vendor: WordPress, Editing wp-config.php ↗](https://developer.wordpress.org/advanced-administration/wordpress/wp-config/) [Vendor: WordPress, HTTPS ↗](https://developer.wordpress.org/advanced-administration/security/https/) [Vendor: Local, Live Links ↗](https://localwp.com/help-docs/local-features/live-links/) [Vendor: Local, Router Mode ↗](https://localwp.com/help-docs/advanced/router-mode/) [Vendor: InstaWP, permanent site ↗](https://docs.instawp.com/sites/permanent-site) [Vendor: ngrok, WordPress example ↗](https://ngrok.com/docs/universal-gateway/examples/wordpress)

## Show the client now

Publish the port your WordPress answers on and send one person a link that opens once. Then set WP\_HOME and WP\_SITEURL to the hostname they land on.

[Or use the CLI →](https://layerv.ai/cli/)



---

*This markdown version is auto-generated from [https://layerv.ai/guides/share-a-local-wordpress-site/](https://layerv.ai/guides/share-a-local-wordpress-site/) for AI agents. Curated agent resources: [llms.txt](https://layerv.ai/llms.txt). For the full interactive experience, visit the HTML version.*

