What structure should post_content have in the database?

Let me start off by saying that I have no WordPress experience at all so I may be asking a really stupid question. What I need to do is transfer a bunch of articles from a old MySQL database to a WordPress site.

Now I found wp_insert_post and I can get all the data from the old DB. The problem starts with the article images. In the WordPress DB there seems to be a <figure class="wp-block-image size-large"><img src="hard path to image here" alt="" class="wp-image-4066"/></figure> tag that points to the exact image. Problem is that it is surrounded by, what I would call strange comments, that look like this :

<!-- wp:image {"id":4066,"sizeSlug":"large"} -->
<!-- /wp:image -->

This id seems to be the ID of the image that is made a attachment type post in the same table. My question is are these comments necessary or can I just generate the tag ?

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

Those comments have been added by the Gutenberg block editor. If you remove them you’ll no longer be able to edit those blocks in the admin using Gutenberg.


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x