WordPress plugin
Integrate CDN.gd with WordPress by rewriting asset URLs (JS, CSS, media) to your Pull Zone hostname and purging cache directly from the dashboard.
Requirements
- WordPress 5.0+ (tested up to 6.8.3).
- A configured Pull Zone hostname (for example
media.cdn.gdor a custom CNAME). - Administrator access to install plugins and view Settings → CDN.
Install
- Download the latest ZIP from the CDN.gd dashboard (WordPress Plugin page) or directly from GitHub releases: cdn-gd.zip.
- In WordPress, go to Plugins → Add New → Upload Plugin, select the ZIP, and install.
- Activate the plugin. A “CDN” settings page appears under Settings.
Configure
Open Settings → CDN and set:
- CDN Domain Name: The full hostname that should serve assets (e.g.
media.example.comor<zone>.cdn.gd). Leave blank to disable rewriting. - Site URL: Auto-filled; keep the public base URL of your site.
- Excluded: Comma-separated fragments to skip (default
.php). - Included Directories: Only these paths are rewritten (default
wp-content,wp-includes). - API Key (optional) and Zone ID: Provide both to enable cache purge from WordPress.
- Disable CDN for admin user: Skip rewrites for logged-in admins while testing.
How rewriting works
- Only URLs on the same host as Site URL are rewritten.
- Paths must live under Included Directories and must not match Excluded fragments.
- Rewrites apply to script/style URLs, attachment URLs,
srcset, and buffered HTML output so most theme and plugin assets are covered.
Purge CDN cache
- Configure API Key and Zone ID, then click “Purge CDN Cache Now” in Settings → CDN.
- The plugin discovers the purge endpoint from
https://cdn.gd/.well-known/gd.cdn.api.jsonand triggers a full-zone purge.
Updating
- The plugin checks GitHub releases for updates automatically. You can also reinstall from the dashboard download link to upgrade.
Best practices
- Use a dedicated Pull Zone for your WordPress media domain; add the hostname in the Pull Zone hostnames list with SSL enabled.
- Keep Excluded minimal to avoid missing assets. If dynamic endpoints break, add a short fragment (e.g.
/api/). - Test with “Disable CDN for admin user” enabled during rollout, then re-enable once verified.