• Resolved felr

    (@felr)


    This is more some feedback or suggestion:

    since quite a while, I have received errors in Google Search Console when using the plugin.

    “Structured data with syntax errors detected
    Invalid items are not eligible for Google Search’s rich results.”

    and in details:
    “Parsing error: missing ‘,’ or ‘}'”.

    On digging into this, I found that the schema.org snippet created by the plugin was messed up by some internal links I had used in image descriptions or in the blog post.

    Since the ‘BlogPost’ type isn’t supported anyway anymore by Google (and WordPress is all about ‘BlogPosts’, isn’t it?), I think it’s time to add an option to avoid generating schema data snippets altogether. I have removed their generation from the code for now, to avoid the Search Console errors, but an option would be nicer and allow easier updating.

    Just a suggestion.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor dudo

    (@dudo)

    Hello!

    Do you have a link so I can test this error?

    Since the ‘BlogPost’ type isn’t supported anyway anymore by Google (and WordPress is all about ‘BlogPosts’, isn’t it?),

    BlogPost is supported, but it just doesn’t show stars in serp; this is a big difference.
    And no, WordPress by default doesn’t add that item type, this depend by plugin or theme ??

    Thread Starter felr

    (@felr)

    Thanks for your feedback, dudo!

    one of the affected pages was this one: https://www.psychotherapiepraxis.at/pt-blog/depression-diagnose/
    I haven’t changed anything in the blog content, only removed the schema generation by YASR. So if you grab the blog post text, you should be able to work out where the generated schema code broke. I recall correctly, the error was caused by double quotes or an URL in an embedded image or image footer text, or by the automatically created ‘keywordlink’ links in the text.

    Thanks for your other clarifications, I had missed that! I still think that an option to skip schema tag generation would be nice.

    Plugin Contributor dudo

    (@dudo)

    You can add this code to your theme to remove schema if ‘blogPosting’ itemtype is selected

    add_filter('yasr_filter_schema_jsonld', function($review_choosen) {
        if($review_choosen === 'Other' || $review_choosen === 'BlogPosting') {
            return false;
        }
        return $review_choosen;
    });

    Best,
    Dario

    Thread Starter felr

    (@felr)

    Thanks for your reply!

    As you can see in the page source, I’ve already removed the schema code.

    However, the stars are still not displayed, only the current (last) rating.

    cheers,
    felr

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Parsing error when using YASR’ is closed to new replies.