WordPress / WordPress/wordpress-importer
Links and images in blocks aren't updated on import
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 89
- Forks
- 96
- Avg merge
- 1h 13m
- Merged PRs (30d)
- 2
Description
We have always been able to use the Theme Unit Test XML file that contains galleries with links, but now that there are gallery blocks with links, the results are different. The original galleries were shortcodes, so there is nothing to do. The block galleries contain the HTML for the links and the images, which remain as the old URL. Yet posts with images (not galleries) or image blocks are imported with changes to the image URLs.
Steps to Reproduce
Original Site:
- Using the block editor, create a post with two gallery blocks, one with linked images.
- Export the post.
- Note the gallery blocks show the original site URLs for links and images.
New Site:
- Import the post.
- View the imported post on the front end.
- View the page source and find the galleries.
Expected result: links and images use the new site URL
Actual result: links and images use the original site URL
This screenshot is from my localhost where I did the import. It contains the URL from the original sandbox site. (Tested with WP 5.3 on both sites.)

I have seen the same problem with
- Cover block video backgrounds
- Image block in a column block
- Media/Text block
- Audio block
- Video block
- File block
- Download block
- Button block
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no files or tests. Reproduce the import with linked gallery images, then compare the original and imported block HTML and trace the importer’s URL-replacement behavior across the listed gallery, media, and button blocks. Done means links and media URLs in those imported blocks use the new site URL.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- content
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100