• Resolved ghalleb

    (@ghalleb)


    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!

    https://www.ads-software.com/plugins/csv-importer/

Viewing 3 replies - 1 through 3 (of 3 total)
  • 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?

    Thread Starter ghalleb

    (@ghalleb)

    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….

    Probably requires a server restart.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Slow Import ans Solution…’ is closed to new replies.