Theme-Specific Custom Blocks — How to Bundle Theme
-
I am developing a WordPress block theme that relies on a set of custom Gutenberg blocks built specifically for that theme. These are not general-purpose blocks that would be useful to the broader WordPress community — they are tightly coupled to the theme’s design, markup structure, and CSS. Examples include a theme-specific primary navigation block, a post listing block with AJAX load more that reads the theme’s data attributes, a post content block that renders within the theme’s markup conventions, and so on.
I understand the WordPress.org guideline that blocks generally belong in plugin territory, and I respect the reasoning behind that separation. However, my situation raises a practical bundling question that I would appreciate clarity on.
If I build these blocks directly within the theme folder (for instance, under a directory like
our-block/src/with a compiledour-block/build/that registers the blocks viaregister_block_typein the theme’sfunctions.php), would this approach be accepted for a theme submission? The blocks serve no purpose outside the theme — they depend on the theme’s style sheet classes, template structure, and AJAX handlers that live in the theme’sinc/directory. Extracting them into a standalone plugin would leave users with blocks that render broken markup if they switch to a different theme.Alternatively, if the expectation is that these must be developed as a separate companion plugin, I have a concern about the submission workflow. The plugin approval process on WordPress.org operates on its own timeline. If my theme depends on that plugin to function correctly, I cannot realistically submit the theme until the plugin is approved. And the plugin, being theme-specific, may not meet the general-utility expectation that plugin reviewers look for. This creates a circular dependency in the approval process — the theme needs the plugin, the plugin only makes sense with the theme, and neither can be submitted independently without the other being live.
I would like to understand the recommended approach for this scenario. Specifically:
- Is bundling theme-specific custom blocks within the theme directory acceptable for a block theme submission, given that the blocks(and creating and distributing separate plugin) have no standalone utility?
- If a companion plugin is required, can the plugin be bundled within the theme directory during submission?
- If a companion plugin is required, is there an established workflow for submitting a theme and its dependent plugin in parallel so that both can be reviewed with full context?
- Are there any existing block themes in the directory that handle this pattern that I could reference as a precedent?
I want to build this correctly from the outset rather than restructure after a rejection. Any guidance the team can provide would be greatly valued.
You must be logged in to reply to this topic.