Next.js 15 SEO Optimizasyonu: Modern Web Geliştirme Rehberi
Next.js 15, SEO optimizasyonu için birçok yeni özellik ve iyileştirme sunuyor. Bu kapsamlı rehberde, Next.js 15'in tüm SEO özelliklerini detaylı olarak inceleyeceğiz.
🎯 Next.js 15'teki Yeni SEO Özellikleri
Next.js 15, SEO performansını artırmak için birçok yenilik getiriyor:
1. Gelişmiş Metadata API
// app/layout.tsx
import type { Metadata } from 'next'
export const metadata: Metadata = {
title: {
default: 'Hamza İnce - React Developer',
template: '%s | Hamza İnce'
},
description: 'Professional React & React Native Developer',
keywords: ['React', 'Next.js', 'JavaScript', 'TypeScript'],
authors: [{ name: 'Hamza İnce' }],
creator: 'Hamza İnce',
publisher: 'Hamza İnce',
formatDetection: {
email: false,
address: false,
telephone: false,
},
metadataBase: new URL('https://hamzaince.com'),
alternates: {
canonical: '/',
languages: {
'en-US': '/en-US',
'tr-TR': '/tr-TR',
},
},
openGraph: {
title: 'Hamza İnce - React Developer',
description: 'Professional React & React Native Developer',
url: 'https://hamzaince.com',
siteName: 'Hamza İnce Portfolio',
images: [
{
url: '/og-image.jpg',
width: 1200,
height: 630,
alt: 'Hamza İnce Portfolio',
},
],
locale: 'en_US',
type: 'website',
},
twitter: {
card: 'summary_large_image',
title: 'Hamza İnce - React Developer',
description: 'Professional React & React Native Developer',
images: ['/twitter-image.jpg'],
},
robots: {
index: true,
follow: true,
googleBot: {
index: true,
follow: true,
'max-video-preview': -1,
'max-image-preview': 'large',
'max-snippet': -1,
},
},
}
2. Dinamik Metadata
// app/blog/[slug]/page.tsx
import type { Metadata } from 'next'
type Props = {
params: { slug: string }
}
export async function generateMetadata({ params }: Props): Promise {
const post = await getBlogPost(params.slug)
return {
title: post.title,
description: post.excerpt,
openGraph: {
title: post.title,
description: post.excerpt,
images: [post.featuredImage],
},
twitter: {
card: 'summary_large_image',
title: post.title,
description: post.excerpt,
images: [post.featuredImage],
},
}
}
⚡ Core Web Vitals Optimizasyonu
Google'ın Core Web Vitals metrikleri için Next.js 15 optimizasyonları:
1. Largest Contentful Paint (LCP) Optimizasyonu
// app/layout.tsx
import Image from 'next/image'
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
{/* Preload critical images */}
{/* Removed preload for missing hero image */}
{/* Optimize images */}
{/* Removed missing hero image usage */}
{children}
)
}
2. First Input Delay (FID) Optimizasyonu
// app/page.tsx
'use client'
import { useEffect } from 'react'
export default function HomePage() {
useEffect(() => {
// Defer non-critical JavaScript
const loadNonCriticalJS = () => {
import('./non-critical-script.js')
}
// Load after user interaction or delay
setTimeout(loadNonCriticalJS, 2000)
}, [])
return (
{/* Critical content first */}
Welcome to My Portfolio
)
}
3. Cumulative Layout Shift (CLS) Optimizasyonu
// app/blog/page.tsx
import Image from 'next/image'
🔍 Structured Data Implementation
Schema.org structured data ile SEO performansını artırma:
// components/StructuredData.tsx
export function StructuredData({ data }: { data: any }) {
const structuredData = {
"@context": "https://schema.org",
"@type": "Person",
"name": "Hamza İnce",
"jobTitle": "React Developer",
"description": "Professional React & React Native Developer",
"url": "https://hamzaince.com",
"image": "https://hamzaince.com/images/hamza-ince.jpg",
"sameAs": [
"https://github.com/hamzaince",
"https://linkedin.com/in/hamzaince"
],
"worksFor": {
"@type": "Organization",
"name": "Freelance"
},
"knowsAbout": [
"React",
"React Native",
"JavaScript",
"TypeScript",
"Next.js"
]
}
return (
)
}
📊 Performance Monitoring
Web Vitals API ile performans izleme:
// lib/analytics.ts
import { getCLS, getFID, getFCP, getLCP, getTTFB } from 'web-vitals'
export function reportWebVitals(metric: any) {
// Send to analytics service
if (typeof window !== 'undefined') {
// Google Analytics 4
gtag('event', metric.name, {
value: Math.round(metric.value),
event_label: metric.id,
non_interaction: true,
})
// Custom analytics
fetch('/api/analytics', {
method: 'POST',
body: JSON.stringify(metric),
})
}
}
// app/layout.tsx
export function reportWebVitals(metric: any) {
reportWebVitals(metric)
}
🤖 SEO Testing ve Validasyon
Lighthouse CI ile otomatik SEO testleri:
# .lighthouserc.js
module.exports = {
ci: {
collect: {
url: ['https://hamzaince.com'],
settings: {
chromeFlags: '--no-sandbox',
},
},
assert: {
assertions: {
'categories:seo': ['error', { minScore: 0.9 }],
'categories:performance': ['warn', { minScore: 0.8 }],
'categories:accessibility': ['warn', { minScore: 0.8 }],
'categories:best-practices': ['warn', { minScore: 0.8 }],
},
},
upload: {
target: 'temporary-public-storage',
},
},
}
🚀 Advanced SEO Techniques
1. Dynamic Sitemap Generation
// app/sitemap.xml/route.ts
import { getAllBlogPosts } from '@/data/blogPosts'
export async function GET() {
const posts = getAllBlogPosts()
const sitemap = `
https://hamzaince.com
${new Date().toISOString()}
weekly
1.0
${posts.map(post => `
https://hamzaince.com/blog/${post.slug}
${post.date}
monthly
0.8
`).join('')}
`
return new Response(sitemap, {
headers: {
'Content-Type': 'application/xml',
},
})
}
2. Robots.txt Optimization
// app/robots.txt/route.ts
export async function GET() {
const robotsTxt = `User-agent: *
Allow: /
# Sitemaps
Sitemap: https://hamzaince.com/sitemap.xml
# Crawl delay
Crawl-delay: 1
# Disallow admin areas
Disallow: /admin/
Disallow: /api/
Disallow: /_next/
`
return new Response(robotsTxt, {
headers: {
'Content-Type': 'text/plain',
},
})
}
📱 Mobile-First SEO
Mobil öncelikli SEO optimizasyonları:
// app/layout.tsx
export const viewport = {
width: 'device-width',
initialScale: 1,
maximumScale: 5,
userScalable: true,
themeColor: [
{ media: '(prefers-color-scheme: light)', color: 'white' },
{ media: '(prefers-color-scheme: dark)', color: 'black' },
],
}
🎨 Visual SEO Elements
Görsel SEO öğeleri ile kullanıcı deneyimini artırma:
1. Favicon Optimization
// app/icon.tsx
import { ImageResponse } from 'next/og'
export const size = {
width: 32,
height: 32,
}
export const contentType = 'image/png'
export default function Icon() {
return new ImageResponse(
(
HI
),
{
...size,
}
)
}
2. Open Graph Image Generation
// app/og-image/route.tsx
import { ImageResponse } from 'next/og'
export async function GET(request: Request) {
const { searchParams } = new URL(request.url)
const title = searchParams.get('title') || 'Default Title'
return new ImageResponse(
(
{title}
),
{
width: 1200,
height: 630,
}
)
}
🔧 SEO Audit Tools
SEO performansını izlemek için kullanılabilecek araçlar:
- Google Search Console: Arama performansı ve hata takibi
- Google PageSpeed Insights: Core Web Vitals analizi
- Lighthouse: Kapsamlı performans ve SEO analizi
- GTmetrix: Detaylı performans raporları
- Screaming Frog: SEO teknik analizi
📈 SEO Monitoring Dashboard
SEO performansını izlemek için dashboard oluşturma:
// app/admin/seo/page.tsx
'use client'
import { useEffect, useState } from 'react'
export default function SEODashboard() {
const [metrics, setMetrics] = useState(null)
useEffect(() => {
const fetchMetrics = async () => {
const response = await fetch('/api/seo-metrics')
const data = await response.json()
setMetrics(data)
}
fetchMetrics()
}, [])
return (
SEO Performance Dashboard
Core Web Vitals
LCP: {metrics?.lcp || 'N/A'}
FID: {metrics?.fid || 'N/A'}
CLS: {metrics?.cls || 'N/A'}
Search Performance
Impressions: {metrics?.impressions || 'N/A'}
Clicks: {metrics?.clicks || 'N/A'}
CTR: {metrics?.ctr || 'N/A'}
)
}
🚀 Sonuç
Next.js 15'in SEO özellikleri ile modern web standartlarına uygun, performanslı ve arama motorları tarafından kolayca indekslenebilen web siteleri geliştirebilirsiniz. Bu rehberdeki teknikleri uygulayarak SEO performansınızı önemli ölçüde artırabilirsiniz.
Önemli Noktalar:
- Metadata API'yi etkin kullanın
- Core Web Vitals metriklerini optimize edin
- Structured data ile zengin sonuçlar oluşturun
- Performans izleme sistemleri kurun
- SEO audit araçlarını düzenli kullanın
