Chapter 1: SEO & Meta Tags - Make Your Website Discoverable
You have built a beautiful website with Next.js. It has animations, a payment system, and authentication. But none of that matters if nobody can find it.
Search Engine Optimization (SEO) is the practice of making your website visible to search engines like Google. Without SEO, your website is invisible.
Why SEO Matters for Your Business
In the real business world, development is only the first 20% of a project lifecycle. The other 80% is getting users to your site. If your website does not appear on the first page of Google results, you might as well not exist.
Statistics show that over 90% of users never click past page 1 of search results. Being on page 2 means being invisible. SEO is the bridge between your content and your customers.
What Are Meta Tags?
Meta Tags are HTML elements that provide structured metadata about a webpage. They live in the
section and are invisible to human visitors but critical for machines:- Search engine crawlers (Googlebot) read Meta Tags to understand your page
- Social media bots (Facebook, Line, Twitter) use Meta Tags to generate preview cards
The Essential Meta Tags
| Tag | Purpose | Example | |-----|---------|---------| | title | The clickable headline in search results | "Vibe Tutor - AI Programming" | | meta description | The summary text under the title | "Learn Vibe Coding from scratch..." | | og:title | Card title on social media | "Vibe Tutor Courses" | | og:description | Card description on social media | "Build apps with AI assistance" | | og:image | Preview thumbnail for shared links | "/images/og-banner.jpg" | | twitter:card | Twitter card format | "summary_large_image" |
When you paste a URL into Line, Facebook, or Twitter, these platforms instantly crawl your website to read these tags. If tags are missing or poorly written, your shared link will appear as a plain URL that nobody clicks.
How to Set Up Meta Tags in Next.js
Next.js App Router provides a built-in Metadata API that makes SEO straightforward.
Step 1: Global Metadata
The root layout.tsx file defines site-wide defaults that apply to every page unless overridden:
// src/app/layout.tsx
import type { Metadata } from "next";
export const metadata: Metadata = {
title: {
default: "Vibe Tutor | AI-Powered Programming Courses",
template: "%s | Vibe Tutor"
},
description: "Learn to build production-ready applications with AI assistance. Vibe Coding courses from zero to deployment.",
keywords: ["Vibe Coding", "AI programming", "Next.js", "FastAPI"],
openGraph: {
type: "website",
locale: "en_US",
url: "https://vibetutor.com",
siteName: "Vibe Tutor",
title: "Vibe Tutor | AI-Powered Programming Courses",
description: "Build real apps with AI. No memorization required.",
images: [{
url: "https://vibetutor.com/og-default.jpg",
width: 1200,
height: 630,
alt: "Vibe Tutor"
}]
},
twitter: {
card: "summary_large_image",
title: "Vibe Tutor | AI-Powered Programming",
description: "Build real apps with AI.",
images: ["https://vibetutor.com/og-default.jpg"]
},
robots: { index: true, follow: true }
};
Step 2: Dynamic Metadata per Page
For course pages, generate unique metadata dynamically:
// app/courses/[slug]/page.tsx
export async function generateMetadata({ params }: {
params: { slug: string }
}): Promise<Metadata> {
const course = await getCourseData(params.slug);
return {
title: course.title,
description: course.description,
openGraph: {
title: course.title,
description: course.description,
images: [{ url: course.ogImage || "/og-default.jpg", width: 1200, height: 630 }]
}
};
}
This creates 100+ unique pages in Google's index, each optimized for specific keywords.
How the Vibe Coding Approach Helps
Instead of memorizing every Meta Tag attribute, describe what you need to AI:
"I am using Next.js 14 App Router. My website is called Vibe Tutor, a platform teaching AI-assisted programming. Please generate a complete metadata configuration for layout.tsx with proper Open Graph and Twitter card settings."
The AI will generate production-ready code matching all the examples above.
OG Image Best Practices
The Open Graph image is the thumbnail that appears when your URL is shared.
| Aspect | Recommended | |--------|-------------| | Dimensions | 1200x630 pixels (1.91:1 ratio) | | File size | Under 300KB | | Branding | Include logo and brand colors | | Text | Short compelling headline | | Format | JPG for photos, PNG for graphics |
Common SEO Mistakes to Avoid
1. Duplicate Title Tags
Every page needs a UNIQUE title. Duplicate titles confuse Google. Use Next.js title template to enforce uniqueness.
2. Missing OG Image
The most common oversight. Without og:image, shared links have no thumbnail - drastically reducing click-through rates.
3. Keyword Stuffing
Writing keywords repeatedly in descriptions does not help. Google penalizes unnatural repetition. Write for humans.
4. Ignoring Mobile SEO
Over 60% of web traffic comes from mobile devices. Google prioritizes mobile-friendly sites. Ensure responsive design.
Measuring SEO Success
| Metric | What It Tells You | Good Range | |--------|-------------------|:----------:| | CTR | How often searchers click your link | > 5% | | Impressions | How many times your page appears | High volume | | Avg Position | Your ranking for keywords | Top 5 | | Indexed Pages | How many pages Google knows about | All important pages |
Launch Checklist
Before deploying, verify each item:
- [ ] Global metadata configured in layout.tsx
- [ ] Each course has unique generateMetadata
- [ ] OG image exists at 1200x630
- [ ] robots.txt allows crawling of public pages
- [ ] Sitemap submitted to Google Search Console
- [ ] Title tags are unique across all pages
- [ ] Meta descriptions are 150-160 characters
- [ ] Mobile responsiveness tested
- [ ] Social media preview tested on Facebook, Line, Twitter
Chapter Summary
Meta Tags are the foundation of SEO. They tell Google what your page is about and tell social platforms how to display your shared links. Next.js Metadata API makes implementation clean and powerful.
Key takeaways:
- Always set title, description, and OG image globally
- Use generateMetadata for dynamic pages
- Keep OG images at 1200x630 pixels
- Avoid duplicate titles and keyword stuffing
- Monitor SEO metrics through Google Search Console
What's Next: Google Analytics
SEO brings visitors to your site. The next step is understanding those visitors. Chapter 2 shows how to install Google Analytics 4 (GA4) to track user behavior, measure engagement, and optimize your conversion funnel with real data.
Advanced: Structured Data for Rich Results
Beyond Meta Tags, Structured Data (Schema.org markup) enables rich search results like star ratings, pricing, and FAQ snippets.
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Course",
"name": "Vibe Coding with Next.js",
"description": "Build production apps with AI assistance.",
"provider": {
"@type": "Organization",
"name": "Vibe Tutor",
"sameAs": "https://vibetutor.com"
}
}
</script>
Rich results can increase CTR by 20-30%. Google supports many structured data types including:
- Course (for online education)
- Product (for e-commerce)
- FAQ (for question pages)
- Review (for testimonials)
- Article (for blog content)
SEO & The Vibe Coding Mindset
The best SEO strategy combines technical optimization with great content:
| Strategy | Effort | Impact | |----------|:------:|:------:| | Technical SEO (Meta Tags, Schema) | One-time setup | Long-term foundation | | Content Marketing (tutorials, guides) | Ongoing | Exponential growth | | Backlink Building (guest posts, PR) | Ongoing | Domain authority | | Social Media (sharing, engagement) | Daily | Immediate traffic |