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.
- SEO
- Metadata
- Next.js
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.
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, thenh2for sections andh3for subsections. - Link to related guides with the words the destination page is about.
- Publish a sitemap of canonical URLs, and point
robots.txtat it. - Keep the steps in HTML. A diagram can support a section. It should not be the only copy of the instructions.