Support » Plugin: Yoast SEO » Missing field “description” for Recipes

  • Resolved evil

    (@p47ri0t)


    Hi, after I update the Yoast plugin from 17.5 to 17.8
    I get a warning in the google search console “Missing field “description” for Recipes”

    I already set the Recipe type to the custom category in function.php

    
    add_filter('wpseo_schema_article', function($data)
    {
    if (has_category(array(32,40), $post)) {
            $data['@type'] = "Recipe";
            class_exists('WPSEO_Frontend') && $data['description'] = wp_strip_all_tags(WPSEO_Frontend::get_instance()->metadesc(false), true);
            unset($data['articleSection']);
       } }

    Rich Results Test: https://search.google.com/test/rich-results/result/r%2Frecipes?id=v6zEL2MwMBqEJtRjM3sHwg
    tested page: https://www.tasvirezendegi.com/?p=198208

    • This topic was modified 11 months ago by evil.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter evil

    (@p47ri0t)

    I downgrade to 17.5 and it is ok now.

    Plugin Support Michael Tina

    (@mikes41720)

    Hi @p47ri0t

    Are you using that filter to add custom schema to the default Yoast SEO schema.org graph?

    While we can’t provide advice on custom code, we would like to refer you to our Schema API, if you would like to make any modifications and add or customize any graph pieces to address those warnings/errors you are receiving – https://developer.yoast.com/features/schema/api

    Thread Starter evil

    (@p47ri0t)

    Hi,@mikes41720
    The code was running well.Have you made any changes to newer versions? Can you check my code more closely?

    • This reply was modified 11 months ago by evil.
    Plugin Support Jeroen Rotty

    (@jeroenrotty)

    Hey!

    Yes, there was a deprecated WPSEO_Frontend class that was removed, but was today reïntroduced in 17.9. Can you please check if this works with 17.9? 🙂

    Thread Starter evil

    (@p47ri0t)

    The problem seems to have been fixed. Thanks to the Yoast team for the follow-up🙏

    Plugin Support Jeroen Rotty

    (@jeroenrotty)

    Nice! Happy to hear it.

    Have a great day!

    Just to note: WPSEO_Frontend is deprecated, so please do update it going forward, you can find our developer documentation on developer.yoast.com

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Missing field “description” for Recipes’ is closed to new replies.