Configure SEO metadata
Fern automatically generates all SEO metadata for every page in your documentation site. Search engines and social media previews work out of the box with no configuration required.
When you do want to customize SEO settings, you can set defaults at the site level or override them on individual pages. Keep titles between 50-60 characters and descriptions between 150-160 characters for optimal display.
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.
How it works
Fern looks for metadata values in this order:
- Page frontmatter - Custom SEO values for a specific page
- Site-level
docs.yml- Default SEO values for all pages - Automatic defaults - Generated from your page’s existing title, description, etc.
Example
og:image is the image that appears in social media previews. If you don’t set og:image in a page’s frontmatter, Fern uses the site-wide og:image from docs.yml. If neither is configured, the tag is omitted entirely.
What Fern automatically generates
For every page, Fern creates these SEO tags in your HTML:
HTML meta tags
<title>tag with site-wide suffix (e.g., “Page Title | Your Site Name”)- Meta description (pulled from your
description,subtitle, orexcerptfields) - Meta keywords (when you provide them)
- Canonical URL (from your page slug or
canonical-urloverride) - Robots meta tags (
noindex/nofollowwhen configured) - Favicon link tag
Open Graph tags (for LinkedIn, Slack, Discord, etc.)
og:title,og:description,og:image- What appears in social previewsog:url- Canonical URL of the pageog:site_name- Your website nameog:locale- Content language (e.g., “en_US”)og:image:width,og:image:height- Image dimensions
Twitter Card tags
twitter:title,twitter:description,twitter:image- What appears in Twitter/X previewstwitter:site,twitter:creator- Your Twitter handlestwitter:card- Card type (e.g., “summary_large_image”)
Website metadata
Set default SEO metadata for your entire documentation site in docs.yml. These settings apply to all pages unless overridden by page-specific metadata.
The name of your website for Open Graph tags.
The title shown in social media previews.
The description shown in social media previews.
The canonical URL of your documentation.
The image shown in social media previews. Recommended size is 1200x630 pixels.
The width of your Open Graph image in pixels.
The height of your Open Graph image in pixels.
The locale of your content (e.g., “en_US”).
URL to your company logo.
The title shown in Twitter Card previews.
The description shown in Twitter Card previews.
Your company’s Twitter handle.
The image shown in Twitter Card previews.
The Twitter handle for your website.
The Twitter Card type. Options are summary, summary_large_image, app, or player.
The host of your documentation website. This will be used to set the canonical URL for metadata tags and documents like the sitemap.
Defaults to the URL defined in the instances configuration.
Page-level configuration
Configure SEO metadata in your page’s frontmatter to control how individual pages appear in search results and social media shares. These settings override site-wide settings.
Only the documented SEO fields are added to the HTML <head> as meta tags. Custom frontmatter fields won’t automatically appear in your page metadata. To add custom metadata, use custom JavaScript.
Document properties
When set, the <title /> tag in the document head will use this value rather than the title property. This property changes the title that search engines see when crawling this page, and can be used to address Duplicate Title issues in your SEO report.
Overrides the canonical URL for this page. Must be a full URL including the protocol (i.e. https://buildwithfern.com/learn/docs/content/frontmatter)
Comma-separated string of keywords relevant to the page content (i.e. plants, garden, nursery). These keywords help search engines understand the page topic and contributes to search rankings. Use specific, relevant terms that users might search for when looking for the page’s content.
This field accepts only comma-separated strings, not bracketed arrays.
OpenGraph properties
The name of your website as it should appear when your content is shared.
The title of your page as it should appear when your content is shared.
The description of your page as it should appear when your content is shared.
The URL of your page.
The URL or identifier of the image that will be displayed when your content is shared.
The width of the image in pixels.
The height of the image in pixels.
The locale of the page, typically in the format language_TERRITORY (e.g., en_US).
The URL or identifier of the logo image of your website that will be displayed when your content is shared.
Twitter properties
The title of your page as it should appear in a tweet.
The description of your page as it should appear in a tweet.
The Twitter handle of the page creator or site.
The URL or identifier of the image that will be displayed in a tweet.
The name of your website as it should appear in a tweet.
The URL of your page.
The type of card to be used for sharing on Twitter. Options: summary, summary_large_image, app, player
Indexing properties
If set to true, the page will not be indexed by search engines.
If set to true, a search engine will not follow any links present on the page.