Prevent WooCommerce Orders from being cloned?

Is there a way to prevent cloner from cloning our woocommerce orders?

  • Adam Czajczyk
    • Support Gorilla

    Hello Web Developer,

    I hope you're well today and thank you for your question!

    This can be achieved with an additional bit of a code. WooCommerce orders are posts of custom type and Cloner includes a filter hook that we can use to skip "shop_order" type posts:

    function wpmu_skip_wc_orders_clonning($args) {
    	if ($args['post_type'] == "shop_order") {
    		$args['posts_per_page'] = 0;
    		return $args;

    To apply it to your site please:

    - create an empty file with .php extension (e.g. "skip-wc-orders-cloning.php")
    - paste that code inside using "clean text" editor (like Notepad++, Sublime or similar)
    - upload the file to the "/wp-content/mu-plugins" folder of your Multisite.

    If there's no "mu-plugins" folder inside "wp-content" folder, create it.

    I tested it on my Multisite test setup and it seems to be working fine.

    I hope that helps :slight_smile:

    Best regards,

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.