Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

share|improve this question
1  
Can you show the complete code you're using? –  Pippin Jun 24 '12 at 19:16

1 Answer 1

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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