Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 40 additions & 1 deletion fern/products/docs/pages/seo/metadata.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,51 @@ title: Configure SEO metadata
description: Configure SEO metadata at the page or site level.
---

Configure SEO metadata at the page or site level to improve search visibility and social media previews for your documentation. Keep titles between 50-60 characters and descriptions between 150-160 characters for optimal display.
Fern automatically generates SEO metadata for every page in your documentation site. You can configure default metadata at the site level and override it on individual pages to improve search visibility and social media previews. Keep titles between 50-60 characters and descriptions between 150-160 characters for optimal display.

<Note>
The metadata configurations on this page are for SEO and social tags that aren't visible to users. For visible footer links, see [footer links configuration](/learn/docs/configuration/what-is-docs-yml#footer-links-configuration).
</Note>

## What Fern auto-generates
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [vale] reported by reviewdog 🐶
[Microsoft.Auto] In general, don't hyphenate 'auto-generates'.


Fern automatically generates the following SEO metadata for every page in your documentation:

**HTML meta tags:**
- `<title>` tag with site-wide suffix (e.g., "Page Title | Your Site Name")
- Meta description tag (from `description`, `subtitle`, or `excerpt` fields)
- Meta keywords tag (when keywords are provided)
- Canonical URL (automatically constructed from page slug or custom override)
- Robots meta tags (noindex/nofollow when configured)
- Favicon link tag

**Open Graph tags for social media:**
- `og:title` - Title shown in social media previews
- `og:description` - Description shown in social media previews
- `og:image` - Image shown in social media previews
- `og:url` - Canonical URL of the page
- `og:site_name` - Name of your website
- `og:locale` - Content locale (e.g., "en_US")
- `og:image:width` and `og:image:height` - Image dimensions

**Twitter Card tags:**
- `twitter:title` - Title shown in Twitter previews
- `twitter:description` - Description shown in Twitter previews
- `twitter:image` - Image shown in Twitter previews
- `twitter:site` - Twitter handle for your website
- `twitter:creator` - Twitter handle of the content creator
- `twitter:card` - Card type (e.g., "summary_large_image")

**Intelligent fallback system:**

Fern uses a three-tier fallback system to ensure every page has appropriate metadata:

1. **Page-level configuration** (highest priority) - Values from page frontmatter
2. **Site-level configuration** - Default values from `docs.yml`
3. **Sensible defaults** - Automatically generated from page content

For example, if a page doesn't specify an `og:image`, Fern will use the site-wide `og:image` from `docs.yml`. If no image is configured at either level, the tag is omitted rather than using a broken or placeholder image.

## Page metadata

Set SEO properties in each page's [frontmatter](/docs/configuration/page-level-settings) to control how individual pages appear in search results and social media shares. Page-level metadata takes precedence over site-wide settings.
Expand Down