Add IDs to all headings on a page in WordPress
See how to set the ID attribute for a heading, based on the heading content.
Removing selected Gutenberg block from post content in WordPress
There are cases where you want to hide a Gutenberg block from readers.
To do it you should add new filter for the_content.