Skip to content

Viewing media fails with CORS error when media has remote URL #76588

@ianmjones

Description

@ianmjones

Description

Since at least Gutenberg 22.6.0 viewing media with remote URLs in the post editor and grid mode Media page now fails with a CORS error.

Images with remote URLs are still usable in the front end of a site, but image previews are failing in most places in the admin dashboard if the preview is (re)populated by what I assume is a JavaScript function.

Step-by-step reproduction instructions

  1. Enable and configure a plugin such as WP Offload Media that offloads Media Library items to cloud storage such as Amazon S3, with or without a CDN being configured.
  2. Add an image to the Media Library that gets offloaded.
  3. Verify that media is visible in Media Library using remote URL when using grid mode.
  4. Activate Gutenberg 22.6.0 or later.
  5. Refresh Media Library in grid mode.
  6. Observe that image is no longer viewable and devtools show a CORS error.

Screenshots, screen recording, code snippet

Here's a brief demo showing an image that is on a CDN being viewable before Gutenberg 22.7.0 is activated on WordPress 6.9.4, not viewable in admin area after Gutenberg is enabled, and then viewable again after deactivating Gutenberg.

CORS errors are visible in devtools.

Screen.Recording.2026-03-17.at.14.19.15.mov

Environment info

Gutenberg 22.6.0 & 22.7.0
WordPress 6.9.4 (and 7.0-beta5 without Gutenberg plugin)
Chrome 145
macOS 26.3.1

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Type] BugAn existing feature does not function as intended

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions