Shopify FAQ Section Generator

A zero-JavaScript FAQ accordion, with optional FAQPage structured data.

Describe the result you need. AI will set up the tool and ask for any missing details.

Configure with AI

Enter to submit · Shift + Enter for a new line

Sent to AI. Leave out passwords and private customer data.

Your details

Content

These become the section's starter blocks. Store staff can edit, add or remove questions afterward in the theme editor.

Behavior

Can make questions eligible for an expandable result in Google Search. Not guaranteed.

Your section file (sections/faq-section.liquid)

faq-section.liquid
{%- comment -%}
  FAQ accordion, built on native <details>/<summary> (no JavaScript needed for the basic open/close behavior).
{%- endcomment -%}
{%- if section.blocks.size > 0 -%}
  {%- style -%}
  .ea-faq{max-width:760px;margin:0 auto}
  .ea-faq__heading{font-size:1.5em;margin:0 0 1rem}
  .ea-faq__list{display:flex;flex-direction:column;gap:.5rem}
  .ea-faq__item{border:1px solid #e5e5e5;border-radius:8px;padding:0}
  .ea-faq__item>summary{cursor:pointer;padding:.9em 1.1em;font-weight:600;list-style:none}
  .ea-faq__item>summary::-webkit-details-marker{display:none}
  .ea-faq__item>summary::after{content:'+';float:right;font-weight:400}
  .ea-faq__item[open]>summary::after{content:'−'}
  .ea-faq__a{padding:0 1.1em 1em;color:#444;line-height:1.5}
  .ea-faq__a p{margin:0 0 .6em}
  {%- endstyle -%}
  <div class="ea-faq">
    <h2 class="ea-faq__heading">{{ section.settings.heading | escape }}</h2>
    <div class="ea-faq__list">
      {%- for block in section.blocks -%}
        <details class="ea-faq__item"{% if section.settings.open_first and forloop.first %} open{% endif %} {{ block.shopify_attributes }}>
          <summary class="ea-faq__q">{{ block.settings.question | escape }}</summary>
          <div class="ea-faq__a">{{ block.settings.answer }}</div>
        </details>
      {%- endfor -%}
    </div>
  </div>
  {%- if section.settings.add_schema -%}
    <script type="application/ld+json">
    {
      "@context": "https://schema.org",
      "@type": "FAQPage",
      "mainEntity": [
        {%- for block in section.blocks -%}
          {
            "@type": "Question",
            "name": {{ block.settings.question | strip_newlines | strip_html | json }},
            "acceptedAnswer": { "@type": "Answer", "text": {{ block.settings.answer | strip_newlines | strip_html | json }} }
          }{% unless forloop.last %},{% endunless %}
        {%- endfor -%}
      ]
    }
    </script>
  {%- endif -%}
  {%- if section.settings.only_one_open -%}
    <script>
      document.querySelectorAll('.ea-faq').forEach(function (wrap) {
        wrap.querySelectorAll('.ea-faq__item').forEach(function (item) {
          item.addEventListener('toggle', function () {
            if (!item.open) return;
            wrap.querySelectorAll('.ea-faq__item').forEach(function (other) { if (other !== item) other.open = false; });
          });
        });
      });
    </script>
  {%- endif -%}
{%- endif -%}

{% schema %}
{
  "name": "FAQ section",
  "tag": "section",
  "class": "ea-faq-section",
  "max_blocks": 30,
  "settings": [
    {
      "type": "text",
      "id": "heading",
      "label": "Heading",
      "default": "Frequently asked questions"
    },
    {
      "type": "checkbox",
      "id": "open_first",
      "label": "Open the first question by default",
      "default": false
    },
    {
      "type": "checkbox",
      "id": "only_one_open",
      "label": "Close other questions when one opens",
      "default": true
    },
    {
      "type": "checkbox",
      "id": "add_schema",
      "label": "Add FAQPage structured data",
      "default": true,
      "info": "Can make questions eligible for an expandable result in Google Search."
    }
  ],
  "blocks": [
    {
      "type": "question",
      "name": "Question",
      "settings": [
        {
          "type": "text",
          "id": "question",
          "label": "Question",
          "default": "Question"
        },
        {
          "type": "richtext",
          "id": "answer",
          "label": "Answer",
          "default": "<p>Answer</p>"
        }
      ]
    }
  ],
  "presets": [
    {
      "name": "FAQ section",
      "blocks": [
        {
          "type": "question",
          "settings": {
            "question": "Do you ship internationally?",
            "answer": "<p>Yes, we ship to over 30 countries. Rates are calculated at checkout.</p>"
          }
        },
        {
          "type": "question",
          "settings": {
            "question": "What's your return window?",
            "answer": "<p>30 days from delivery, unworn and with tags attached.</p>"
          }
        },
        {
          "type": "question",
          "settings": {
            "question": "How do I track my order?",
            "answer": "<p>You&#39;ll get a tracking link by email as soon as it ships.</p>"
          }
        }
      ]
    }
  ]
}
{% endschema %}

To install: in Shopify admin go to Online Store → Themes, click … next to your theme → Edit code. Under Sections choose Add a new section, name it as shown above, replace the contents with this code and save. Then open Customize and add the section where you want it. Try it on a duplicate of your theme first. Works well on its own page or added to your product template.

Live preview

Built on <details>, not JavaScript

The accordion uses native HTML <details> and <summary> elements, which browsers already know how to expand, collapse and make keyboard- and screen-reader-accessible, with no JavaScript required for the basic behavior. A small script only handles the optional "close other questions when one opens" behavior.

Each question is its own block in Shopify's theme editor, so store staff can add, remove and reorder questions without touching code. Turn on FAQPage structured data to also output the matching JSON-LD, which can make your questions eligible for an expandable FAQ result in Google Search.

Adding it to your theme

  1. 01

    Add the section

    Online Store → Themes → Edit code → Sections → Add a new section named faq-section, paste the code, then add it to a page (like an FAQ page) or your product template in Customize, and add question blocks there.

Questions people ask

Will Google definitely show my FAQ in search results?

Structured data makes you eligible, it doesn't guarantee the rich result appears; Google decides when to show it. Google has also scaled back which sites qualify for FAQ rich results over time, so treat this as a bonus, not a guaranteed win.

Can I use this on more than one page?

Yes, add the section to as many pages or templates as you like; each instance has its own set of question blocks.

Does the rich text answer field support formatting?

Yes, bold, italic, links and lists all work in the answer field and render in the accordion. For the structured data version, formatting is stripped since Google expects plain text there.

Want this builtinto your store?

I'm Emmanuel, a Shopify and WooCommerce developer. If this tool pointed at something you'd rather have fixed for you (a faster store, cleaner product data, a migration, a custom feature), send me a note.

Emmanuel Asika

Emmanuel Asika

Shopify & WooCommerce developer, Dublin

I build and fix online stores: new builds, migrations, speed, SEO and the custom bits apps can't do.

hello@emmanuelasika.com

Last reviewed 30 September 2026.