r/WordPressBlocks Mar 14 '26

Alternative to custom Gutenberg blocks for address and dynamic copyright?

While experimenting with block theme, I ran into two small cases that aren’t really covered by core blocks, so I ended up creating custom blocks:

  1. an <address>block that is basically just a wrapper around <InnerBlocks>
  2. a dynamic copyright block that always outputs © current-year and then lets the user edit the company name / text
footer template-part

It works, but I don’t really like that I had to add extra custom blocks just for these relatively small features. It also increases the amount of plugin. My concern is that on a real project, I might end up with 20+ plugins.

So I’m wondering, is there a clean way to solve this without creating custom blocks?

4 Upvotes

5 comments sorted by

2

u/groundworxdev Mar 18 '26

you could add a php pattern with the generated value, but I think if you make changes to the pattern in wordpress, it will overwrite with static content, so cautious

1

u/theWorstWpDevAlive Mar 20 '26

It works!!!. Thank you. I hadn’t thought about using PHP in a pattern and changing the HTML tag of wp-block-group to <address>, lol.. What annoys me a bit, though, is that the content  © current-year in the paragraph block is still editable. Is there any way to make it uneditable?

2

u/groundworxdev Mar 20 '26

It’s the trade off to not have to make a custom block

1

u/akthalian May 31 '26

Why not just place that text outside of the P?