Filter: Display keywords in recipe cards

The keywords field in the recipe card is required for the recipe schema. However, it doesn’t need to be displayed on the recipe card. For this reason, we hide the keywords by default. If you would like to display the keywords, this custom PHP code snippet can do that.

We recommend using a free code snippets plugin like WP Code to add the following code to your site:

add_filter( 'tasty_recipes_recipe_template_vars', function ( $template_vars, $recipe ) {
	$recipe_json = $recipe->to_json();
	$template_vars['recipe_keywords'] = $recipe_json['keywords'];
	return $template_vars;
}, 10, 2 );

Ready to grow your site with less stress?

Join 12,000+ creators using WP Tasty. 14-day money-back guarantee.

Get Started Now

Don't forget your purchase!

Complete Purchase