1

We want to add featured snippets in the form of FAQPage using JSON-LD format. Using the "See Markup" link on the FAQPage outlined from Google's page, we are able to get a sample featured snippet below. This seems to imply that all questions for the page should be in one <script> tag.

We ran the following through Google's Structured Data Testing Tool and Rich Results tool and it returned zero errors. However, there is no mention of it being all in one script tag.

Question

If we are to use FAQPage featured snippets, what is the correct variant we need to use (1 or 2)?

What we tried

Variant 1 - Has all the questions in one script tag:

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [{
    "@type": "Question",
    "name": "What is the return policy?",
    "acceptedAnswer": {
      "@type": "Answer",
      "text": "Most unopened items in new condition and returned within <strong>90 days</strong> will receive a refund or exchange. Some items have a modified return policy noted on the receipt or packing slip. Items that are opened or damaged or do not have a receipt may be denied a refund or exchange. Items purchased online or in-store may be returned to any store.<br /><p>Online purchases may be returned via a major parcel carrier. <a href='http://example.com/returns'> Click here </a> to initiate a return.</p>"
    }
  }, {
    "@type": "Question",
    "name": "Will I be charged sales tax for online orders?",
    "acceptedAnswer": {
      "@type": "Answer",
      "text":"Local and State sales tax will be collected if your recipient's mailing address is in: <ul><li>Arizona</li><li>California</li><li>Colorado</li></ul>"}
    }]
  }
</script>

Variant 2 - Each question is separated into different script tags:

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": {
    "@type": "Question",
    "name": "What is the return policy?",
    "acceptedAnswer": {
      "@type": "Answer",
      "text": "Most unopened items in new condition and returned within <strong>90 days</strong> will receive a refund or exchange. Some items have a modified return policy noted on the receipt or packing slip. Items that are opened or damaged or do not have a receipt may be denied a refund or exchange. Items purchased online or in-store may be returned to any store.<br /><p>Online purchases may be returned via a major parcel carrier. <a href='http://example.com/returns'> Click here </a> to initiate a return.</p>"
    }
  }
}
</script>
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": {
    "@type": "Question",
    "name": "Will I be charged sales tax for online orders?",
    "acceptedAnswer": {
      "@type": "Answer",
      "text": "Local and State sales tax will be collected if your recipient's mailing address is in: <ul><li>Arizona</li><li>California</li><li>Colorado</li></ul>"
    }
  }
}
</script>
unor
  • 92,415
  • 26
  • 211
  • 360
usernameabc
  • 662
  • 1
  • 10
  • 30

2 Answers2

5

You can use as many script elements as you want, but you need to convey that the FAQPage items are the same. You do this by giving them the same URI (in @id).

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "@id": "/faq",
  "mainEntity": {
    "@type": "Question",
    "name": "What is the return policy?"
  }
}
</script>

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "@id": "/faq",
  "mainEntity": {
    "@type": "Question",
    "name": "Will I be charged sales tax for online orders?"
  }
}
</script>

Instead of repeating the FAQPage in each script element, you could define it only once and reference each question (via its @id):

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "@id": "/faq",
  "mainEntity": [
    {"@id": "/faq#1"},
    {"@id": "/faq#2"}
  ]
}
</script>

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Question",
  "@id": "/faq#1",
  "name": "What is the return policy?"
}
</script>

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Question",
  "@id": "/faq#2",
  "name": "Will I be charged sales tax for online orders?"
}
</script>

(You might be able to use mainEntityOfPage instead, if you don’t want to list all questions from within the FAQPage. Google’s documentation doesn’t mention it, though. Another alternative is to use @reverse.)


You didn’t explain why you want to use multiple script elements. Maybe it could work for your case if you use one script element, but with multiple top-level items (using @graph).

unor
  • 92,415
  • 26
  • 211
  • 360
0

The guide of Google for FAQ Page tells us:

A Frequently Asked Question (FAQ) page contains a list of questions and answers pertaining to a particular topic.

Only use FAQPage if your page has a list of questions with answers.

Also in this guide is the following example:

{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [{
    "@type": "Question",
    "name": "What is the return policy?",
    "acceptedAnswer": {
      "@type": "Answer",
      "text": "Most unopened items in new condition and returned within <strong>90 days</strong> will receive a refund or exchange. Some items have a modified return policy noted on the receipt or packing slip. Items that are opened or damaged or do not have a receipt may be denied a refund or exchange. Items purchased online or in-store may be returned to any store.<br /><p>Online purchases may be returned via a major parcel carrier. <a href='http://example.com/returns'> Click here </a> to initiate a return.</p>"
    }
  }, {
    "@type": "Question",
    "name": "How long does it take to process a refund?",
    "acceptedAnswer": {
      "@type": "Answer",
      "text": "We will reimburse you for returned items in the same way you paid for them. For example, any amounts deducted from a gift card will be credited back to a gift card. For returns by mail, once we receive your return, we will process it within 4–5 business days. It may take up to 7 days after we process the return to reflect in your account, depending on your financial institution's processing time."
    }
  }, {
    "@type": "Question",
    "name": "What is the policy for late/non-delivery of items ordered online?",
    "acceptedAnswer": {
      "@type": "Answer",
      "text": "Our local teams work diligently to make sure that your order arrives on time, within our normaldelivery hours of 9AM to 8PM in the recipient's time zone. During  busy holiday periods like Christmas, Valentine's and Mother's Day, we may extend our delivery hours before 9AM and after 8PM to ensure that all gifts are delivered on time. If for any reason your gift does not arrive on time, our dedicated Customer Service agents will do everything they can to help successfully resolve your issue. <br/> <p><a href='https://example.com/orders/'>Click here</a> to complete the form with your order-related question(s).</p>"
    }
  }, {
    "@type": "Question",
    "name": "When will my credit card be charged?",
    "acceptedAnswer": {
      "@type": "Answer",
      "text": "We'll attempt to securely charge your credit card at the point of purchase online. If there's a problem, you'll be notified on the spot and prompted to use another card. Once we receive verification of sufficient funds, your payment will be completed and transferred securely to us. Your account will be charged in 24 to 48 hours."
    }
  }, {
    "@type": "Question",
    "name": "Will I be charged sales tax for online orders?",
    "acceptedAnswer": {
      "@type": "Answer",
      "text":"Local and State sales tax will be collected if your recipient's mailing address is in: <ul><li>Arizona</li><li>California</li><li>Colorado</li></ul>"}
    }]
  }

Thus, the answer to your question may be the following: use the first of the options you specified and create full compliance your data to the specified Google guide.

nikant25
  • 814
  • 5
  • 10