Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author MyThemeShop

    (@mythemeshop)

    Hello,

    Please make a backup of your WordPress database before proceeding below. Kindly try editing your active theme’s functions.php and append the following

    
    add_action( 'admin_post_purge_reviews', function() {
        global $wpdb;
    
        $comments = get_comments( array(
            'type' => WP_REVIEW_COMMENT_TYPE_VISITOR,
            'fields' => 'ids',
        ) );
    
        foreach ( $comments as $comment_id ) {
            wp_delete_comment( $comment_id );
        }
    
        $wpdb->delete( $wpdb->postmeta, array( 'meta_key' => 'wp_review_user_reviews' ) );
        $wpdb->delete( $wpdb->postmeta, array( 'meta_key' => 'wp_review_review_count' ) );
    
        wp_die( 'Ratings removed' );
    } );
    

    Then, visit /wp-admin/admin-post.php?action=purge_reviews. If you see Ratings removed, you can remove the code added above and check if the ratings have now been removed.

    Thank you

    Thread Starter jardazet

    (@jardazet)

    MyThemeShop: Great, it works perfectly, thank you!

    • This reply was modified 8 years, 6 months ago by jardazet.
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Reset user rating’ is closed to new replies.