Bulk change text format

At some point, you may want to bulk update a text format. Maybe you're doing some site cleanup, or just completed a migration. However, this is not so simple!

In the database, every full text field stores both the source text and format used to edit and render it. Revisions store a copy of this as well. If you want to completely replace a text format, you have to remove it from all fields it's used in.

You can create a view that shows the text format used for various fields. Add your formatted text fields to a content view, and rewrite them as {{ body__format }}.

You can write a script to load your content, set the text format on relevant fields, and save each one. You have to get all fields on all entities, and all revisions to get this right.

In conclusion, it is much easier to update your existing text format than to try and replace it. If there is another way to do it, please let me know!