Answer the question
In order to leave comments, you need to log in
Move PHP SQLite3 from database to WordPress?
Hello connoisseurs! Can you please tell me the best way to transfer posts from SQLite3 database (database.db) with the following columns: "id, name, link, content" to a WordPress site? In general, you only need 'name' for the post name and 'content' for its content.
Thank you!
Answer the question
In order to leave comments, you need to log in
1) find a table in the WP database that stores posts, study its structure. There, in addition to the title and content, additional data is probably needed, for example, the author and publication date
2) write a script that connects to sqlite and the WP database and does something like this (pseudocode):
while($post=$sqlite->fetch()){
$wp_db->insert("wp_post", ["title"=>$post["title"],"content"=>$post["content"],"author"=>$author_id])
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question