Search code examples
wordpresswordpress-rest-apiwordpress-gutenberg

Creating a post with guttenberg content using the WP-REST-API


I am using the wp rest api for adding posts to my site from another app. Therefore I use POST /wp-json/wp/v2/seminar where seminar is my custom post type. In the post data I set content to some text.

The Problem is that Wordpress creates a block with the tinyMce editor instead of using the default guttenberg paragraph block (see images below).

What is created: Image of Tinymce

What I want to be created: Image of paragraph editor

Does someone know a way to make wordpress creating the paragraph insted of the tinymce block?


Solution

  • Try to make content like this

    <!-- wp:paragraph -->
    <p>my content text</p>
    <!-- /wp:paragraph -->