Hi thanks for the help but I tried with the following code but the product pages still load.
add_filter( 'woocommerce_register_post_type_product', 'thects_product_post_type' );
function thects_product_post_type( $args ){
$args['public'] = false;
$arg['publicly_queryable'] = false;
$arg['exclude_from_search'] = true;
$arg['rewrite'] = false;
return $args;
}
I also tried editing the attributes directly in the class-wc-post-types.php file but the product pages still load as they normally do.