WordPress / WordPress/pattern-directory

REST API Media 404 while Searching for a Block in Editor

Open
#727 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
134
Forks
46
Avg merge
9h 4m
Merged PRs (30d)
19

Description

Description

I reported this on Gutenberg https://github.com/WordPress/gutenberg/issues/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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Inspect the linked Bold Sale Banner pattern and its Cover block, then reproduce the editor search steps while watching the browser console for the media 404. Determine which pattern data supplies the media ID and correct that content; done means searching for blocks no longer requests missing media and the pattern still renders correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, wordpress
Domain
api, content
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.