I am trying to update yoast focus keyphrase using the code below.
add_action( 'created_product_cat', 'ts_custom_woocommerce_placeholder', 10, 2 );
function ts_custom_woocommerce_placeholder( $post_id ) {
$productname = 'test prduct'
update_post_meta($post_id, '_yoast_wpseo_focuskw', $productname.' ecm');
return true;
}
What am I missing here?