I'm using wp_insert_post to generate posts for my site. Initially, everything works fine and it was very fast. When the number of posts accummulated to about 3000, it became very slow and now i almost cannot insert post anymore using that command. I tested the same script on another newly created database on the same server, everything runs very fast.

I have deactivated all plugins and turn off pinging service, but there is no improvement.

i used $id = wp_insert_post($array) to retrieve the post_id also. Anyone know how to resolve my problem? Is any other method to generate posts and get the post_id

Thanks for any help

  • 1
    Can you show the complete code you're using? – Pippin Jun 24 '12 at 19:16

You shouldn't be getting this problem, I have a site with more 10000 posts using this function all the time and everything works fine. Try running a cleanup in your database to see if things get better.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.