Skip to content

How to ignore broken image links #5466

@t-hamano

Description

@t-hamano

Description

When I retrieved the images via the REST API, I noticed that some of them were inaccessible due to a 410 error. WordPress block editor gets the image list to be inserted into the content via the endpoint, but some images aren't inserted due to the HTTP error above.

Reproduction

  • Access https://playground.wordpress.net/ to start the WordPress instant environment
  • Go to the Dashboard > Create a new post > Open the main inserter > Click the Media tab > Click the Openverse menu
  • Search images by "mountain"
  • You should see that some images have no preview.
  • Click them. Browser console outputs the 410 (Gone) error and the image isn't inserted.

Request example:

https://api.openverse.org/v1/images/?page_size=20&q=mountain&mature=false&excluded_source=flickr%2Cinaturalist%2Cwikimedia&license=pdm%2Ccc0

Screenshots

Image

Additional context

We may be able to filter out the broken images on the client side, but I'd appreciate it if I could know why the broken images are included in the first place and if there is an option to filter them out.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    🏗 In Progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions