Gutenberg: src and srcset urls in image block are absolute paths instead of relative

Created on 4 Dec 2018  路  2Comments  路  Source: WordPress/gutenberg

Describe the bug
When deploying a site to a different domain, images added in 'image' and 'media & text' blocks (but not gallery block!) disappear, because the src contain the old domain in the path. Src and srcset paths are not relative.

To Reproduce
Steps to reproduce the behavior:

  1. Add blocks like 'image', 'media & text' in a page
  2. Deploy website to a different domain, like from example.dev to staging.example.com
  3. Check missing images and inspect the markup
  4. Check for src and srcset containing the old domain (example.dev)

Expected behavior
Src and srcset urls for images added through gutenberg should have relative paths

Additional context

  • Gutenberg version 4.5.1
[Status] Not Implemented

All 2 comments

That's a design decision of WordPress core, see https://make.wordpress.org/core/handbook/contribute/design-decisions/#why-relative-urls-are-not-good.

If you migrate sites you need to search-replace URLs.

Suggesting wontfix.

I am closing this issue, because Gutenberg is following the WP design decision.

Was this page helpful?
0 / 5 - 0 ratings