Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1294624

    In the Google Rich Result tests, I see that there is no name set for my FAQPage element (which is created by an accordion in Enfold).
    There is no error or warning, but I still would like to set a name for the FAQPage for SEO purposes.
    How could I do this?
    What would I need to change in my child theme, e.g. to set the name of the FAQPage to the text content of a custom field?

    • This topic was modified 3 years, 6 months ago by Ismael.
    #1295217

    Hey AlexR,

    Thank you for the inquiry.

    We can use the following filter in the functions.php file to add the name attribute to the faq schema markup, but it seems not necessary because the tool is not returning any errors.

    add_filter('avf_markup_helper_attributes', 'avf_markup_helper_attributes_modified', 10, 2);
    function avf_markup_helper_attributes_modified($attributes, $args) {
    	if( $args['context'] == 'faq_section' ) {
    	    $attributes['name'] = 'FAQ';
    	}
    	return $attributes;
    }

    Best regards,
    Ismael

    #1295225

    Hi Ismael,
    I have added your code and re-run the Google Rich Results Tests, but without success: It still shows “Unnamed item” for the FAQ for the page specified in the Private Content section.
    Could you please double check?
    Thanks
    Alex

    #1295687

    Hi,

    Looks like the tool fetch the name from the headline element such h1, h2 or any element with the itemprop=”headline” attribute, or from the title element in the head tag. However, according to the structured data documentation, FAQPage does not require a headline, name or title attribute and it does not provide anyway to do so, same as with Breadcrumb element.

    // https://developers.google.com/search/docs/data-types/faqpage#faq-page

    You can actually test the example given in the documentation, and it will still return an unnamed entry.

    // https://search.google.com/test/rich-results?utm_campaign=devsite&utm_medium=microdata&utm_source=faq-page&id=n1WNaQgaitBkOTZE-3F-kw

    Best regards,
    Ismael

    #1295732

    Hi Ismael,
    thank you for this great answer. Seems that the issue is on Google’s side.
    Please feel free to close this question.
    Thank you
    Alex

    #1296025

    Hi,

    No problem. It is possible that not all elements require a name because its type (e.g FAQ, Breadcrumb) already describes the element effectively.

    Please do not hesitate to open another thread if you need anything else. We will close this one for now.

    Have a nice day.

    Best regards,
    Ismael

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘How can I set the name for a FAQPage (accordion element) in rich snippets?’ is closed to new replies.