WP Manifestindependent plugin directory
manifest / developer / wordpress-plugin-cloudflare-tunnel-for-local-development

Cloudflare Tunnel for Local Development

A WordPress plugin that exposes your local development site via Cloudflare Tunnel, rewriting URLs on the fly only when requests arrive through the tunnel.

★ 0stars
3release downloads
v1.0.0latest · 6mo ago

Install

Download cloudflare-tunnel-for-local-development.zip From the v1.0.0 release on GitHub, Apr 10, 2026

Upload it under Plugins → Add New Plugin → Upload Plugin, then activate.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/alfiosalanitri/wordpress-plugin-cloudflare-tunnel-for-local-development/releases/download/v1.0.0/cloudflare-tunnel-for-local-development.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

A WordPress plugin that exposes your local development site via Cloudflare Tunnel, rewriting URLs on the fly only when requests arrive through the tunnel. Accessing localhost directly is never affected.


How it works

When a request arrives from the Cloudflare Tunnel host, the plugin:

  • Rewrites site_url, home_url, content_url, plugins_url, theme URIs and upload URLs to the tunnel URL
  • Sets $_SERVER['HTTPS'] = 'on' and SERVER_PORT = 443 — no need to touch wp-config.php
  • Runs an output buffer as a safety net, rewriting any hardcoded URLs left in the final HTML (including JSON-encoded URLs inside Gutenberg blocks)
  • Prevents redirect loops by removing redirect_canonical and intercepting wp_redirect

When a request arrives from localhost, nothing changes — WordPress behaves exactly as normal.


Requirements


Installation

  1. Download the latest cloudflare-tunnel-for-local-development.zip from the Releases page
  2. In WordPress go to Plugins → Add New → Upload Plugin
  3. Upload the zip and activate

Usage

1. Start the tunnel on your machine:

cloudflared tunnel --url http://localhost:8001

Cloudflare will output a URL like https://xxxx.trycloudflare.com.

2. Configure the plugin:

Go to Settings → CF Tunnel / Local Dev and:

  • Paste the tunnel URL (must start with https://)
  • Check "Attiva la riscrittura degli URL per le richieste dal tunnel"
  • Save

3. Share the tunnel URL — visitors hitting https://xxxx.trycloudflare.com will see your local site with all assets loading correctly.

You can leave the plugin enabled permanently. From localhost everything works as before; the rewriting only activates for tunnel requests.


Uninstall

Deactivating or uninstalling the plugin removes all stored options (cflt_tunnel_url, cflt_tunnel_enabled) from the database automatically.


License

GPL-2.0-or-later — see LICENSE

Releases

1 release. Each count is every asset in that release; expand a row for the breakdown.

Tag
Published
Assets
Downloads
v1.0.0 latest
Apr 10, 2026 6mo ago
cloudflare-tunnel-for-local-development.zip
3