WOOCS - WooCommerce Currency Switcher Professional

How remove or hide special WOOCS data in orders

WOOCS keeps special meta data of orders in data base which can be in different currencies. So after plugin removing this data can be visible. But different cases happens, and this valuable data can be uninstall wrongly, so code below doesn included in uninstall.php. You can remove data completely, but we recommend hide this data. And also do not forget make backups!

Delete WOOCS meta from db completely

add_action('wp_head', function() {
    $query_args = array(
        'post_type' => wc_get_order_types(),
        'post_status' => array_keys(wc_get_order_statuses()),
        'posts_per_page' => 999999999999,

    $all_orders = get_posts($query_args);
    foreach ($all_orders as $order) {
        $id = $order->ID;
        delete_post_meta($id, '_woocs_order_currency_changed_mannualy');
        delete_post_meta($id, '_woocs_order_rate');
        delete_post_meta($id, '_woocs_order_base_currency');

Hide WOOCS meta in orders

add_filter('woocommerce_order_item_get_formatted_meta_data', function($formatted_meta, $_this ) {
    $woocs_meta = array('_woocs_order_rate', '_woocs_order_base_currency', '_woocs_order_currency_changed_mannualy');
    foreach ($formatted_meta as $key => $meta) {
        if (in_array($meta->key, $woocs_meta)) {
    return $formatted_meta;
}, 99, 2);