Title: Reset statics / logs
Last modified: November 16, 2022

---

# Reset statics / logs

 *  Resolved [minomet](https://wordpress.org/support/users/minomet/)
 * (@minomet)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/reset-statics-logs/)
 * Hi, the plugin is great.
 * How i could reset all the statics, from vendors, to clean the dashboard an restore
   to 0 the monts earnings?
 * Thanks

Viewing 1 replies (of 1 total)

 *  Plugin Author [WebWizards](https://wordpress.org/support/users/webwizardsdev/)
 * (@webwizardsdev)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/reset-statics-logs/#post-16207389)
 * Hi there,
    I believe you can achieve that by adding the following PHP code snippet
   to your site:
 *     ```
       add_action('wp_footer', function(){
       	$earnings = get_posts( array( 
       	    'post_type' => 'marketking_earning',
       	    'numberposts' => -1,
       	    'post_status'    => 'any',
       	    'fields'    => 'ids',
       	));
   
       	foreach ($earnings as $earning){
       		wp_delete_post($earning);
       	}
   
       	$agents = get_users(array(
       	    'meta_key'     => 'marketking_group',
       	    'meta_value'   => 'none',
       	    'meta_compare' => '!=',
       	    'fields' => 'ids',
       	));
   
       	foreach ($agents as $agent){
       		delete_user_meta($agent,'marketking_user_payout_history');
       		delete_user_meta($agent,'marketking_outstanding_earnings');
       		delete_user_meta($agent,'marketking_user_balance_history');
       	}
       });
       ```
   
 * After adding this, open your site on the frontend, for the snippet to load. Then
   when you’re done, remove the snippet.
 * The snippet can be added to functions.php or through any snippets plugin.

Viewing 1 replies (of 1 total)

The topic ‘Reset statics / logs’ is closed to new replies.

 * ![](https://ps.w.org/marketking-multivendor-marketplace-for-woocommerce/assets/
   icon-256x256.jpg?rev=2707404)
 * [MarketKing — Ultimate WooCommerce Multivendor Marketplace Solution](https://wordpress.org/plugins/marketking-multivendor-marketplace-for-woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/marketking-multivendor-marketplace-for-woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/marketking-multivendor-marketplace-for-woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/marketking-multivendor-marketplace-for-woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/marketking-multivendor-marketplace-for-woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/marketking-multivendor-marketplace-for-woocommerce/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [WebWizards](https://wordpress.org/support/users/webwizardsdev/)
 * Last activity: [3 years, 9 months ago](https://wordpress.org/support/topic/reset-statics-logs/#post-16207389)
 * Status: resolved