• Resolved art137

    (@art137)


    Trying to export to imprt comments to a staging site but coming up with an empty CSV file

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author WebToffee

    (@webtoffee)

    Hi @art137,

    By default, the plugin only supports exporting the post comments. Can you please tell us which comments you are trying to export & import?
    If you are trying to migrate page comments then please use the below code snippets. You may please copy the snippet in the active theme’s functions.php file

    Snippet for exporting:

    add_filter('product_Comments_csv_product_export_args', 'wtproduct_Comments_csv_product_export_args');
    function wtproduct_Comments_csv_product_export_args($args){
        if(isset($args['post_type']) && $args['post_type'] == 'Post'){
            $args['post_type'] = 'Post,page'; 
        }
        return $args;
    }

    Snippet for importing:

    add_filter('wt_cmt_imp_post_exists_query', 'wt_cmt_imp_post_exists_query');
    
    function wt_cmt_imp_post_exists_query($query) {
        global $wpdb;
        $query = "SELECT ID FROM $wpdb->posts WHERE ID = %d AND (post_type='post' OR post_type='page')";
        return $query;
    }
Viewing 1 replies (of 1 total)
  • The topic ‘Blank Comment Export File’ is closed to new replies.