Change Meta with wpseo_metakey
-
Hello,
I’m trying to change some meta to declare a recipe object instead of a standard article.I’m using WP SEO apis
https://yoast.com/wordpress/plugins/seo/api/I changed the og:type like this from “article” to “recipe” using the filter wpseo_opengraph_type:
function yoast_change_opengraph_type( $type ) { return 'recipe'; } add_filter( 'wpseo_opengraph_type', 'yoast_change_opengraph_type', 10, 1 );
it Works. How about other metas?
How to trasform this: <meta property=”article:tag” content=”tomato” />
into this: <meta property=”recipe:tag” content=”tomato” /> ?I tried using wpseo_metakey filter, like this:
function yoast_change_meta( $str ) { $meta = str_replace("article:", "recipe:", $str); return $meta; } add_filter( 'wpseo_metakey', 'yoast_change_meta', 10, 1 );
but is not working.
anyone knows if this is possibile?
- The topic ‘Change Meta with wpseo_metakey’ is closed to new replies.