If you find this add-on useful, please star it on GitHub — stars show appreciation and help maintainers know their work matters.
A DDEV add-on for WordPress that makes ddev share (cloudflared/ngrok tunnels) work out of the box.
Normally, sharing a local WordPress DDEV site over a tunnel breaks: WordPress generates every URL (assets, links, redirects, REST endpoints) using its configured local site URL, so visitors hitting the tunnel hostname get mixed-content errors, broken links, and redirect loops back to the unreachable local URL.
This add-on installs a single
must-use plugin,
ddev-share-helper-for-wp.php, that rewrites URLs on the fly for tunneled
requests only:
Host = your *.ddev.site URL) are completely unaffected.Host = the tunnel hostname) get every generated URL,
and the final HTML/JSON output, rewritten to the tunnel host — with no
changes to the database.A must-use plugin (or “mu-plugin”) is a plain PHP file placed in
wp-content/mu-plugins/. WordPress loads every file in that directory
automatically, before normal plugins — there is nothing to activate, and it
never shows up as deactivatable in the admin plugin list. That makes it a
good fit here: install the add-on and sharing just works. Removing the
add-on deletes the file, which fully removes the plugin.
wordpress with a standard WordPress installation —
one where the wp-content/ directory sits alongside wp-admin/ and
wp-includes/, as in a default install. Composer-based setups that move
wp-content somewhere else (such as Bedrock, which uses web/app/) are
not currently supported.ddev share uses ngrok by default, which requires a
free ngrok account and authtoken — see the
DDEV sharing docs
for setup and for alternatives like cloudflared.ddev add-on get dustinatx/ddev-share-helper-for-wp
ddev restart
Then share your site as usual:
ddev share
ddev add-on remove share-helper-for-wp
If you run into problems, please file an issue.
@dustinatx
If you find this add-on useful, please star it on GitHub — stars show appreciation and help maintainers know their work matters.