Problem/Motivation
For some reason, after migrating content into Drupal, HTML in the Body field is shown until the node is saved. Only then are the HTML tags used.
Steps to reproduce
Do a migration, and see that HTML tags in the Body field are not rendered, but escaped and output, until the node is saved, like this (i.e. the title and author field are formatted):
Facere quis amet temporibus aut molestias Add to Default shortcuts
By samantha.marvin , 14 March 2026
<p>Esse error voluptas. Voluptatem laborum illum reprehenderit. Eum laudantium cupiditate fugiat consequuntur. <a title="Alias in." href="http://www.example.com/autem-ut-quisquam-velit-qui">quis</a> accusamus sed praesentium saepe Quia possimus laudantium sequi et nobis Blanditiis ducimus deleniti dolore commodi ratione. Rerum sint impedit facere omnis est At totam quam doloremque voluptatum recusandae Dolor sunt tenetur quia Voluptatem accusantium qui dignissimos veritatis. Repellat tempora impedit et. Impedit fuga et. sed qui vitae Soluta suscipit amet minus aut. Voluptatem minima et ad et. Eum cum et aut eligendi. Est quis dolorem nam incidunt. Molestias saepe placeat ad. Soluta hic consequatur labore dolore eum ipsa Qui rerum <a title="Neque error quia recusandae voluptatum." href="http://example.org/rerum-tenetur-ullam-eum-ea-voluptate-in">earum aut adipisci</a> A nostrum animi sapiente quam omnis.</p>
<ul><li>Rerum aut voluptas dolore officiis id et molestiae</li><li>Sint ut quisquam facilis quas</li></ul>
Proposed resolution
Have the HTML take effect immediately after a migration, and not require to save the node first.
There could be another issue for this, I just could not find it ... :)
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
Comments
Comment #2
ressaComment #3
longwaveCan you provide some sample migration YAML that triggers this bug? I've done a number of node body migrations and never seen it.
Comment #4
longwaveComment #5
ressaThanks for a fast reply. Below is an example. It is created by the WordPress Migrate module, and the same thing happens in #3535554: HTML tags in body text is shown as plain text:
Comment #6
hongpong commentedThis may have been an issue in wordpress_migrate where our text formats are not correctly assigned to certain field structures. #3516531: Add body field picker w default to wizard & processing and #3516531: Add body field picker w default to wizard & processing. With Drupal 11 the field structure changed and we think there are some bugs in this area. ( I just put in a logger that should at least enforce the correct fields are only selected with current import config implementation). Any diagnostic help w finding that kind of problem will probably help us, watchdog logging if it changes etc.
Comment #7
ressaYour assumptions were correct @hongpong, and thanks for fixing this in the related WordPress Migrate module issue. Closing this issue, since the Drupal core Migrate module works well.