Faster way to wp_insert_post & add_post_meta in bulk
I have a csv file that I want to insert that consists of ~1,500 rows and 97 columns. It takes about 2-3 hours to do a full import and I'd like to improve this if there is a way. Currently for each row I'm doing a $post_id = wp_insert_post and then an add_post_meta for the 97 associated columns with each row. This is pretty inefficient...
Is there a better way to go about this in a way that a could get a post_id keep the relationship between post and its post_meta values?
Right now I'm trying this on my local machine with wamp but will have it running on a VPS
I have a csv file that I want to insert that consists of ~1,500 rows and 97 columns. It takes about 2-3 hours to do a full import and I'd like to improve this if there is a way. Currently for each row I'm doing a $post_id = wp_insert_post and then an add_post_meta for the 97 associated columns with each row. This is pretty inefficient...
Is there a better way to go about this in a way that a could get a post_id keep the relationship between post and its post_meta values?
Right now I'm trying this on my local machine with wamp but will have it running on a VPS
No comments:
Post a Comment