Skip to content

REST API Media 404 while Searching for a Block in Editor #727

@SirLouen

Description

@SirLouen

Description

I reported this on Gutenberg WordPress/gutenberg#70852
According to [https://github.com/WordPress/gutenberg/issues/70852#issuecomment-3105777958 George] this seems to be a problem in the patterns directory

The error is coming from a pattern - https://wordpress.org/patterns/pattern/bold-sale-banner-with-geometric-background/.
It provides an id attribute for a Cover block. When the ID exists, the editor assumes the image is in the media library and tries to fetch related data, resulting in an error.
This isn't a block editor issue, nor can it be resolved on our end.

Here is the rest of the bug report:

A 404 for wp-json/wp/v2/media with ID 333 or 334 keeps popping in the console

It feels like there is some resource on the search API that had this ID or something.

I've also seen 334 and 61 ID in a clean WP Playground.

Step-by-step reproduction instructions

  1. Open the Browsers console
  2. Create a new post
  3. Start adding a new block straight inside the editor area (click the +)
  4. Add for example a b in the search bar
  5. 🐞 A 404 error appears in the console

It seems that i happens also in the left sidebar blocks search bar.

Screenshots, screen recording, code snippet

https://f003.backblazeb2.com/file/wordpress-videos/wp-videos/2025/07/708xx.mp4

Environment info

With WP Playground

  • WordPress: 6.8.2
  • PHP: 8.3.23-dev
  • Server: PHP.wasm
  • Database: WP_SQLite_Driver (Server: 5.5 / Client: 3.40.1)
  • Browser: Firefox 140.0
  • OS: Windows 10/11
  • Theme: Twenty Twenty-Five 1.3
  • MU Plugins: None activated
  • Plugins:
    • Gutenberg 21.2.0
    • Test Reports 1.2.0

With Firefox and Chrome
Also with wp-env

  • WordPress: 6.9-alpha-60093-src

  • PHP: 8.2.29

  • Server: Apache/2.4.62 (Debian)

  • Database: mysqli (Server: 11.8.2-MariaDB-ubu2404 / Client: mysqlnd 8.2.29)

  • Browser: Chrome 138.0.0.0

  • OS: Windows 10/11

  • Theme: Twenty Twenty-Five 1.3

  • MU Plugins: None activated

  • Plugins:

    • Gutenberg 21.2.0
    • Test Reports 1.2.0
  • 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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions