How to set the meta description of a WooCommerce product as its primary category description?
Use the wpseo_metadesc filter: function wpse_406559_product_meta_description_from_category( $description ) { if ( ! is_singular( ‘product’ ) || $description ) { // Bail early if not single product, or custom meta description is already set return $description; } $product_cats = get_the_terms( get_queried_object_id(), ‘product_cat’ ); // Get first product category $product_cat = is_array( $product_cats ) ? current( $product_cats … Read more