Skip to content
PN Scripts

Open source

FAQ sections that search engines understand

  • PN Scripts Team
  • 6 min read

An FAQ section that search engines understand answers questions real customers ask, puts the direct answer in the first sentence, and shows every question and answer as text on the page. Where it helps, the same content is described with FAQPage structured data that matches the visible text word for word. Google now shows FAQ rich results only for a limited group of sites, so write the section for readers and answer engines first, and treat any rich result as a bonus.

#Start from questions customers actually ask

The best FAQ questions come from people who have already contacted you. Invented questions read like advertising, and nobody searches for them. Sources worth checking:

  • Your inbox and contact form: the questions sales and support answer every week.
  • Chat logs and call notes, including the exact words customers use.
  • The search box on your own site, if it logs queries.
  • Google Search Console, which shows the queries your pages already appear for.
  • Reviews and comments, where people mention what confused them.

Keep the customer's wording in the question. If buyers ask "Can I pay by bank transfer?", do not rewrite it as "Which payment methods are supported?". Keep each FAQ on the page it belongs to: delivery questions on the delivery page, pricing questions next to prices. Review the list when something changes, and delete questions that no longer apply. An FAQ goes stale like any other content.

#Write answers that can be quoted

Search features and AI answer engines lift short passages out of a page. A passage is useful to them only if it makes sense on its own, so write each answer with the answer in its first sentence:

  • Answer first. Start with "Yes", "No" or the fact itself, then give the conditions, then the details.
  • Repeat the subject. Write "The plugin needs WordPress 6.0 or newer", not "It needs 6.0". The sentence may be read without the question above it.
  • One question per item. Split compound questions so each answer stays short.
  • Be specific. Name versions, conditions and steps. If the honest answer is "it depends", say what it depends on.
  • Link to the full page when an answer needs more than a short paragraph, so the FAQ does not turn into a manual.

Avoid answers that only say "Contact us". They give a reader nothing to act on and give a search engine nothing to quote.

#FAQPage structured data that matches the page

Structured data is machine-readable markup, usually JSON-LD inside a <script type="application/ld+json"> tag, that tells search engines what a page contains. For an FAQ, schema.org defines the FAQPage type: a list of Question items, each with an acceptedAnswer of type Answer.

The rules that matter most:

  • Mark up only visible content. Every question and answer in the JSON-LD must appear on the page with the same wording. Extra or hidden questions in the markup go against Google's guidelines.
  • Use FAQPage only for questions the site answers itself. Pages where users post questions and answers, such as forums, use the QAPage type.
  • Generate the markup from the same data as the page. If the accordion and the JSON-LD both come from one list of questions in the CMS, they cannot drift apart when an editor changes an answer.
  • Validate it. Google's Rich Results Test and the Schema Markup Validator show errors before you publish.

Google has limited FAQ rich results, the expandable questions under a search listing, to a small set of well-known, authoritative sites, mainly government and health sites. Most business sites will not get that display. The markup still describes the page clearly to any system that reads it, and it costs little when it is generated from data you already have. The rules have changed before, so check Google's current documentation on FAQ structured data before you plan around it.

#Accessible accordion markup

Most FAQ sections are accordions: the questions stay visible and each answer opens on request. Built badly, an accordion hides content from keyboard and screen reader users. Built well, it helps everyone. The usual pattern:

  • Each question is a real <button> inside a heading at the right level, so it can be reached with Tab and opened with Enter or Space.
  • The button carries aria-expanded, set to true or false as it opens and closes, and aria-controls pointing at the answer's id.
  • The answer panel can carry role="region" with aria-labelledby pointing back at its button.
  • Focus styles stay visible. Do not remove the outline without a clear replacement.

The native <details> and <summary> elements give you a working disclosure with no JavaScript at all, which is a good choice for simple pages. Whichever you use, put the answer text in the HTML when the page loads. Answers fetched only after a click may never be read by crawlers, and they disappear if a script fails. Opening the first item by default helps when the first answer is the one most visitors need.

#Two free plugins as examples

PN Scripts publishes two small FAQ accordions under the MIT license, both free on GitHub.

PN FAQ Accordion for WordPress adds an faq_item post type, where the question is the title and the answer is the content, and a [pnscripts_faq] shortcode that renders the accordion in any page or post. It renders real buttons and regions in vanilla JavaScript with no jQuery, opens the first item by default, and needs WordPress 6.0 or newer on PHP 8.1 or newer. It has no page builder or shop code, and it works without WooCommerce.

Filament FAQ Accordion is the same accordion for Laravel 13 and Filament 5, on PHP 8.3 or newer. A FaqList form field stores question and answer rows on any Filament resource and drops rows left blank, and a Blade component renders the accordion on the public site. It uses Alpine when the page already loads it and falls back to vanilla JavaScript. If you are still choosing an admin for a Laravel project, our article on Filament or a custom admin panel covers that decision.

Both plugins keep the questions in one editable list. If you also want FAQPage markup, generate it in your template from that same list, so the page and the structured data always agree.

#How PN Scripts can help

PN FAQ Accordion is free to download, and PN Scripts can adapt it for your project, for example to match your theme or to output structured data from your FAQ items. Requirements, setup steps and the GitHub link are on the PN FAQ Accordion for WordPress page.

Keep reading

Keep reading

Comments

Comments

Be the first to leave a comment.

Leave a comment

Next step

pnscripts.com/contact

Talk to the team

Ask about an article, or tell us about a project you want built. We reply within one business day.

Write to us

The PN Scripts family

Other PN Scripts sites

Hosting, games and the blog each have their own site, run by the same company.

  • pnscripts.com

    PN Scripts

    Software engineering

    Custom web, mobile, API and game development, plus our open-source products and plugins.

  • games.pnscripts.com

    Games

    Games and game servers

    The home for PN Scripts games and game servers. The catalog is empty for now and fills up as titles and servers go live.

  • hosting.pnscripts.com

    Hosting

    Hosting and infrastructure

    Shared hosting, KVM VPS, dedicated servers and domains, from the same company that builds your project.

  • blog.pnscripts.com

    Blog

    Articles and field notes

    Plain articles on hosting, servers, domains and security, written by the people who work with them.

    You are here