logoBuildBox

SEO

  1. Open config.js file and add values for appName, appDescription, and domainName. These values will be used as default SEO tags. The helper /libs/seo.js adds all the important SEO tags (with your default values) to all pages thanks to the main /app/layout.js file.

  2. To add custom SEO tags to a page without rewritting all the tags, do this:

/app/terms/page.js
 
import { getSEOTags } from "@/libs/seo";
 
export const metadata = getSEOTags({
  title: "Terms and Conditions | ShipFast",
  canonicalUrlRelative: "/tos",
});
 
export default async function TermsAndConditions() {
  return (
    <main className="min-h-screen p-8 pb-24">
      <section className="max-w-xl mx-auto space-y-8">
        <h1 className="text-3xl md:text-4xl font-extrabold">
          Terms and Conditions
        </h1>
        <p className="text-lg">
          These terms and conditions govern your use of our website. By using
          ...
  )

I recommend setting title andcanonicalUrlRelative for each pages.

  1. When relevant, add Structured Data to a page using the renderSchemaTags() function in /libs/seo.js. It helps Google understand better your website and can get you a rich snippet. Open the component for more documentation. Here's an example:

  2. Add your root URL to siteUrl (i.e. https://yourdomain.com) in the next-sitemap.config.js file, in the root folder. It will generate a sitemap.xml & robots.txt file for all your pages (at build time).

Claim your domain ownership on Google Search Console to help indexing

Last updated on

On this page

No Headings
Edit on GitHub