-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Block Bindings: empty state of custom field can cause SEO problem #66887
Comments
Thanks for reporting this, it's an interesting one! There was a similar comment about the button block in the forums - https://wordpress.org/support/topic/synced-patterns-override-dont-display-field-when-not-filled-in/. It turns out the button block already has this feature—it doesn't output any markup when there's no content (the behavior is not part of the block bindings feature but built into the block itself). There's some inconsistency across core blocks in what they output when there's no content, I think the button block is in the minority. It might be that some blocks should work like the button block innately, but I don't know if it should be part of the block bindings feature, as that comes with some issues:
Perhaps something like block states is another future solution for this - #57719. |
Thanks for opening the issue! I agree with @talldan, and I am not sure if it is an issue specific to block bindings. If I am not mistaken, if you create an empty heading (without bindings), it is printed in the frontend. That's why I think it is an issue with the block itself, and not exactly with bindings. For the heading, we should probably add some logic to the PHP rendering here to handle that use case. |
Yes I think you are right, this issue should be about Gutenberg and not just block bindings. |
What problem does this address?
When a field in a bound block is empty, the empty markup is printed in the page.
It's not a very big problem with paragraph markup, but it can cause a SEO problem with the heading tag.
What is your proposed solution?
Remove the markup when a custom field is empty on a bound block.
The text was updated successfully, but these errors were encountered: