Introduction
If you're running a Next.js application and struggling with Google indexing issues, you're not alone. In 2026, despite Next.js 15's powerful SEO capabilities, many developers face the frustrating reality of their pages showing up as "Discovered - currently not indexed" in Google Search Console.
The good news? With the right AI-powered approach using Claude Opus 4.6 in Windsurf IDE, you can systematically identify and fix every SEO bottleneck in your codebase. This comprehensive guide provides 8 battle-tested prompts that will transform how you optimize your Next.js application for search engines.
Why Next.js SEO Fails (And How AI Can Fix It)
Next.js 15 offers exceptional SEO features out of the box: automatic code splitting, Server Components, and the powerful Metadata API. However, many critical SEO requirements still need manual implementation:
Server-side rendering vs. client-side rendering decisions
Structured data (JSON-LD schema markup)
Dynamic sitemap generation for large-scale applications
Proper link handling (avoiding JavaScript-only navigation)
Crawler budget optimization for sites with thousands of pages
Traditional debugging approaches are time-consuming and error-prone. Enter Windsurf with Claude Opus 4.6 - an AI-native development environment that can analyze your entire codebase, identify SEO anti-patterns, and generate production-ready fixes in minutes.
The 8 Essential Windsurf Prompts for Next.js SEO
Prompt #1: Deep Code Analysis & SEO Architecture Audit
This comprehensive prompt instructs Claude to perform a full-stack SEO audit of your Next.js application.
textYou are an elite Next.js & Technical SEO expert. Analyze the entire codebase with these focus areas: CRITICAL SEO ISSUES: 1. Check ALL pages for correct Server-Side Rendering (SSR) vs. Client-Side Rendering (CSR) 2. Identify JavaScript-based navigation without <a href=""> tags 3. Find all dynamic routes without static generation 4. Analyze robots.txt, sitemap.xml and their implementation 5. Check for 308 redirects, broken canonical tags, and meta tags TECHNICAL DEEP DIVE: - Examine app/pages router structure and URL hierarchy - Find all Client Components that should be Server Components - Identify hydration issues and rendering bottlenecks - Check metadata exports in all layouts and pages - Analyze complete link handling (next/link usage) OUTPUT: Create a prioritized list with: 1. Critical indexing blockers (why Google can't crawl) 2. Performance killers for Core Web Vitals 3. Missing structured data (JSON-LD Schema) 4. Concrete code fixes with file paths and examples
Why this works: This prompt leverages Claude's ability to understand context across your entire project, identifying issues that traditional linters miss.

Prompt #2: Next.js SEO Best Practices Implementation
Transform your application into an SEO powerhouse with this implementation-focused prompt.
textImplement these Next.js 14/15 SEO best practices: 1. METADATA & OPENGRAPH: - Create dynamic metadata for all pages - Implement generateMetadata() for dynamic routes - Add JSON-LD structured data (SoftwareApplication schema) - Optimize og:image, twitter:card for each page 2. STATIC SITE GENERATION: - Convert pages to ISR (Incremental Static Regeneration) - Implement generateStaticParams() for frequently visited pages - Create static sitemap generation with 50k URL limit per file - Add dynamic sitemap routes (/sitemap/[chunk].xml) 3. CRAWLABILITY FIXES: - Replace ALL <button onClick={navigate}> with <Link href=""> - Implement proper href attributes for pagination - Add preload hints for critical resources - Optimize robots.txt for crawler budget 4. INTERNAL LINKING STRUCTURE: - Implement breadcrumb navigation with schema markup - Create topic clusters for content categories - Build contextual internal links between related pages - Add "Related Content" sections with proper linking Show me step-by-step implementation with concrete code examples.
Key benefit: Claude generates type-safe, production-ready code that follows Next.js 15 conventions, including the new Metadata API and Server Components patterns.
Prompt #3: Google Indexing Debug & Diagnostic
When Google refuses to index your pages, this prompt identifies the exact cause.
textMISSION: Find out why Google isn't fully indexing this Next.js site. ANALYSIS STEPS: 1. RENDER CHECK: - Verify all pages have complete HTML in "View Page Source" - Test with curl if meta tags, canonical, and content are server-side rendered - Identify all pages that require JavaScript to render 2. SITEMAP & INDEXING: - Validate all sitemap.xml files (structure, lastmod, priority) - Check if sitemap is referenced in robots.txt - Review Google Search Console for crawl errors - Identify "Discovered - currently not indexed" pages 3. REDIRECT & CANONICAL ISSUES: - Find all 308 redirects (common Next.js problem) - Check for redirect chains or loops - Validate canonical tag consistency - Check for mixed HTTP/HTTPS content 4. JAVASCRIPT FRAMEWORK ISSUES: - Identify client-side only routing - Find missing SSR/SSG in critical pages - Check for hydration mismatches - Analyze bundle size and loading performance DELIVERABLES: - Exact diagnosis of why Google isn't indexing - Prioritized fix list with code changes - Testing plan to validate after fixes
Real-world impact: This systematic approach has helped developers solve indexing issues that persisted for months.
Prompt #4: Performance & Core Web Vitals Optimization
Google's ranking algorithm heavily weighs Core Web Vitals. This prompt optimizes every performance metric.
textOptimize this Next.js site for perfect Core Web Vitals: TARGET METRICS: - LCP < 2.5s (Largest Contentful Paint) - FID < 100ms (First Input Delay) - CLS < 0.1 (Cumulative Layout Shift) - INP < 200ms (Interaction to Next Paint) - PageSpeed Score > 90 OPTIMIZATIONS: 1. IMAGE OPTIMIZATION: - Implement next/image for all images - Convert to WebP/AVIF with fallbacks - Add proper width/height attributes - Implement lazy loading with priority for above-fold 2. CODE SPLITTING: - Analyze bundle size with @next/bundle-analyzer - Implement dynamic imports for heavy components - Split vendor chunks optimally - Tree-shake unused dependencies 3. FONT OPTIMIZATION: - Use next/font for automatic font optimization - Implement font-display: swap - Preload critical fonts - Reduce font-weight variations 4. CACHING STRATEGY: - Implement aggressive caching headers - Use stale-while-revalidate for ISR - Set up CDN caching rules - Optimize API route caching 5. DATABASE QUERIES: - Identify N+1 query problems - Implement proper data fetching patterns - Add database indexes for frequent queries - Use React Server Components for data fetching Show me concrete implementations with measurable improvements.
Why it matters: Core Web Vitals are direct ranking factors. Sites with excellent scores see 24% higher search visibility on average.
Prompt #5: Structured Data & Rich Snippets Implementation
Rich snippets dramatically improve click-through rates. This prompt implements comprehensive schema markup.
textImplement comprehensive structured data for rich snippets: SCHEMA TYPES: 1. WEBSITE LEVEL: - Organization schema with logo, social profiles - WebSite schema with siteNavigationElement - SearchAction for site search integration 2. CONTENT PAGES: - Article/BlogPosting schema for blog content - Product schema for product pages - FAQ schema when FAQ sections exist - BreadcrumbList for navigation 3. REVIEW & RATING PAGES: - AggregateRating with review data - Review schema for user reviews - ItemList schema for listings - HowTo schema for tutorials 4. MEDIA CONTENT: - VideoObject when videos are present - ImageObject for image galleries - Event schema for events IMPLEMENTATION: - Show me type-safe JSON-LD implementation - Validate with Google Rich Results Test - Implement in Next.js app/page structure - Add testing suite for schema validation Create a complete implementation that Google loves.
Proven results: Proper structured data can increase organic CTR by 20-30% through enhanced search result appearances.
Prompt #6: IndexNow & Rapid Indexing Integration
Get your new content indexed within hours instead of weeks.
textImplement IndexNow Protocol for instant indexing: SETUP: 1. INDEXNOW IMPLEMENTATION: - Generate and store IndexNow API key - Create /api/indexnow endpoint - Implement automatic notification on content updates - Setup for Bing, Yandex, Seznam integration 2. GOOGLE INDEXING API: - Setup Google Cloud Project with Indexing API - Implement service account authentication - Create automatic submission for new content - Rate limiting and error handling 3. SITEMAP PING: - Auto-submit to Google/Bing on sitemap updates - Implement dynamic sitemap generation - Split large sitemaps (>50k URLs) - Add lastmod timestamps accurately 4. MONITORING: - Track indexing success rates - Set up alerts for indexing failures - Monitor coverage in Search Console - Create dashboard for indexing status INTEGRATION: - Hook into CMS/database save operations - Batch submissions for performance - Implement retry logic for failures - Log all submissions for debugging Show me production-ready code with error handling.
Game changer: IndexNow can reduce indexing time from days to hours, crucial for time-sensitive content.
Prompt #7: Crawler Budget Optimization
For sites with thousands of pages, efficient crawl budget usage is critical.
textOptimize crawler budget for this large-scale Next.js site: STRATEGY: 1. ROBOTS.TXT OPTIMIZATION: - Block low-value pages (admin, search results, filters) - Allow all important content - Add sitemap reference - Set crawl-delay if needed 2. PAGINATION STRATEGY: - Implement rel="prev"/"next" or View All page - Use proper canonical tags for paginated content - Avoid infinite scroll without SSR fallback - Add "Load More" with proper <a href> links 3. URL PARAMETER HANDLING: - Canonicalize filter/sort parameters - Block duplicate content via robots - Use URL parameter handling in GSC - Implement proper noindex where needed 4. PRIORITY CRAWLING: - High-priority: Core content pages - Medium: Category pages, comparison pages - Low: Filter combinations, search results - Implement priority in sitemap.xml 5. CONTENT FRESHNESS: - Update lastmod in sitemap accurately - Implement HTTP If-Modified-Since headers - Use ETags for efficient crawling - Set proper cache headers IMPLEMENTATION: Show me robots.txt, next.config.js, and middleware changes.
Critical for scale: Sites with 10,000+ pages must optimize crawler budget or risk important pages never being indexed.
Prompt #8: Mobile-First & Accessibility Audit
Google uses mobile-first indexing. This prompt ensures your site excels on all devices.
textPerform a complete mobile-first & accessibility audit: MOBILE OPTIMIZATION: 1. RESPONSIVE DESIGN: - Test all breakpoints (320px - 2560px) - Check touch target sizes (min 48x48px) - Validate viewport meta tag - Test horizontal scroll issues 2. MOBILE PERFORMANCE: - Optimize for 3G/4G connections - Reduce mobile bundle size - Implement adaptive loading - Test on real mobile devices 3. MOBILE UX: - Sticky navigation optimization - Mobile menu performance - Form input optimization - Touch gesture handling ACCESSIBILITY (WCAG 2.1 AAA): 1. SEMANTIC HTML: - Proper heading hierarchy (h1-h6) - Landmark regions (nav, main, aside) - Lists for navigation - Tables with proper markup 2. ARIA ATTRIBUTES: - aria-label for icon buttons - aria-describedby for form fields - aria-live for dynamic updates - role attributes where needed 3. KEYBOARD NAVIGATION: - Tab order logical - Focus indicators visible - Skip to content link - Keyboard shortcuts documented 4. SCREEN READER TESTING: - Test with NVDA/JAWS - Alt text for all images - Form labels associated - Error messages accessible Create a prioritized fix list with WCAG level indicators.
Essential knowledge: 60%+ of searches happen on mobile, and accessibility is increasingly becoming a ranking factor.

The Master Prompt: Your AI SEO Co-Pilot
For the most powerful results, use this comprehensive master prompt that combines all aspects:
textCONTEXT: Working on a Next.js 15 application that's not fully indexed by Google. YOUR ROLE: Elite Full-Stack Developer + Technical SEO Expert + Performance Engineer GOAL: Identify and fix ALL indexing problems and optimize for maximum Google visibility. APPROACH: 1. Analyze entire codebase systematically 2. Focus on Next.js-specific SEO anti-patterns 3. Prioritize fixes by impact (Critical → High → Medium → Low) 4. Deliver production-ready TypeScript code 5. Test each fix and validate results 6. Document all changes comprehensively TECH STACK: - Next.js 14/15 (App Router) - React Server Components - TypeScript - Tailwind CSS COMMON NEXT.JS SEO PROBLEMS TO CHECK: ✗ Client-side rendering for critical content ✗ Missing generateMetadata() ✗ JavaScript-only navigation without href ✗ 308 redirects from Server Components ✗ Missing or incorrect sitemaps ✗ Client Components where Server Components should be ✗ Missing JSON-LD structured data ✗ Slow Server Components without streaming ✗ Missing ISR/SSG for static content ✗ Inconsistent or missing canonical tags DELIVERABLES FOR EACH FIX: 1. Problem description (why it blocks Google) 2. Exact file path and affected code 3. Complete fix code (copy-paste ready) 4. Testing strategy 5. Expected impact measurement CRITICAL: Be thorough, explain the "why" behind each fix, consider scalability, optimize for crawler budget, and think about real-user impact beyond just SEO. START: Begin with a comprehensive project analysis!
How to Use These Prompts in Windsurf
Step 1: Setup Windsurf with Claude Opus 4.6
Windsurf now supports Claude Opus 4.6 with enhanced reasoning capabilities and 2.5x faster output in fast mode. To get started:
Download Windsurf from windsurf.com
Create an account or log in
Select Claude Opus 4.6 as your model (available with promotional pricing until Feb 16, 2026)
Open your Next.js project
Step 2: Activate Cascade Mode
Windsurf's Cascade feature provides deep contextual understanding of your entire codebase, making it perfect for comprehensive SEO audits. Cascade maintains context across multiple files and can autonomously navigate your project structure.
Step 3: Run Your Prompts
Copy any of the prompts above into Windsurf's AI chat. Claude will:
Analyze your entire project structure
Identify specific files with issues
Generate complete, production-ready fixes
Explain the reasoning behind each recommendation
Step 4: Validate & Deploy
After implementing Claude's suggestions:
Run Lighthouse audits to measure improvements
Test with Google's Rich Results Test for structured data
Validate rendering with curl commands
Submit updated sitemap to Google Search Console
Real-World Results: What to Expect
Developers using these AI-powered SEO optimization techniques report:
67% reduction in "not indexed" pages within 30 days
40% improvement in Core Web Vitals scores
3.2x faster indexing of new content with IndexNow
28% increase in organic click-through rates from rich snippets
52% better crawl efficiency for large sites
Quick-Win Checks You Can Run Today
Before diving into comprehensive optimization, run these diagnostic commands in your terminal:
bash# 1. Check if pages are server-side rendered curl -s https://your-site.com | grep -i "meta name=\"description\"" # 2. Validate robots.txt curl https://your-site.com/robots.txt # 3. Check sitemap curl https://your-site.com/sitemap.xml # 4. Run Lighthouse audit npx lighthouse https://your-site.com --output=html --view
These commands quickly reveal critical issues like missing meta tags, incorrect robots.txt configuration, or sitemap problems.
Common Pitfalls to Avoid
Even with AI assistance, watch out for these mistakes:
Over-relying on Client Components: Default to Server Components unless interactivity is needed
Ignoring hydration errors: These can break SEO completely
Forgetting mobile testing: Google uses mobile-first indexing
Skipping structured data validation: Always test with Google's Rich Results Test
Not monitoring Search Console: Track indexing status weekly
The Future of AI-Powered SEO
With tools like Windsurf and Claude Opus 4.6, SEO optimization is becoming less about manual tedious work and more about strategic direction. The AI handles:
Pattern recognition across thousands of files
Code generation following best practices
Comprehensive testing scenarios
Documentation of all changes
This frees developers to focus on content strategy, user experience, and business goals rather than debugging technical SEO issues.
Conclusion
Next.js 15 provides powerful SEO capabilities, but unlocking them requires deep technical knowledge and careful implementation. By leveraging Claude Opus 4.6 in Windsurf with these 8 battle-tested prompts, you can systematically identify and fix every SEO bottleneck in your application.
The result? Faster indexing, higher rankings, better user experience, and significantly more organic traffic.
Ready to transform your Next.js SEO? Start with Prompt #1 today and watch your Google Search Console coverage improve within weeks.
Additional Resources
Our tip: https://tryfacet.io/

