Introduction
SEO (Search Engine Optimization) is often seen as “marketing stuff,” but as developers, we play a huge role in how search engines read and rank websites. Clean code, fast performance, and proper structure all directly affect SEO.
This blog is inspired by my colleague Harsh Kumar — one of the best people I know for SEO. He’s my junior at work, and while I already knew how to optimize websites from a development perspective, he’s the one who really taught me how to approach SEO. Consider this article both a practical roadmap and a tribute to the kind of knowledge Harsh shared with me.
In this article, we’ll cover:
- What technical SEO means for developers
- Key best practices in Next.js (and why it’s great for SEO)
- Metadata, slugs, and schema markup
- Sitemaps and canonical URLs
- Page speed optimization
- Semantic tags and Open Graph meta tags
- Common mistakes to avoid
By the end, you’ll see SEO not just as keywords and backlinks but as writing developer-friendly, search-friendly code.
Why Developers Should Care About SEO
- Business impact: SEO drives organic traffic without paid ads.
- Scalability: A well-optimized site grows with fewer headaches later.
- Collaboration: When devs understand SEO, marketing teams don’t have to fight with us over structure or speed.
Frameworks like Next.js make SEO much easier with server-side rendering (SSR), dynamic metadata, and image optimization. React alone struggles with SEO because of client-side rendering — and that’s where Next.js shines.
Technical SEO Roadmap for Developers
1. Metadata
Metadata is how search engines understand your pages. In Next.js, you can use metadata
and generateMetadata
functions to create dynamic meta tags.
- Title, description, keywords → all matter for ranking and CTR.
- Example:
export const metadata = {
title: "Best SEO Practices",
description: "Learn technical SEO tips for developers using Next.js."
}
2. Dynamic Route Slugs
SEO-friendly URLs matter more than you think. Instead of:
Incorrect - /blog/ghf12i3i930
Correct - /blog/best-seo-practices
Dynamic slugs in Next.js make this easy (/pages/blog/[slug].js
).
3. Structured Data (Schema Markup)
Schema markup = rich results. Add JSON-LD for products, articles, events, etc.
- Docs: Schema.org
- Validator: Schema Validator
Example: Adding Product
schema in an eCommerce site makes Google show product cards.
4. Sitemaps
sitemap.xml
= index for your site. Next.js (or next-sitemap
) can auto-generate one.
Example snippet in next-sitemap.js
:
module.exports = {
siteUrl: 'https://example.com',
generateRobotsTxt: true,
}
5. Page Speed Optimization
Search engines love fast websites. In Next.js:
- Use
next/image
for image optimization. - Prefer modern formats like WebP.
- Implement lazy loading for heavy content.
Remember: a slow site = poor SEO rankings.
6. Canonical URLs
Avoid duplicate content issues by setting a canonical URL:
<link rel="canonical" href="https://example.com/blog/best-seo-practices" />
7. Semantic Tags
Semantic HTML helps both users and search engines:
<article>
for articles<nav>
for navigation<aside>
for sidebars<footer>
for the bottom section
Tiny details → big SEO impact.
8. Open Graph Meta Tags
For better social sharing previews, add Open Graph tags:
<meta property="og:title" content="Best SEO Practices" />
<meta property="og:description" content="Learn technical SEO for developers." />
<meta property="og:image" content="https://example.com/seo.png" />
Common SEO Mistakes Developers Make
- Using multiple
<h1>
tags on a single page. - Relying only on client-side rendering for indexable pages.
- Forgetting to add site to Google Search Console / Bing Webmaster.
- Ignoring structured data and canonical tags.
Final Thoughts
As developers, we often focus only on writing code — but SEO is where code meets visibility. The cleaner and faster your implementation, the easier it is for search engines to rank your site.
Key takeaways:
- Use Next.js features like metadata, dynamic slugs, and
next/image
. - Add structured data and sitemaps for better indexing.
- Optimize for speed and use semantic HTML.
- Never skip canonical URLs and Open Graph tags.
This guide is just the start. I’ll keep sharing more SEO-focused blogs with practical examples from my own projects.
And once again, a big thanks to Harsh Kumar - LinkedIn