Add post’s category as a meta tag to the post
You can use the below snippet to achieve the result. add_action( ‘wp_head’, ‘so_407790_add_meta_tags_to_post’ ); /** * Add category meta tags to post. */ function so_407790_add_meta_tags_to_post() { // Get the current page categories. $categories = get_the_category(); if ( ! $categories ) { return; } // Category slug into list with comma separated. $category_list = implode( ‘,’, … Read more