Docs

URL rewriting not working

4 min readUpdated June 28, 2026

If media URLs on your site are still showing local server URLs instead of cloud storage or CDN URLs, work through the checks below. URL rewriting issues are almost always one of three things: the rewriting setting is off, the file is not tracked as offloaded, or a page cache is serving stale HTML.

Check 1: Is URL rewriting enabled?#

Go to WP Media Cloud > Settings and confirm Rewrite URLs is enabled. This is the primary toggle for all URL rewriting. If it is off, no attachment URLs are rewritten regardless of whether files have been offloaded.

Check 2: Has the file been offloaded?#

WP Media Cloud only rewrites URLs for files it has a tracking record for. If a file was not offloaded — either because it was uploaded before WP Media Cloud was installed, or because an offload failed silently — its URL will not be rewritten.

Go to Media > Library, click on the image that is not loading from cloud storage, and check the URL in the attachment details panel. If it shows your site URL the file has not been offloaded. Run the bulk migration tool to offload existing media. After the migration, reload the page and the URL will be rewritten.

Check 3: Is a page cache serving stale HTML?#

Page caching plugins store the rendered HTML of pages. If a page was cached before WP Media Cloud was configured or before a bulk migration completed, the cached HTML contains local image URLs. Even though WP Media Cloud is now rewriting URLs correctly for new requests, visitors who receive cached pages see the old local URLs.

Clear your page cache after configuring WP Media Cloud and after completing a bulk migration. If you use a CDN with full-page caching, purge the CDN cache as well. URL rewriting in WP Media Cloud happens at PHP render time — cached pages bypass this entirely.

Check 4: Are the URLs hardcoded in post content or page builder data?#

WP Media Cloud rewrites URLs at the point of output via WordPress attachment functions and a content filter on the_content. The content filter replaces local upload URLs with CDN URLs in the final rendered HTML for post content and page builder output that goes through the_content.

Some scenarios where URLs are not rewritten:

  • Page builder data saved outside the_content — some page builders or custom field plugins store structured data (JSON, shortcodes, or serialised arrays) in postmeta that does not pass through the_content. URLs saved inside that data as plain strings are not rewritten. Use the URL Replace tool to update those stored URLs.
  • Theme template files with hardcoded URLs — if your theme outputs an image URL as a plain string rather than using wp_get_attachment_url() or get_the_post_thumbnail_url(), WP Media Cloud cannot intercept it. Update the template to use WordPress attachment functions.
  • URLs typed or pasted directly into post content — if an image URL was inserted as a raw HTML string rather than through the WordPress media library, it is not a tracked attachment and is not rewritten. Replace the URL manually or re-insert the image through the media library.

Check 5: Is EWWW Easy IO active?#

When EWWW Easy IO is configured as your CDN in WP Media Cloud, it takes over URL rewriting entirely. WP Media Cloud disables its own rewriting hooks and EWWW’s ExactDN intercepts URLs from the bucket onwards. If EWWW Easy IO is active but not working correctly, URLs will appear to not be rewritten by WP Media Cloud because WP Media Cloud has deliberately yielded control.

Check the EWWW Image Optimizer settings to confirm Easy IO is enabled and an ExactDN domain is assigned. If you want WP Media Cloud to handle URL rewriting directly, switch the CDN setting from EWWW Easy IO to your CDN hostname and save settings.

Check 6: Is the CDN base URL configured correctly?#

If URL rewriting is enabled and files are offloaded but URLs in the page are pointing to the bucket endpoint rather than a CDN hostname, the CDN has not been configured in WP Media Cloud > Settings > CDN. Go to the CDN settings for your provider and enter your CDN hostname. Save settings. All new URL output will use the CDN hostname.

If the CDN hostname is configured but URLs are still showing the bucket URL, confirm the CDN type is not set to None — selecting None disables CDN rewriting even if a URL is entered in the field.

This website uses cookies to enhance your browsing experience and ensure the site functions properly. By continuing to use this site, you acknowledge and accept our use of cookies.

Accept All Accept Required Only