All skills
asyrafhussin avatar

/seo-best-practices

@46bae0b

SEO patterns, conventions, and audit for web applications. Use when implementing meta tags, structured data, Core Web Vitals, sitemaps, Open Graph, auditing SEO, or optimizing pages for search engines. Triggers on "audit SEO", "check SEO", "review SEO", or tasks involving search optimization, schema markup, or social sharing meta tags.

Use this Skill: https://skilld.dev/gh/asyrafhussin/agent-skills/seo-best-practices

This session only. Nothing lands on disk.

rulesschema-faq.md

≈1.5k tokens on demand. Your agent reads this file only when SKILL.md points to it.

FAQ Page Schema Markup

Impact: HIGH (Enables expandable FAQ accordion in Google search results)

FAQPage structured data tells Google your page contains a list of questions and answers, enabling expandable FAQ rich results directly in search. While Google restricted FAQ rich results to well-known authoritative sites in August 2023, the markup still helps search engines understand your content structure and can improve visibility for eligible domains.

Incorrect

<!-- ❌ FAQ content with no structured data — Google shows a plain snippet -->
<div class="faq-section">
  <h2>Frequently Asked Questions</h2>

  <div class="faq-item">
    <h3>What is Laravel?</h3>
    <p>Laravel is a PHP web application framework with expressive, elegant syntax.</p>
  </div>

  <div class="faq-item">
    <h3>Is Laravel free?</h3>
    <p>Yes, Laravel is open-source and free to use under the MIT license.</p>
  </div>

  <div class="faq-item">
    <h3>What PHP version does Laravel 13 require?</h3>
    <p>Laravel 13 requires PHP 8.3 or higher.</p>
  </div>
</div>

Problems:

  • No structured data means Google cannot generate FAQ rich results for this page
  • Search engines must guess which content is a question and which is an answer
  • The page misses the opportunity for expanded SERP real estate with accordion dropdowns
  • Competitors with FAQ schema will occupy more visual space in the same search results

Correct

<!-- ✅ FAQPage schema with mainEntity array of Question/acceptedAnswer pairs -->
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [
    {
      "@type": "Question",
      "name": "What is Laravel?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Laravel is a PHP web application framework with expressive, elegant syntax. It provides tools for routing, authentication, database management, and more, making it one of the most popular frameworks for building modern web applications."
      }
    },
    {
      "@type": "Question",
      "name": "Is Laravel free?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Yes, Laravel is open-source and free to use under the MIT license. You can use it for personal and commercial projects without any licensing fees."
      }
    },
    {
      "@type": "Question",
      "name": "What PHP version does Laravel 13 require?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Laravel 13 requires PHP 8.3 or higher. It is recommended to use the latest stable PHP release for optimal performance and security."
      }
    }
  ]
}
</script>
{{-- ✅ Laravel Blade generating FAQ schema from a $faqs collection --}}
{{-- $faqs is a collection of objects with ->question and ->answer properties --}}

@php
$faqSchema = [
    '@context' => 'https://schema.org',
    '@type' => 'FAQPage',
    'mainEntity' => $faqs->map(fn ($faq) => [
        '@type' => 'Question',
        'name' => $faq->question,
        'acceptedAnswer' => [
            '@type' => 'Answer',
            'text' => strip_tags($faq->answer),
        ],
    ])->values()->all(),
];
@endphp

<script type="application/ld+json">
    {!! json_encode($faqSchema, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT) !!}
</script>

{{-- Visible FAQ content must match the schema --}}
<section class="faq-section">
    <h2>Frequently Asked Questions</h2>
    @foreach ($faqs as $faq)
        <details>
            <summary>{{ $faq->question }}</summary>
            <div>{!! $faq->answer !!}</div>
        </details>
    @endforeach
</section>
// ✅ Inertia/React FAQ page with schema markup
import { Head } from '@inertiajs/react';

interface Faq {
  id: number;
  question: string;
  answer: string;
}

interface FaqPageProps {
  faqs: Faq[];
  title: string;
  description: string;
}

function stripHtml(html: string): string {
  return html.replace(/<[^>]*>/g, '');
}

export default function FaqPage({ faqs, title, description }: FaqPageProps) {
  const faqSchema = {
    '@context': 'https://schema.org',
    '@type': 'FAQPage',
    mainEntity: faqs.map((faq) => ({
      '@type': 'Question',
      name: faq.question,
      acceptedAnswer: {
        '@type': 'Answer',
        text: stripHtml(faq.answer),
      },
    })),
  };

  return (
    <>
      <Head>
        <title>{title}</title>
        <meta head-key="description" name="description" content={description} />
        <script
          type="application/ld+json"
          dangerouslySetInnerHTML={{ __html: JSON.stringify(faqSchema) }}
        />
      </Head>

      <section className="faq-section">
        <h2>Frequently Asked Questions</h2>
        {faqs.map((faq) => (
          <details key={faq.id}>
            <summary>{faq.question}</summary>
            <div dangerouslySetInnerHTML={{ __html: faq.answer }} />
          </details>
        ))}
      </section>
    </>
  );
}

Benefits:

  • FAQPage schema makes the page eligible for expandable FAQ rich results on eligible sites
  • Structured Q&A pairs help Google understand content even when rich results are not displayed
  • The acceptedAnswer.text uses strip_tags to provide clean plaintext for the schema while the visible HTML can use rich formatting
  • Visible FAQ content uses <details>/<summary> elements for native accordion behavior, matching the schema content

Note: Since the August 2023 update, Google only shows FAQ rich results for well-known, authoritative government and health websites. However, FAQPage markup still helps Google understand your content structure and may influence how snippets are generated. The markup remains valid and recommended by Google's documentation.

Reference: Google Search Central - FAQ Structured Data

Source: SKILL.md on GitHub

1 warning16d4 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    The skill is a comprehensive SEO reference and audit tool for React and Laravel applications. It provides detailed patterns for optimizing Core Web Vitals, technical SEO, and structured data. No malicious code, obfuscation, or data exfiltration patterns were identified. The skill is designed to analyze project code and provide structural feedback based on a predefined checklist.

  • Socket16d

    5 alerts: gptAnomaly

  • Snyk16d

    Risk: LOW · No issues

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 46bae0b. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last month.

Steadyupdated 6 months ago
metadata
{
  "author": "agent-skills",
  "version": "1.2.0"
}

README badge

README badge for asyrafhussin/agent-skills/seo-best-practices