Duplicate rich results and too many showing

Topic summary

Issue: FAQ schema markup on a Shopify product page is executing twice and unintentionally including non-FAQ collapsible rows.

Context: Using the Tinker theme. A product URL and a Codeshare link were provided along with console debug logs.

Evidence:

  • Logs show “FAQ script running” twice, “Found details elements: 10,” and “FAQ JSON-LD script injected. Total FAQs: 10.”
  • Captured items include non-FAQ content like “:clipboard: Specifications,” “:shield: 1-Year Warranty,” and “:credit_card: 30-Day Money-Back Guarantee,” plus actual FAQs (e.g., “Is this tennis bracelet adjustable?”).

Likely cause:

  • The script is included or bound twice (e.g., in multiple sections/templates), creating duplicate JSON-LD.
  • The selector targets generic
    elements, so it picks up all collapsible rows, not just the FAQ section.

Impact: Potential duplicate rich results in search and inaccurate FAQ content surfaced to Google.

Requested outcome: Limit schema generation to the dedicated FAQ section and ensure only one JSON-LD injection.

Action items:

  • Verify the script is included once per page.
  • Scope selectors to an FAQ container or specific identifiers.
  • Re-test and check console for a single run and correct FAQ count.

Notes: Code and logs are central to diagnosing; terms: JSON-LD (structured data format) and FAQ rich results (Google search enhancements).

Status: No resolution yet; discussion remains open.

Summarized with AI on December 24. AI used: gpt-5.

Hello, I’m trying to add FAQ schema markup to my theme, from my frequently asked questions section, but its executing twice and its also taking my other collapsible rows into account apart from just my FAQ’s section: Faq is below on URL: Tennis Bracelet Women | 925 Sterling Silver Classic Tennis Bracelet – LIORÉNNA
I’m using Tinker theme.

Code: Dec 24 2:20 PM - Codeshare
Debugs:

FAQ script running.
tennis-bracelet-women-925-sterling-silver?_pos=1&_psq=tennis&_ss=e&_v=1.0:8250 Found details elements: 10
tennis-bracelet-women-925-sterling-silver?_pos=1&_psq=tennis&_ss=e&_v=1.0:8258 FAQ #1: {question: '📋 Specifications', answerText: 'Material: 925 Sterling SilverColor: SilverStyle: C…: Signature LIORÉNNA Gift box (100 × 100 × 20 mm)'}
tennis-bracelet-women-925-sterling-silver?_pos=1&_psq=tennis&_ss=e&_v=1.0:8258 FAQ #2: {question: '🛡️ 1-Year Warranty', answerText: 'Worried about defects? No problem! Every piece of …photo of the issue — we’ll take care of the rest!'}
tennis-bracelet-women-925-sterling-silver?_pos=1&_psq=tennis&_ss=e&_v=1.0:8258 FAQ #3: {question: '💳 30-Day Money-Back Guarantee', answerText: 'Not in love with your jewelry? No worries! We offe…and details, or contact us — we’re happy to help!'}
tennis-bracelet-women-925-sterling-silver?_pos=1&_psq=tennis&_ss=e&_v=1.0:8258 FAQ #4: {question: 'Is this tennis bracelet adjustable?', answerText: 'Yes, it features a secure clasp and a lightweight profile suitable for most wrist sizes.'}
tennis-bracelet-women-925-sterling-silver?_pos=1&_psq=tennis&_ss=e&_v=1.0:8258 FAQ #5: {question: 'What material is this tennis bracelet made from?', answerText: 'This bracelet is crafted from high-quality 925 ste…polished finish for lasting shine and durability.'}
tennis-bracelet-women-925-sterling-silver?_pos=1&_psq=tennis&_ss=e&_v=1.0:8258 FAQ #6: {question: 'Is it suitable for everyday wear?', answerText: 'Yes! Its slim, elegant design is lightweight and c…ble, perfect for daily wear or special occasions.'}
tennis-bracelet-women-925-sterling-silver?_pos=1&_psq=tennis&_ss=e&_v=1.0:8258 FAQ #7: {question: 'Will the bracelet tarnish or cause skin discoloration?', answerText: 'No — it’s made from premium 925 sterling silver th…intains its shine and won’t turn your skin green.'}
tennis-bracelet-women-925-sterling-silver?_pos=1&_psq=tennis&_ss=e&_v=1.0:8258 FAQ #8: {question: 'Can this bracelet be worn in the shower or while swimming?', answerText: 'To preserve its shine, we recommend removing it before swimming or showering.'}
tennis-bracelet-women-925-sterling-silver?_pos=1&_psq=tennis&_ss=e&_v=1.0:8258 FAQ #9: {question: 'Is it adjustable or suitable for different wrist sizes?', answerText: 'The bracelet features a secure clasp and a lightwe…file, making it fit most wrist sizes comfortably.'}
tennis-bracelet-women-925-sterling-silver?_pos=1&_psq=tennis&_ss=e&_v=1.0:8258 FAQ #10: {question: 'Does it come in a gift box?', answerText: 'Yes — it comes in a premium LIORÉNNA gift box, mak…r birthdays, anniversaries, or special occasions.'}
tennis-bracelet-women-925-sterling-silver?_pos=1&_psq=tennis&_ss=e&_v=1.0:8285 FAQ JSON-LD script injected. Total FAQs: 10
tennis-bracelet-women-925-sterling-silver?_pos=1&_psq=tennis&_ss=e&_v=1.0:16493 FAQ script running.
tennis-bracelet-women-925-sterling-silver?_pos=1&_psq=tennis&_ss=e&_v=1.0:16497 Found details elements: 10
tennis-bracelet-women-925-sterling-silver?_pos=1&_psq=tennis&_ss=e&_v=1.0:16505 FAQ #1: {question: '📋 Specifications', answerText: 'Material: 925 Sterling SilverColor: SilverStyle: C…: Signature LIORÉNNA Gift box (100 × 100 × 20 mm)'}
tennis-bracelet-women-925-sterling-silver?_pos=1&_psq=tennis&_ss=e&_v=1.0:16505 FAQ #2: {question: '🛡️ 1-Year Warranty', answerText: 'Worried about defects? No problem! Every piece of …photo of the issue — we’ll take care of the rest!'}
tennis-bracelet-women-925-sterling-silver?_pos=1&_psq=tennis&_ss=e&_v=1.0:16505 FAQ #3: {question: '💳 30-Day Money-Back Guarantee', answerText: 'Not in love with your jewelry? No worries! We offe…and details, or contact us — we’re happy to help!'}
tennis-bracelet-women-925-sterling-silver?_pos=1&_psq=tennis&_ss=e&_v=1.0:16505 FAQ #4: {question: 'Is this tennis bracelet adjustable?', answerText: 'Yes, it features a secure clasp and a lightweight profile suitable for most wrist sizes.'}
tennis-bracelet-women-925-sterling-silver?_pos=1&_psq=tennis&_ss=e&_v=1.0:16505 FAQ #5: {question: 'What material is this tennis bracelet made from?', answerText: 'This bracelet is crafted from high-quality 925 ste…polished finish for lasting shine and durability.'}
tennis-bracelet-women-925-sterling-silver?_pos=1&_psq=tennis&_ss=e&_v=1.0:16505 FAQ #6: {question: 'Is it suitable for everyday wear?', answerText: 'Yes! Its slim, elegant design is lightweight and c…ble, perfect for daily wear or special occasions.'}
tennis-bracelet-women-925-sterling-silver?_pos=1&_psq=tennis&_ss=e&_v=1.0:16505 FAQ #7: {question: 'Will the bracelet tarnish or cause skin discoloration?', answerText: 'No — it’s made from premium 925 sterling silver th…intains its shine and won’t turn your skin green.'}
tennis-bracelet-women-925-sterling-silver?_pos=1&_psq=tennis&_ss=e&_v=1.0:16505 FAQ #8: {question: 'Can this bracelet be worn in the shower or while swimming?', answerText: 'To preserve its shine, we recommend removing it before swimming or showering.'}
tennis-bracelet-women-925-sterling-silver?_pos=1&_psq=tennis&_ss=e&_v=1.0:16505 FAQ #9: {question: 'Is it adjustable or suitable for different wrist sizes?', answerText: 'The bracelet features a secure clasp and a lightwe…file, making it fit most wrist sizes comfortably.'}
tennis-bracelet-women-925-sterling-silver?_pos=1&_psq=tennis&_ss=e&_v=1.0:16505 FAQ #10: {question: 'Does it come in a gift box?', answerText: 'Yes — it comes in a premium LIORÉNNA gift box, mak…r birthdays, anniversaries, or special occasions.'}
tennis-bracelet-women-925-sterling-silver?_pos=1&_psq=tennis&_ss=e&_v=1.0:16532 FAQ JSON-LD script injected. Total FAQs: 10

Rich results test: ‘Dubble Field ‘FAQPage‘‘


So the code is executing twice, and it’s adding my collapsible rows while it should only add my FAQ questions.

Does anyone please know how to fix this? Thanks in advance!

@TrendBlend the issue is that your script is being inserted twice in the page, once after the accordions in the buy box (Specifications, 1-year Warranty, 30-Day Money-Back Guarantee), and once after the actual FAQ section. This is why the schema is being added twice.

Additionally the script is selecting all accordions in the page, not only the ones in the FAQ section.

Try updating your code as follows:

<script>
  document.addEventListener("DOMContentLoaded", function() {
    console.log("FAQ script running.");

    // Check if FAQ schema already exists
    const existingSchemas = document.querySelectorAll('script[type="application/ld+json"]');
    for (const schema of existingSchemas) {
      try {
        const data = JSON.parse(schema.textContent);
        if (data["@type"] === "FAQPage") {
          console.log("FAQ JSON-LD schema already exists. Skipping.");
          return;
        }
      } catch (e) {
        // Ignore parsing errors
      }
    }

    const faqItems = [];
    // Get all .details elements, then filter out those inside .product-information
    const allDetails = document.querySelectorAll('.accordion .details');
    const detailsList = Array.from(allDetails).filter(detail => !detail.closest('.product-information'));
    
    console.log("Found details elements:", detailsList.length);
    detailsList.forEach((detail, index) => {
      const question = detail.dataset.faqQuestion?.trim();
      const answerEl = detail.querySelector('[data-faq-answer] rte-formatter');
      const answerText = answerEl?.textContent?.replace(/\s+/g, ' ').trim() || "";
      console.log(`FAQ #${index + 1}:`, { question, answerText });
      if (!question || !answerText) {
        console.log(`Skipping FAQ #${index + 1}. Missing question or answer.`, { question, answerText });
        return;
      }
      faqItems.push({
        "@type": "Question",
        "name": question,
        "acceptedAnswer": {
          "@type": "Answer",
          "text": answerText
        }
      });
    });
    if (faqItems.length > 0) {
      const script = document.createElement('script');
      script.type = 'application/ld+json';
      script.text = JSON.stringify({
        "@context": "https://schema.org",
        "@type": "FAQPage",
        "mainEntity": faqItems
      }, null, 2);
      document.head.appendChild(script);
      console.log("FAQ JSON-LD script injected. Total FAQs:", faqItems.length);
    } else {
      console.log("No FAQ items found. JSON-LD script was not created.");
    }
  });
</script>

This code first checks if the FAQ ld+json schema already exists in the page, if it does then it doesn’t run, this should fix the duplication issue.

Also it makes sure to not pick accordions that are inside the product information section, which means only the ones inside the “Frequently asked questions” section will be picked.

1 Like

Hello @StackingContext ,

Thanks for your quick respond, I really appreciate it. I see your code displays the correct FAQ’s in console and executes once instead of twice. But suddenly I get this error when I do a rich results test. Do you by any chance know why this is happening?

FAQ are correctly displayed in console and skipped 2nd time

Kind regards,
Stef

Hi @TrendBlend ,

Can you double check if the issue is still happening? On a quick glance I didn’t notice any errors with your schemas so I went ahead and ran the Google Rich Results Test with the same URL you had in your screenshot and see no errors there as well

Hello @StackingContext , the problem is that in Test voor uitgebreide resultaten - Google Search Console, the FAQ are not displayed or they are displayed with an error. While the FAQ’s do now correctly show in console. And the FAQ’s are on the page Tennis Bracelet Women | 925 Sterling Silver Classic Tennis Bracelet – LIORÉNNA