How to update a Gutenberg block without manually recovering it?

I would recommend moving to a dynamic block as opposed to a static one. The difference being that dynamic blocks are rendered via PHP and don’t save the markup in the database. This allows you to make any changes you want to the block output and it will be reflected without needing to update each instance of the block.

In order to convert your static block to a dynamic one, you’ll need to modify the save property to return null on the JavaScript side and then register the block on the PHP side with a render_callback. There is a an example in the developer docs that you can review here.

If you update the question with your code, I’d be happy to help you update it.

tech