Read more

https://ps.w.org/woo-related-products-refresh-on-reload/assets/icon-256x256.png?rev=1531812
Display related products based on tags only in Woocommerce

//force related to tags - salesnudge.io

add_filter( 'woocommerce_product_related_posts_relate_by_category', 'salesnudge_product_related_posts_relate_by_category' );
add_filter( 'woocommerce_product_related_posts_force_display', 'salesnudge_product_related_posts_force_display', 99, 2 );
function salesnudge_product_related_posts_force_display($re, $prod){
return true;
}
function salesnudge_product_related_posts_relate_by_category(){
return array(); //force to tag instead of category
}