N
Nuxt5mo ago
yashwp

FAQ schema is considered as Question schema

I have a web page on my site for a blog, it has FAQs too at the end of the page, and hence, need to insert FAQ schema for the same. When I used the code snippet below, the schema.org site did not detect any FAQ schema only (please check screenshot 1). I'm using @unhead/schema-org package
useSchemaOrg([
defineWebPage({
'@type': 'FAQPage',
}),
defineArticle({
'@type': category === 'news' ? 'NewsArticle' : 'BlogPosting',
headline: post?.value?.yoast_head_json?.title,
image: post.value?.jetpack_featured_media_url,
datePublished: post.value?.date,
dateModified: post.value?.modified,
author: {
name: post.value?._embedded?.author[0]?.name
}
}),
...blogFaqs.value?.map((s: any) => defineQuestion({ name: s.name, acceptedAnswer: s.acceptedAnswer.text }))
]);
useSchemaOrg([
defineWebPage({
'@type': 'FAQPage',
}),
defineArticle({
'@type': category === 'news' ? 'NewsArticle' : 'BlogPosting',
headline: post?.value?.yoast_head_json?.title,
image: post.value?.jetpack_featured_media_url,
datePublished: post.value?.date,
dateModified: post.value?.modified,
author: {
name: post.value?._embedded?.author[0]?.name
}
}),
...blogFaqs.value?.map((s: any) => defineQuestion({ name: s.name, acceptedAnswer: s.acceptedAnswer.text }))
]);
If I remove defineWebPage from the code, the site is detecting schema but as Questions and not as FAQ schema. Please check screenshot 2.
defineWebPage({
'@type': 'FAQPage',
}),
defineWebPage({
'@type': 'FAQPage',
}),
No description
No description
7 Replies
harlan
harlan5mo ago
Can you share the output? Also please only test with https://search.google.com/test/rich-results
harlan
harlan5mo ago
I'd recommend using the module if you're not already https://github.com/harlan-zw/nuxt-schema-org
GitHub
GitHub - harlan-zw/nuxt-schema-org: The quickest and easiest way to...
The quickest and easiest way to build Schema.org graphs for Nuxt. - harlan-zw/nuxt-schema-org
yashwp
yashwpOP5mo ago
Hi @harlan , I'm using the below packages. I tried to visit - https://nuxtseo.com/schema-org/getting-started/installation, Seems broken.
"@unhead/schema-org": "^1.9.14",
"nuxt-schema-org": "^3.3.8",
"@unhead/schema-org": "^1.9.14",
"nuxt-schema-org": "^3.3.8",
Also, I used rich-results link to test the code: I'm getting below error. How do I fix this?
No description
harlan
harlan5mo ago
can you share the entire schema.org output if possible? i need to replicate it and I can fix you shouldn't need this as an explicit dep @unhead/schema-org
yashwp
yashwpOP5mo ago
Not sure, how to extract the whole output, but here is the URL - https://validator.schema.org/#url=https%3A%2F%2Fstackwealth.in%2Fblog%2Fmutual-funds%2Fppf-vs-mutual-funds That gives the output of whole schema. Please check. Let me know if the above link is helpful in case
harlan
harlan5mo ago
seems fine
No description
harlan
harlan5mo ago
keep in mind that each page should only have one main schema.org node
Want results from more Discord servers?
Add your server