Consider this scenario. You’ve created a plugin that implements a static block, but now you’ve had a great idea for an update, an idea that will make the block you’ve developed just so much better. The problem is that it’s been published to the WordPress plugin directory and the block is in use on hundreds of websites.
Now consider this scenario. Your client has just been in touch, they want some changes made to the custom block that you developed for their website. The problem is that it’s a static block and the block is used in dozens, if not hundreds, of places in various pages and posts across their site.
Why are these scenarios a problem for you as a block developer?
If you make a change to a static block, and specifically if you make a change to the save()
function, i.e., the function that determines what content gets saved to the database and ultimately gets rendered in the front end, then you will see the “This block contains unexpected or invalid content” error message when the page is next loaded in the editor after the change.