Images not loading after migration
If images are not loading after migrating your media library to cloud storage, there are several possible causes. Work through the checks below in order — the most common causes are at the top.
Check 1: Did the bulk migration complete?#
Go to Media Cloud > Dashboard. Compare the offloaded file count with the total media library count. If the numbers do not match, the bulk migration did not finish. Files that were not offloaded will still be served from your server via local URLs, which will return 404 errors if local file removal was enabled.
Click Start Migration on the Dashboard to resume the migration. Once it completes, check whether the images that were not loading now resolve correctly.
Check 2: Is the storage connection working?#
Go to WP Media Cloud > Health and run the health check. Look at the storage credentials check and the upload test result. If either fails, the connection to your storage provider is broken and WP Media Cloud cannot serve files from the bucket.
Common causes of a failed connection after migration:
- Credentials changed or rotated since the migration ran
- Bucket was renamed or deleted
- IAM policy or API key permissions were modified
- Provider endpoint or region was entered incorrectly
Fix the connection issue, re-run the health check, and then reload the pages where images were not loading.
Check 3: Is URL rewriting enabled?#
Go to WP Media Cloud > Settings and confirm Rewrite URLs is enabled. If URL rewriting is disabled, WordPress generates local URLs for all attachments regardless of whether the files have been offloaded. Enabling it and saving will immediately cause all attachment URL functions to return cloud storage URLs.
Check 4: Is the bucket publicly accessible?#
Open the URL of one of the images that is not loading directly in a browser. If the browser returns an Access Denied or 403 error from the storage provider, the bucket is not publicly accessible. Files are in the bucket but cannot be served to visitors.
Public access configuration varies by provider. Check the relevant storage provider documentation for your setup:
- Amazon S3 — Block Public Access must be disabled and a bucket policy granting public reads must be applied
- Cloudflare R2 — a custom domain or R2.dev subdomain must be connected and public access enabled
- Wasabi — a bucket policy granting public reads must be applied
- Backblaze B2 — the bucket must be set to Public
Check 5: Is the CDN URL configured correctly?#
If you have a CDN configured in WP Media Cloud > Settings > CDN, the CDN hostname is used in all generated URLs. If the CDN hostname is wrong, files at the correct bucket URL will not be found via the CDN URL that WP Media Cloud generates.
In your browser’s developer tools, open the Network tab and look at the URL of an image that is not loading. Confirm that:
- The hostname in the URL matches your CDN hostname or bucket public URL
- The file path after the hostname matches where the file actually sits in the bucket
If the CDN URL is correct but the file is still not loading, the CDN may not be correctly configured to pull from your bucket origin. Check your CDN pull zone configuration and confirm the origin URL points to your bucket.
Check 6: Is a page cache serving stale HTML?#
Page caching plugins store the rendered HTML of a page. If a page was cached before WP Media Cloud was configured or before the migration ran, the cached HTML contains the old local image URLs. Even though WP Media Cloud is now rewriting URLs correctly, the cached page serves the old URLs to visitors.
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 cache at the CDN level as well.
Check 7: Are image URLs hardcoded in post content or page builder data?#
Some page builders save the full image URL as a string in postmeta when an image is inserted, rather than storing the attachment ID. If these URLs were saved before WP Media Cloud was configured, they contain the local URL and are not rewritten dynamically.
Use the URL Replace tool to scan and update stored URLs in post content and postmeta. Run it on a staging site first and take a database backup before running on production.
Check 8: Was local file removal enabled before migration completed?#
If local file removal was enabled before the bulk migration finished, files that were not yet offloaded may have been deleted from the server. WP Media Cloud only removes local files after confirming a successful cloud upload, but if automatic offloading failed silently for some files those files may now be missing both locally and in the bucket.
Check the Dashboard offloaded count against the total media count. For any files that are missing from the bucket, you will need to restore them from a backup and re-run the offload.