• hi,

    i have to create a BUNCH of pages, and after trying wp_insert_post(), it is clear that i cannot use it – it is MUCH TOO SLOW for large numbers of posts. i am inserting like 30,000 pages.

    so i am writing a script to so the inserts manually, writing to the database directly. i am inserting data into wp_posts and wp_postmeta. apparently, i am missing something, because although all the data is in those 2 tables, when i try to access the page using it’s url, i get a “page not found”. if i bring the page up in the admin tools and just save it (no changes), it suddenly works.

    i assume i am just missing either some data element in those 2 tables, or another table i have missed. can anyone fill me in?

    needless to say, my script runs infinitely faster than the script that uses wp_insert_post.

    any help greatly appreciated.

    thanks,

    -laz

Viewing 1 replies (of 1 total)
  • I think yours is a very good question and I was just trying to do what you did. Hope someone will reply, please let me know if you solve this question by yourself!

    Anyway I think that you could go and see what actually function wp_insert_post does, reading its code in post.php

    Good luck

Viewing 1 replies (of 1 total)
  • The topic ‘how to insert post directly into database’ is closed to new replies.