Promote your Service and Product online Contact us

+91 87 44 999667; +91 99 11 883996 info@3pixls.com, sales@3pixls.com

Remove duplicate product link from WooCommerce Page Row Actions


[php]
function my_duplicate_post_link($actions, $post) {

// The following checks WHERE we should run if not products just return
if ( $post->post_type != ‘product’ ) {
return $actions;
}

$product = get_product( $post->ID );
unset($actions[‘duplicate’]);
return $actions;
}

// Notice priority changed from default 10 to 15(anything greater than 10)
// Priority defines WHEN we should run
add_filter(‘post_row_actions’, ‘my_duplicate_post_link’, 15, 2);
add_filter(‘page_row_actions’, ‘my_duplicate_post_link’, 15, 2);
[/php]