The only two tables I can find is wp_posts and wp_postmeta and those do not seem to include the text which in is the post.
This should help: https://codex.wordpress.org/Database_Description
But note that these are other (arguably better) options besides making direct SQL calls.
There’s a WordPress-native PHP function for creating posts: https://developer.wordpress.org/reference/functions/wp_insert_post/
And there’s a REST API as well. Here’s an example: https://rudrastyh.com/wordpress/rest-api-create-post.html
Finally, if you have your content in CSV or XML format, there are plugins (eg WP All Import) that can import these into WordPress very easily.
Of course, if this is a one-time job, direct SQL import might be the preferred approach.
Looks good, thank you so much for your reply @gappiah! Just one question. How would I copy the “looks” of a previous post I made? I want to duplicate that one and just replace the text of one single element.
Anyways, I will look into that API call and give it a try!
-
This reply was modified 3 years, 4 months ago by
digitalforge.
Maybe you should look at reusables blocks and block patterns. When you click the + to add blocks you will see 2 other tabs. One for patterns and the other is reusable blocks.
Reusable blocks allow you to make a copy of a block or a group of blocks and save them. If it a group of blocks you might want to add them to a group container. You can drag the blocks back into a post of your choice.
All reusable blocks are tied together. So if you update one all the blocks will change to the same content regardless of where they are used at. I know this isn’t the effect you want. But, There also an option to remove the group from reusables block.
Try looking at some tutorials for reusable blocks. I think it pretty close to what you need.
Don’t try missing with the database files. To WordPress everything is a post which includes post,pages,and custom post types. The post meta table just classifies what they are and where they are to be used. Also, WordPress changes the information when it moves from the front end to the backend. I wouldn’t try to manually change the database unless there is no other choice.