You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Improve Documentation for Block Registration: namespace in Block Name #71022
Choosing a namespace when starting with block development is very important and it's not clear from the documentation that this cannot be changed later and must be thoughtfully named. This documentation should be expanded or link to another page with more examples, and clear documentation showing the consequences of using the wrong namespaces.
Add clarification that block namespaces cannot be changed later so must be carefully selected. The block name is part of the HTML comment and is stored in the post content of the posts using that block so it cannot be changed without editing each post or using scripts to find/replace the name in all posts across a site or multi-site network.
That in most cases all blocks in a plugin or theme should share a namespace. To be cautious about sharing namespaces across multiple plugins or themes unless that is intended.
That namespaces should be unique across any themes/plugins that are added later so avoid generic names like editorial/some-block or block/some-block-name.
Additionally that registerBlockCollection() only supports a single namespace.
How do I know this is an issue?
Got burned as an early adopter and building lots of blocks used in thousands of posts across a large multi-site, multi-network environment and am now dealing with the consequences of not understanding how important and immutable the block name is. 😢
Thanks for raising this — I completely agree that namespace clarity in block registration is a critical but under-documented area, especially for newer developers starting with block development.
I'd like to contribute to improving this documentation and propose the following approach:
Proposed Approach:
Update the Block Registration Documentation
Clearly explain the block name structure (namespace/block-name)
Emphasize that this name is permanently stored in post content and cannot be changed later without complex migrations.
Highlight that block names must be carefully chosen upfront.
Add a “Best Practices” Section
Use a unique namespace (typically plugin/theme slug)
Avoid generic namespaces like create-block/, editorial/, or block/
Maintain namespace consistency across all blocks in a plugin/theme
Avoid using the same namespace across multiple projects unless intentional
Mention Technical Constraints
Clarify that registerBlockCollection() supports only one namespace
Optionally, link to an example of bulk block renaming (if possible) and its risks
If this sounds good, I can begin working on a documentation pull request. Please let me know if you’d prefer this content to be integrated into the current Block API guide or whether it should be a dedicated “naming best practices” page linked from there.
Looking forward to your feedback and happy to help improve the dev experience around block development. 🙌
Activity
Sahil1617 commentedon Aug 2, 2025
Hi @acketon, @mtias, and team 👋,
Thanks for raising this — I completely agree that namespace clarity in block registration is a critical but under-documented area, especially for newer developers starting with block development.
I'd like to contribute to improving this documentation and propose the following approach:
Proposed Approach:
If this sounds good, I can begin working on a documentation pull request. Please let me know if you’d prefer this content to be integrated into the current Block API guide or whether it should be a dedicated “naming best practices” page linked from there.
Looking forward to your feedback and happy to help improve the dev experience around block development. 🙌
acketon commentedon Aug 5, 2025
Thanks @Sahil1617, this looks great.