I have created a lot of custom CSV importers for WordPress in the past and I have come across issues related to the time it takes for them to finish processing.

Whenever the importer starts running, it starts off importing a lot of posts per second but this speed keeps decreasing and I am trying to figure out the reason for this and if whether there is something that I can do to speed up things.

Some importers I create import up to 100k entries.

This is how they work:

  1. Load rows from CSV file into an array
  2. Get row from arrow
  3. Create a post using this row
  4. Add meta values to this post from the row
  5. Go back to #2

In some cases I have observed these importers to import as many as 200 entries in a few seconds when they are launch and this comes down to around 5 to 10 in a few seconds.

Does anyone know what the reason for this could be and if whether there is something that can be done about it?

  • 1
    Hopefully this answer can help?
    – birgire
    Dec 13 '14 at 12:55
  • It might be database writes piling up, but it's hard to say without profiling actual operation on specific data properly.
    – Rarst
    Dec 13 '14 at 16:13

This need some server side tune ups. In general the import timing depends on no of attributes imported per post. In particular handling media files like inline images within post, featured image etc. In case of https://wordpress.org/plugins/wp-ultimate-csv-importer, we have an option like no. of post server requests to balance the server load, memory and execution time within maximum limits as a solution.

  • flagged it as spam, because you crossed the fine line between relevant answer that is also self promoting and spam, by making an answer that has zero content except for promotional one. If you think your plugin's code don't have the same problem, please highlight how you do it. Dec 15 '14 at 5:19

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.