Generate SEO Metadata for Next.js Pages

Use this AI prompt to create optimized SEO metadata for Next.js routes with title, description, canonical URL, and Open Graph tags.

🧠 What This Prompt Does

This AI prompt helps developers generate SEO-optimized metadata for Next.js pages using the App Router.
It structures all necessary fields — titles, descriptions, canonical links, Open Graph, and Twitter tags — ensuring your app is discoverable and shareable across the web.


💬 The Prompt

You are an SEO-focused Next.js expert.
Generate a metadata configuration object for a Next.js page using the app router.

Include:

- Title
- Description
- Canonical URL
- Open Graph (OG) tags
- Twitter card tags
- Example export structure
  Page Info:
  {{page_details}}

⚙️ Example Input

{
  "page_details": {
    "title": "Next.js Image Optimization Guide",
    "description": "Learn how to optimize images in Next.js using the new app router and next/image component.",
    "url": "https://www.iocombats.com/blog/nextjs-image-optimization"
  }
}

🚀 Example Output (AI Generated)

export const metadata = {
  title: 'Next.js Image Optimization Guide',
  description:
    'Learn how to optimize images in Next.js using the new app router and next/image component.',
  alternates: {
    canonical: 'https://www.iocombats.com/blog/nextjs-image-optimization',
  },
  openGraph: {
    title: 'Next.js Image Optimization Guide',
    description: 'Optimize images using next/image and App Router in Next.js.',
    url: 'https://www.iocombats.com/blog/nextjs-image-optimization',
    siteName: 'IOC Combats',
    locale: 'en_US',
    type: 'article',
  },
  twitter: {
    card: 'summary_large_image',
    title: 'Next.js Image Optimization Guide',
    description: 'Step-by-step guide to mastering next/image.',
  },
};

📘 When to Use This Prompt

  • When setting up new Next.js pages or blog posts.
  • To improve SEO performance and visibility.
  • For consistent metadata across routes and app router entries.

💡 Best Practices

  • Always include canonical URLs to prevent duplicate content.
  • Add structured data (JSON-LD) for better indexing.
  • Keep descriptions under 160 characters for SERP display.
  • Use relevant Open Graph images for better sharing previews.

🏁 Summary

This prompt helps generate fully structured SEO metadata for your Next.js pages.
It ensures your site meets search engine and social media visibility standards while staying consistent across routes.

nextjsseometadataoptimizationai-prompt

Advertisement