Skip to content
</>CodeAndBuild

SEO

Technical SEO for a developer blog

Titles, descriptions, canonical URLs, a sitemap, and one clear heading are the parts of SEO a technical blog can actually control.

6 min read
  • SEO
  • Metadata
  • Next.js
On this page
  1. One guide, one URL
  2. Put the title in metadata and on the page
  3. Make the outline real

Search engines can read a JavaScript app, and they still reward pages that say what they are. A guide needs a stable URL, a title that matches the question, and HTML that outlines the answer.

One guide, one URL

Pick a slug from the words a reader would type, then keep it. If the slug has to change, redirect the old path so existing links move with the page. Do not publish the same essay at two addresses.

Put the title in metadata and on the page

The document title and the h1 should agree. The meta description should be a sentence you would say out loud, not a list of keywords. In the App Router, the Metadata API owns the document head.

app/blog/[slug]/page.tsxtsx
export async function generateMetadata({
  params,
}: {
  params: Promise<{ slug: string }>;
}) {
  const { slug } = await params;
  const post = getPost(slug);
  if (!post) return { title: "Not found" };

  return {
    title: post.title,
    description: post.description,
    alternates: { canonical: `/blog/${post.slug}` },
  };
}

Make the outline real

  • Use one h1, then h2 for sections and h3 for subsections.
  • Link to related guides with the words the destination page is about.
  • Publish a sitemap of canonical URLs, and point robots.txt at it.
  • Keep the steps in HTML. A diagram can support a section. It should not be the only copy of the instructions.

More guides