If you'd rather Tasty Links only show up inside the ingredients section of your Tasty Recipes, simply add the below PHP snippet to your theme's functions.php file:

/**
 * Disable Tasty Links except for on Tasty Recipes ingredients.
 */
add_action( 'init', function() {
// Remove Tasty Links from the main post content.
remove_filter( 'the_content', array( 'Tasty_Links\Frontend', 'filter_the_content' ) );
// Remove Tasty Links from Tasty Recipes description, notes, ingredients, and instructions.
remove_filter( 'tasty_recipes_the_content', array( 'Tasty_Links\Frontend', 'filter_tasty_recipes_content' ) );
// Remove Tasty Links from editor previews
remove_filter( 'the_editor_content', array( 'Tasty_Links\Admin', 'filter_the_editor_content' ) );
// Add Tasty Links back, but only on ingredients.
add_filter( 'tasty_recipes_recipe_template_vars', function( $template_vars ){
if ( class_exists( 'Tasty_Links\Frontend' ) ) {
$template_vars['recipe_ingredients'] = Tasty_Links\Frontend::filter_tasty_recipes_content( $template_vars['recipe_ingredients'] );
}
return $template_vars;
});
});

Links should stop appearing anywhere in the post content outside the Tasty Recipes ingredients area.

Did this answer your question?