Title: Best practice to code a (simple) plugin with multiple blocks?
Last modified: November 17, 2020

---

# Best practice to code a (simple) plugin with multiple blocks?

 *  [julianoe](https://wordpress.org/support/users/julianoe/)
 * (@julianoe)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/best-practice-to-code-a-simple-plugin-with-multiple-blocks/)
 * Hi! I’m in the path to learn how to code my very first Gutenberg/Block editor
   plugin that for a website I’m working on.
 * The thing is: all the examples I find showcase plugins that only add 1 plugin
   and the plugins I tried to decypher to learn from were way too complicated for
   my level of understanding of React and all the new concepts
 * And all the documentation I find shows how to do it for 1 block. But what if 
   my plugin adds 2, 3 or more blocks? How is the best recommended way to structure
   it?
 * They all are quite simple, I just don’t really know how to structure things. 
   For example should register_block_type be repeated for every block?
 * I used create-guten-block to start (along the Css Tricks tutorial).. but’s it
   all seem to be a bit old and i’m not sure of how updated they are

Viewing 1 replies (of 1 total)

 *  Plugin Author [Isabel Brison](https://wordpress.org/support/users/isabel_brison/)
 * (@isabel_brison)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/best-practice-to-code-a-simple-plugin-with-multiple-blocks/#post-13800169)
 * Hi there!
 * You will need to register each block type. You can see for example how it’s done
   [in a loop for all the blocks](https://github.com/WordPress/gutenberg/blob/master/packages/block-library/src/index.js#L180)
   in the Core block library.
 * You can also try using the [create block package](https://github.com/WordPress/gutenberg/tree/master/packages/create-block),
   which provides the modern tooling setup for a block plugin out of the box.

Viewing 1 replies (of 1 total)

The topic ‘Best practice to code a (simple) plugin with multiple blocks?’ is closed
to new replies.

 * ![](https://ps.w.org/gutenberg/assets/icon-256x256.jpg?rev=1776042)
 * [Gutenberg](https://wordpress.org/plugins/gutenberg/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/gutenberg/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/gutenberg/)
 * [Active Topics](https://wordpress.org/support/plugin/gutenberg/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/gutenberg/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/gutenberg/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Isabel Brison](https://wordpress.org/support/users/isabel_brison/)
 * Last activity: [5 years, 5 months ago](https://wordpress.org/support/topic/best-practice-to-code-a-simple-plugin-with-multiple-blocks/#post-13800169)
 * Status: not resolved