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.
Related Posts:
- Help Unregistering a Core Block Type in Gutenberg
- How do I get the current post ID within a Gutenberg/Block Editor block?
- Disable device preview options in the block editor
- Get the current block ID
- How do you use __experimentalLayout to give innerblocks alignment control and default layout?
- Modify the core/paragraph block
- What’s the recommended Gutenberg component for adding a URL, in the toolbar/sidebar?
- Once Again: How to Remove Option from Gutenberg Editor for Specific Block in theme.json
- Uncaught TypeError: wp.apiFetch is not a function
- how to get a more significant error response from ServerSideRender
- Align a custom block button by wrapping it in div
- Using applyFormat (from @wordpress/rich-text) to make persistent changes to Gutenberg’s rich text value
- Block validation: Block validation failed for `my-block`
- How to set the localization for a Gutenberg block?
- How does the Gutenberg mobile/tablet/desktop preview work with media queries?
- How to render core component inside edit() within custom registered block in Gutenberg?
- Modify Core Block Default Attributes
- How to set defaults for Border controls in custom block
- Compatability of gutenberg block in older WordPress version
- Find all the places where a block type is used
- WordPress PluginSidebar, TextControl setting and saving the default value
- How can I dynamically wrap in a Gutenberg block?
- Modifying the Gutenberg Button Block
- Style Gutenberg metaboxes like they belong on the site
- How to get featured_media of a post with getEntityRecords?
- How to grab posts in Gutenberg Block?
- How can I access the attributes of a block within InnerBlocks?
- How to avoid duplicate dependencies in Gutenberg blocks
- How to learn Gutenberg block development [closed]
- Unable to disable Gutenberg with plugin Classic Editor or Disable Gutenberg
- How to use the @wordpress/date block in the Gutenberg editor?
- Gutenberg Block Development: Trying to add custom js script to npm start command by modifying webpack.config
- Popover in a LinkControl style
- Is there any way to render the WordPress Gutenberg core/embed block in PHP by passing in the URL?
- How to use in Block Editor – react-bootstrap?
- Double container elements on custom block in editor
- How to target block variations with has_block()?
- How to add extra option to WP core gallery block?
- Can I jump over a InnerBlocks component to target content inside with react-flickity-component?
- Use a React Component in conjunction with Blocks
- Make a custom block like default paragraph block, so that Enter starts a new block
- Custom gutenberg block not rendering with styles on frontend
- Gutenberg Block on Second Edit fails validation
- Import setAttributes() method in a separated module
- Add a hyperlink to a group block?
- How to change Block Controls Icon in Gutenberg?
- Adding content to Page settings rather than Block settings
- Detect if a block has been deleted
- Add multiple images to a custom block
- How do I disable the block marketplace for Editors?
- How to use __experimentalCaptureChildToolbar
- Why is wordpress suddenly stripping away all newline characters and how to disable this?
- Gutenberg RadioControl saving data but not not selecting radio
- Override RenderCallback from LatestPosts
- Gutenberg on block move
- Gutenberg template lock but add/delete blocks programmatically
- Notion-like editing and layout with a convenient freeform collaborative editor in WordPress? [closed]
- How can I make Gutenberg block layout switchable without lost of current content?
- code block does not show in excerpt
- Is it possibe to prepend “ with icons or text?
- If you have multiple dynamic blocks with a post loop on a page, how do you avoid duplicates from inside the render_callback function?
- How to create Gutenberg’s pattern category automatically with custom post taxonomy terms?
- How to Change the Gutenberg editor’s colors?
- Debugging Gutenberg block with the React Profiler (React Developer Tools)
- Modify core/image block by adding inner span to figcaption in save
- How to override a function in the wp_includes folder(block supports/colors.php)
- If is block name
- Is there a way to grab the current value of the editor in Gutenburg/Classic WordPress editor? (Not the saved value of the post!)
- Can I add custom code to gutenberg auto save?
- Changing block quote size in gutenberg
- How to get the revisions feature back on the classic editor?
- how to use a Text component in javascript?
- How to nest a list inside a blockquote using the Gutenberg block-editor?
- Is there an obvious error in this React code for customizing a Gutenberg Block?
- Two content editors (gutenberg blocks) on the same page
- Expose Gutenberg blocks in Post Revisions API endpoint
- How to wrap Gutenberg blocks into a custom container (without using HTML blocks)?
- DateTimePicker script and style missing?
- Gutenberg pass properties to filter
- How to remove multiple blocks of Gutenberg at the same time?
- How to set the background color of a template part (Header/Footer) in Twenty Twentythree?
- Run callback on removeBlock action
- Gutenberg blocks – only allow as innerblock
- Pullquote Block Styles disappeared?
- Using useSelect creates “minified React error”
- How do I reinstate the “Add Block” feature that changes with the update?
- Is it possible to consume context from a parent block and update it from within a child block?
- Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined
- WordPress “HTML editor” which doesn’t trash hand-coded HTML?
- How to force package.json to create build some files?
- How to modify array of object in Gutenberg (block/editor)?
- fetch more than 100 records in block editor API call
- Block development: how to bump version on generated css files?
- Full Site Editing (FSE) – How do I display no results with wp:query?
- Dealing with unknown option ‘–variant’ when setting up a block environment
- Localising a Block
- WordPress.org UI: How do you make Bulleted/Numbered Lists indent by default?
- Unable to remove panels
- Is there a way to delete “wp-block-group__inner-container” div from the gutenberg editor view?
- Gallery Block in template, validation fails after adding column number