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.