There are two reasons I can think of that may cause negative impact
-
wp_insert_post retrieves the post from the DB after writing it to it. this is not fun but should have only a constant impact, so I’m guessing it is not your main problem
-
Each post is being stored in memory as part of the caching process, and in the end this makes your server choke when it runs out of physical memory and starts swapping. try calling
wp_suspend_cache_addition
which suspends caching in the beginning of your script.
wp_suspend_cache_addition(true);
echo "get list of posts to be created in wordpress \n";
Related Posts:
- Why are simple updates to wp_postmeta’s “_edit_lock” so slow?
- How many ‘wp_insert_post’ calls can be performed in one shot, in a very long ‘for’ loop?
- HTML Entities in Post Title
- Insert two row in wordpress database
- Cannot add or update a child row: a foreign key constraint fails
- Cannot delete or update a parent row: a foreign key constraint fails
- ERROR 2003 (HY000): Can’t connect to MySQL server on localhost (10061)
- Rename a column in MySQL
- Syntax error due to using a reserved word as a table or column name in MySQL
- MySQL root password change
- Not unique table/alias
- Install mysql-python (Windows)
- #1055 – Expression of SELECT list is not in GROUP BY clause and contains nonaggregated column this is incompatible with sql_mode=only_full_group_by
- Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2)
- Disable ONLY_FULL_GROUP_BY
- MySQL WHERE IN ()
- SELECT list is not in GROUP BY clause and contains nonaggregated column …. incompatible with sql_mode=only_full_group_by
- Host ‘xxx.xx.xxx.xxx’ is not allowed to connect to this MySQL server
- difference between primary key and unique key
- Mysql command not found in OS X 10.7
- How to export a mysql database using Command Prompt?
- MySQL Error #1133 – Can’t find any matching row in the user table
- How can I prevent SQL injection in PHP?
- Best way to store an array in MySQL database?
- MySQL date formats – difficulty Inserting a date
- Cannot connect to Database server (mysql workbench)
- How to grant remote access permissions to mysql server for user?
- How to check if mysql database exists
- #1062 – Duplicate entry for key ‘PRIMARY’
- How can I convert a string to a float in mysql?
- Is there a Profiler equivalent for MySql?
- How to use greater than operator with date?
- How to replace the domain name in a WordPress database?
- Optimize WordPress Query that take 5 seconds to execute
- MySQL Replication Latency Issues in wp-admin pages
- Increment value (value = value+1) of $wpdb->update
- How can I debug my database connection for unit testing?
- Extending the database
- SQL query not working in alphabetical post title/content search
- Would this post meta be better added to the post table rather than post_meta table
- Universal problem: first request after ~25 second inactivity always slower (~1 second) than subsequent requests (~1/10sec)
- Importing MariaDB into Mysql in WordPress
- How to bulk edit canonical url’s in SQL?
- How to check for empty and not a failure
- Keeping database within limits, please help!
- Best settings for MySQL to speed up site? [closed]
- Insert post metadata for all posts in CPT at once if metadata no existent
- Can’t find my wordpress DB in phpmyadmin
- Deprecated: mysql_connect():
- Can’t get post ID using wp_insert_post_data
- Unique Post Meta Values
- How are multiple WordPress WPDB queries handled?
- Compare old meta with new post meta
- $wpdb select all meta for each post
- Calculate average crossing post categories
- Replacing link URL ending strings via MySQL
- Many slow queries post_type = ‘attachment’;
- SQL command to convert all tags in lowercase?
- Combining wp_insert_post() and update_post_meta()
- Problem with admin login after deployment
- Find out how many times the user has logged in
- Is it possible to create a WordPress table using array and loop?
- Can’t run database query
- How to stop $wpdb from prepending database name
- Match tag names with form titles
- Error missing MySQL extension
- Getting Error Trying to Create Table
- Best approach for a custom database filling in WP custom post types
- Why doesn’t custom mysql query return results? Is syntax correct?
- How can I get some of a posts meta data whilst it is still inserting?
- SQL statement using placeholder is not returning results
- How to Bulk find and replace MySQL for post image url
- Wpdb query with dynamic table name
- “BS_” rows in postmeta table
- How to search usermeta table
- Regular XML-RPC timeouts
- PHP Warning: mysqli_error(): Couldn’t fetch mysqli in
- update multiple rows in mysqli table base on two values
- Post meta data not showing in frontend, until hitting ‘update’ button
- How can I verify WordPress nonce from the following code?
- Query postmeta based on meta_value, return array of post_id
- How to write in MySQL more characters in user_nicename
- Adding user meta to post meta wp_insert_post() not working
- Get post meta after insert post
- $wpdb->get_var not returning count
- Custom user query – orderby meta_key (that may not exist)
- How to get Attachments(image) with specific width\height ratio
- What is the cron doing?
- Apache Redirect based on WordPress permissions
- Insert post programmatically and decide to tweet or not to tweet
- SQL error on restoring database
- MySQL database gives blank page (white screen of death)
- Datatabase error: Commands out of sync
- retrieve wordpress post-meta using php not wordpress functions
- why is $wpdb->update() causing a DB error from within wp_set_password()
- Global MySQL replacing of text patterns/matches
- If meta_key exists then don’t select this post?
- add multiple values (array) to post meta_input
- InnoDB: Error: log file ./ib_logfile0 is of different size
- Postgres equivalent to MySQL’s \G?