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, andnoIndexogTitle,ogDescription, andogImage
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
<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
| Surface | Behavior |
|---|---|
| Homepage (`/`) | Uses the homepage title, description, canonical URL, homepage OG overrides, and global OG fallbacks when homepage-specific values are blank. |
| Public export homepage | Uses 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 pages | Use their own SEO fields first, then fall back to the global OG defaults if specific social values are missing. |
| Sitemap and robots | Generated 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.
| Priority | Source |
|---|---|
| 1 | NEXT_PUBLIC_APP_URL |
| 2 | NEXTAUTH_URL |
| 3 | VERCEL_PROJECT_PRODUCTION_URL |
| 4 | VERCEL_URL |
| Fallback | http://localhost:3000 |
Note
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
%sand 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 SaaSThe 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.comWhen sitewide no-index is enabled, two things happen together:
- The root layout emits
robots: { index: false, follow: false } /robots.txtswitches to a full-site disallow block and includes an explicit warning comment
Warning
Recommended workflow
- Set the production site URL in environment variables before checking canonical tags, sitemap output, or robots host lines.
- Open
/admin/settingsand fill in the homepage title, description, canonical URL, and default OG values. - Decide whether the blog index or category archives should be indexable.
- Add any custom sitemap URLs and explicit exclusions.
- Open the robots.txt editor for crawler-specific directives or a temporary sitewide no-index rollout.
- Verify the rendered output in
/,/blog,/robots.txt, and/sitemap.xml. - 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.

