Title: Define blocks just with code
Last modified: September 4, 2020

---

# Define blocks just with code

 *  Resolved [dbugger](https://wordpress.org/support/users/dbugger/)
 * (@dbugger)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/define-blocks-just-with-code/)
 * Is it possible somehow to define blocks entirely using Code? I saw this image
   in the Homesite of LazyBlocks:
 * [https://shorturl.at/ivAF1](https://shorturl.at/ivAF1)
 * And it is what it seems a code definition of a block. I would like to do something
   like that, but I cannot find any documentation to do this.
    -  This topic was modified 5 years, 9 months ago by [dbugger](https://wordpress.org/support/users/dbugger/).
    -  This topic was modified 5 years, 9 months ago by [dbugger](https://wordpress.org/support/users/dbugger/).

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [nK](https://wordpress.org/support/users/nko/)
 * (@nko)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/define-blocks-just-with-code/#post-13367615)
 * Hi.
 * You can export your blocks to PHP [https://lazyblocks.com/documentation/export-blocks/](https://lazyblocks.com/documentation/export-blocks/)
 * p.s. your screenshot is not loading.
 * Regards, nK.
 *  Thread Starter [dbugger](https://wordpress.org/support/users/dbugger/)
 * (@dbugger)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/define-blocks-just-with-code/#post-13368447)
 * Yes, they can be exported to PHP, but that only is useful to import them back
   into another system, no?
 *  Thread Starter [dbugger](https://wordpress.org/support/users/dbugger/)
 * (@dbugger)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/define-blocks-just-with-code/#post-13368454)
 * What I want is to have the definition of my custom blocks linked to the code 
   of my theme directly, so that if the theme gets activated/installed, the blocks
   will be available, without having to import anything.
 * I will try again the screenshot: [https://bit.ly/3h1qPiZ](https://bit.ly/3h1qPiZ)
 *  Plugin Author [nK](https://wordpress.org/support/users/nko/)
 * (@nko)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/define-blocks-just-with-code/#post-13403140)
 * Blocks can be exported/imported manually using JSON.
 * If you use PHP, blocks will be only registered once your code is active.
 * What do you need – is another feature, which is not available in our plugin.
 * The screenshot of the code is custom controls registration, it is not related
   to your question at all.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Define blocks just with code’ is closed to new replies.

 * ![](https://ps.w.org/lazy-blocks/assets/icon-256x256.png?rev=2584676)
 * [Custom Block Builder - Lazy Blocks](https://wordpress.org/plugins/lazy-blocks/)
 * [Support Threads](https://wordpress.org/support/plugin/lazy-blocks/)
 * [Active Topics](https://wordpress.org/support/plugin/lazy-blocks/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/lazy-blocks/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/lazy-blocks/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [nK](https://wordpress.org/support/users/nko/)
 * Last activity: [5 years, 8 months ago](https://wordpress.org/support/topic/define-blocks-just-with-code/#post-13403140)
 * Status: resolved