Title: programattically add new block
Last modified: November 3, 2020

---

# programattically add new block

 *  [sourcenova](https://wordpress.org/support/users/sourcenova/)
 * (@sourcenova)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/programattically-add-new-block/)
 * Hi,
 * i am working on a custom block that allows innerblocks, one of these inner blocks
   is also a custom block with content in it. What i am trying to achiev is that
   the user should be able to mark/click/drag part of that content into a new inner
   block that is then added under the existing ones.
    so what i am looking for is
   for example a function to create a new block (p,richtext, image or even a customblock)
   and add said content into it (the content adding could be done via react state
   i guess). Is there something like that or is there a hook, an API route or anything
   that i can use to create a new innerblock?
 * I am not entirely sure if this support forum is the right place for such questions.
   If not could you please point me to the right direction?
 * Thank you in advance,
    regards Eli

The topic ‘programattically add new block’ 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/)

 * 0 replies
 * 1 participant
 * Last reply from: [sourcenova](https://wordpress.org/support/users/sourcenova/)
 * Last activity: [5 years, 6 months ago](https://wordpress.org/support/topic/programattically-add-new-block/)
 * Status: not resolved