SaaSyBase
SaaSyBase

SEO & Discoverability

SaaSyBase ships with an admin-managed SEO system that covers homepage metadata, global social fallbacks, sitemap generation, robots.txt output, verification tags, and discoverability defaults for the blog and CMS.

Where SEO is controlled

The main control surface lives in /admin/settings under the SEO tab. That page manages:

  • Homepage meta title, description, canonical URL, and homepage-specific social overrides
  • Sitewide title suffix or full title template
  • Default Open Graph and Twitter fallback title, description, and image
  • Blog listing title and description, plus blog index and category no-index defaults
  • Custom sitemap URLs and explicit sitemap exclusions
  • Google and Bing verification tokens
  • The robots.txt editor, including the sitewide no-index switch

Per-entry SEO still lives with the content itself. Blog posts and editable site pages keep their own SEO fields in the admin CMS.

Per-content SEO fields

Every blog post and editable site page still has entry-level fields for:

  • metaTitle, metaDescription, canonicalUrl, and noIndex
  • ogTitle, ogDescription, and ogImage

Use the SEO tab for global defaults and shared discovery controls. Use the CMS entry fields when a specific page or post needs custom search or social copy.

Note

For unmodeled third-party tags or scripts, use the theme designer's custom <head> and <body> injection points. Do not use those snippets as the primary place to manage canonical tags, verification tags, or robots defaults that already have structured settings.

What the SEO settings affect at runtime

SurfaceBehavior
Homepage (`/`)Uses the homepage title, description, canonical URL, homepage OG overrides, and global OG fallbacks when homepage-specific values are blank.
Public export homepageUses the same homepage SEO settings as the main root homepage so exported installs inherit the same copy and OG defaults.
Blog listing (`/blog`)Uses the blog listing title and description settings, can be no-indexed independently, and falls back to the global OG defaults for social cards.
Blog categories (`/blog/category/[slug]`)Use category-derived metadata but can be globally no-indexed from the SEO tab.
Blog posts and editable site pagesUse their own SEO fields first, then fall back to the global OG defaults if specific social values are missing.
Sitemap and robotsGenerated from the same SEO settings rather than being handwritten static files.

Some other public routes can still define their own route-level metadata in code. When they do, the route-level copy wins for that page, while sitewide behavior such as title templating, verification, and sitewide no-index still applies through the root layout.

Site URL, canonical URLs, and title composition

The SEO system needs a trustworthy site URL to generate canonical URLs, the sitemap host, and robots.txt host lines. That site URL is resolved from environment configuration, not from the SEO admin form.

PrioritySource
1NEXT_PUBLIC_APP_URL
2NEXTAUTH_URL
3VERCEL_PROJECT_PRODUCTION_URL
4VERCEL_URL
Fallbackhttp://localhost:3000

Note

Set your production host correctly before auditing SEO output. If the app still thinks it lives on localhost, your canonical URLs, sitemap, and robots host lines will reflect that.

Tip

ALLOWED_DEV_ORIGINS is only a development helper for custom local hostnames or tunnels. It does not change canonical URLs or SEO output, and it is not needed for a normal http://localhost:3000 workflow.

Title suffix and title template rules

The title system supports two layers:

  • If a full template is set, it must include %s and it becomes the authoritative sitewide title template.
  • If no full template is set, the optional title suffix is used instead.
  • If neither is configured, the site name becomes the fallback suffix.
%s | Example SaaS
%s · Example SaaS

The docs pages still use a docs-specific page title shape like Local PostgreSQL | Docs, and the helper avoids duplicating the site name in the share title.

Sitemap and robots.txt generation

SaaSyBase generates both /sitemap.xml and /robots.txt from live SEO settings.

Sitemap behavior

The generated sitemap includes:

  • The homepage
  • The main blog listing
  • All published site pages
  • All published blog posts
  • Any custom same-site URLs you add in the SEO tab

Exact URLs can also be excluded from the generated sitemap. Exclusions are applied before the final sitemap array is returned.

Robots.txt behavior

The robots.txt file is generated from the same site URL and sitemap values, then optionally extended with custom directives from the robots.txt modal in the SEO tab.

# Generated by the SaaSyBase SEO settings.
User-agent: *
Allow: /
Sitemap: https://example.com/sitemap.xml
Host: https://example.com

When sitewide no-index is enabled, two things happen together:

  • The root layout emits robots: { index: false, follow: false }
  • /robots.txt switches to a full-site disallow block and includes an explicit warning comment

Warning

The robots.txt editor does not replace the generated file. It appends custom directives below the generated block. Core lines such as the sitemap URL, host, and sitewide no-index behavior remain authoritative.

Verification tags and social fallbacks

Google and Bing verification tokens entered in the SEO tab are emitted from the root layout. That makes them available sitewide without editing templates manually.

Global OG fallback settings are used when a route does not define its own social title, description, or image. In practice, that means your blog listing, static marketing routes, and CMS pages can share a consistent fallback social card without duplicating the same values everywhere.

Recommended workflow

  1. Set the production site URL in environment variables before checking canonical tags, sitemap output, or robots host lines.
  2. Open /admin/settings and fill in the homepage title, description, canonical URL, and default OG values.
  3. Decide whether the blog index or category archives should be indexable.
  4. Add any custom sitemap URLs and explicit exclusions.
  5. Open the robots.txt editor for crawler-specific directives or a temporary sitewide no-index rollout.
  6. Verify the rendered output in /, /blog, /robots.txt, and /sitemap.xml.
  7. Then submit your domain in the relevant search consoles using the verification tokens you configured.

Pair this guide with Content Management for per-page CMS SEO and Theming & Branding if you also need custom head/body snippets for integrations that fall outside the structured SEO settings.