Woocommerce exclude specific categories products from related products

add_action( 'wp', 'vn_remove_related_products' );
function vn_remove_related_products() {
  if ( is_product() && has_term( array('workshops', 'events'), 'product_cat' ) ) {
        remove_action( 'woocommerce_after_single_product_summary', 
'woocommerce_output_related_products', 20 );
  }
}

Function has_term() can pass first parameter as array with terms.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)