Site icon Hip-Hop Website Design and Development

Bulk changing shortcodes to blocks with embeds

Is there a technique to do a mass conversion of shortcode embeds to Gutenberg block-style embeds, together with changing a basic block to a Gutenberg block?

I am within the means of transferring a WordPress web site over that hasn’t has its theme up to date in nearly ten years. It has 1000’s of audio information embedded with a SoundCloud shortcode that appears one thing like this:

[soundcloud url="http://api.soundcloud.com/tracks/11111111" params="auto_play=false&show_artwork=false&color=ff7700" width="100%" height="180" iframe="true" /]

Nevertheless, to ensure that them to work robotically with an on-screen participant which exhibits the audio information on the backside of the web page when scrolling, they should be transformed to block-style embeds:

<determine class="wp-block-embed is-type-rich is-provider-soundcloud wp-block-embed-soundcloud"><div class="wp-block-embed__wrapper">http://api.soundcloud.com/tracks/11111111</div></determine>

It is simple sufficient to do a regex search of the database and alter these.

Nevertheless, the previous shortcodes are in basic blocks and if these basic blocks aren’t transformed to Gutenberg blocks earlier than the regex search-and-replace, then WordPress would not deal with the newly changed textual content as correct block-style embeds. It simply treats them as meaningless code that it doesn’t interpret.

So the query is, is there a technique to mass-convert basic blocks to to Gutenberg blocks? I’ve seen and tried all of the plugins within the WordPress retailer that purport to do that, they usually now not work, and options supplied of their feedback don’t work, both. I’ve additionally checked out their code to find out if I might make them work, however that’s past my talent degree.