Skip to content

Search Engine Optimization

Atlas Gong edited this page Feb 7, 2025 · 2 revisions

Search Engine Optimization (SEO)

Pages

SEO titles and meta descriptions for each page are pulled from Payload's Pages collection.

Metadata is exported as such in each page's code:

import { Metadata } from "next";
import { getPageFromCMS } from "@/lib/getPageFromCMS";

export async function generateMetadata(): Promise<Metadata> {
    const page = await getPageFromCMS("page-slug-here");
    return {
        ...(page && {
            title: page.title,
            description: page.seoDescription,
        }),
    };
}

Clubs & Resources

SEO title and description are respectively pulled from the title and description fields of Payload's Clubs or Resources collection.

Clone this wiki locally