CSV Importer
Slow Import ans Solution... (4 posts)

  1. ghalleb
    Posted 2 years ago #

    I found importing posts was very slow. I could only import 1000 posts before having a time out.

    I took a look closely to wordpress code and discovered that adding this line could give a hude optimization:

    wp_defer_term_counting( true );
    wp_defer_comment_counting( true );

    Put that in your function file for example. But then, don't forget to remove it, or add this after you are done(just to be sure):

    wp_defer_term_counting( false );
    wp_defer_comment_counting( false );

    I hope it will help someone!


  2. BigDogSF
    Posted 2 years ago #

    Hi...tried this, saw no difference. I'm wondering if it is due to the fact that I am importing to a custom post type.? Or placed in wrong file...I put it in the theme functions.php.

    Any thoughts?

  3. ghalleb
    Posted 1 year ago #

    Sorry for the late answer...

    I'm importing to a customn post type too.

    With this 2 lines, importing was like 20x faster.

    Check if there is not this lines anywhere else or try to put them in several files like functions.php or in the plugin itself....

  4. pmconsulting
    Posted 1 year ago #

    Probably requires a server restart.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • CSV Importer
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.