Skip to content

Add FAQ JSON-LD structured data to a page

seo-in-nextjs provides the JsonLdForFaq component to easily add Breadcrumb JSON-LD structured data to a page.

  1. Import the JsonLdForFaq component into every page where you want to generate the JSON-LD data.

    app/faq/page.tsx
    import { JsonLdForFaq } from "@dlcastillop/seo-in-nextjs";
    export default function FaqPage() {
    return (
    <>
    <JsonLdForFaq
    faqs={[
    {
    question: "What is Next.js?",
    answer:
    "Next.js is a React framework that enables server-side rendering and static site generation.",
    },
    {
    question: "How do I get started with Next.js?",
    answer:
    "You can start by installing Next.js with npm, yarn, or pnpm using the create-next-app command.",
    },
    {
    question: "Is Next.js free to use?",
    answer:
    "Yes, Next.js is open-source and free to use for both personal and commercial projects.",
    },
    ]}
    scriptKey="faq-json-ld"
    />
    <main>
    <h1>Frequently Asked Questions</h1>
    {/* Your content */}
    </main>
    </>
    );
    }
  2. Check the generated JSON-LD by inspecting the body element of your page.

View related API references.