Skip to main content

🌍 出海站实战:SEO优化

站上线了,但没人访问?正常。 这一章,我们用程序化SEO + 手动优化,让 Google 爱上你的站。 30天,从0到1000+自然流量,我做对了什么。


🎯 SEO 总体策略


📊 Step 1:关键词布局

主关键词

关键词月搜索量KDCPC页面
ai prompt generator18,10012$1.20首页
chatgpt prompts40,50025$0.80/templates
ai prompts33,10020$0.90/templates
prompt generator14,80010$1.10/generate

长尾关键词矩阵

这是我们的核心武器——每个长尾词对应一个模板页面:

长尾关键词月搜索量KD目标页面
best ai prompts for writing2,9008/templates/ai-prompts-for-writing
chatgpt prompts for coding3,60011/templates/chatgpt-prompts-for-coding
ai prompts for business1,9007/templates/ai-prompts-for-business
chatgpt prompts for marketing2,4009/templates/chatgpt-prompts-for-marketing
ai prompts for email writing1,6006/templates/ai-prompts-for-email-writing
best chatgpt prompts for students1,3005/templates/chatgpt-prompts-for-students
ai prompts for social media1,8008/templates/ai-prompts-for-social-media
chatgpt prompts for resume2,1007/templates/chatgpt-prompts-for-resume
ai prompts for content creation1,5006/templates/ai-prompts-for-content-creation
chatgpt prompts for data analysis9005/templates/chatgpt-prompts-for-data-analysis

关键词分配原则:

  • 首页:主词「AI Prompt Generator」
  • 分类页:中等词「ChatGPT Prompts」「AI Prompts」
  • 模板页:长尾词,一页一个,精准匹配

🏭 Step 2:程序化SEO——批量生成100+页面

这是出海站的核心玩法。我们用代码批量生成高质量的模板页面,每个页面瞄准一个长尾关键词。

模板数据结构

创建 src/data/templates.ts

export interface PromptTemplate {
slug: string
title: string
description: string
category: string
keyword: string
searchVolume: number
prompts: {
title: string
prompt: string
explanation: string
example?: string
}[]
faqs: {
question: string
answer: string
}[]
}

export const templates: PromptTemplate[] = [
{
slug: 'ai-prompts-for-writing',
title: 'Best AI Prompts for Writing (2024)',
description: 'Discover 50+ proven AI prompts for writing blog posts, articles, novels, and more. Copy-paste ready prompts for ChatGPT & Claude.',
category: 'writing',
keyword: 'best ai prompts for writing',
searchVolume: 2900,
prompts: [
{
title: 'Blog Post Writer',
prompt: 'Act as an experienced blog writer. Write a comprehensive, SEO-optimized blog post about [TOPIC]. Include: a compelling headline, introduction with a hook, 5-7 subheadings, practical examples, and a conclusion with a CTA. Target word count: 1500 words. Tone: [professional/casual/conversational].',
explanation: 'This prompt works because it gives the AI clear structure and specific requirements, resulting in well-organized content.',
example: 'Try replacing [TOPIC] with "sustainable living tips" and see the magic happen.',
},
{
title: 'Product Description Writer',
prompt: 'Write a compelling product description for [PRODUCT]. Highlight 3 key benefits, address common objections, and include a persuasive CTA. Keep it under 150 words. Use power words that trigger emotion.',
explanation: 'Product descriptions need to sell, not just describe. This prompt focuses on benefits and emotion.',
},
// ... more prompts
],
faqs: [
{
question: 'What are the best AI prompts for writing?',
answer: 'The best AI prompts for writing include specific instructions about tone, structure, word count, and target audience. They also include examples of the desired output format.',
},
{
question: 'How do I write a good prompt for ChatGPT?',
answer: 'A good ChatGPT prompt should be specific, include context, define the role you want the AI to play, and specify the desired output format. The more detailed your prompt, the better the results.',
},
],
},
// ... 100+ more templates
]

用 Codex 批量生成模板数据

我的 Prompt:

Generate 10 prompt templates for the following categories. Each template should have 5-8 prompts and 3-4 FAQs. Output as TypeScript array matching the PromptTemplate interface.

Categories to generate:

  1. AI prompts for writing
  2. ChatGPT prompts for coding
  3. AI prompts for business
  4. ChatGPT prompts for marketing
  5. AI prompts for email writing

Codex 生成了完整的模板数据,每个模板包含:

  • SEO 优化的标题和描述
  • 5-8 个高质量 Prompt
  • 每个 Prompt 带解释和示例
  • 3-4 个 FAQ(用于 Schema 标记)

动态路由生成页面

src/app/templates/[slug]/page.tsx

import { templates } from '@/data/templates'
import { notFound } from 'next/navigation'
import { Metadata } from 'next'
import { CopyButton } from '@/components/CopyButton'
import { Breadcrumb } from '@/components/Breadcrumb'
import { RelatedTemplates } from '@/components/RelatedTemplates'
import { FAQSection } from '@/components/FAQSection'

// 静态生成所有模板页面
export async function generateStaticParams() {
return templates.map((t) => ({ slug: t.slug }))
}

// 动态生成 SEO meta
export async function generateMetadata({
params
}: {
params: { slug: string }
}): Promise<Metadata> {
const template = templates.find(t => t.slug === params.slug)
if (!template) return {}

return {
title: template.title,
description: template.description,
keywords: [template.keyword, ...template.keyword.split(' ')],
openGraph: {
title: template.title,
description: template.description,
url: `https://aipromptgenerator.com/templates/${template.slug}`,
type: 'article',
},
twitter: {
card: 'summary_large_image',
title: template.title,
description: template.description,
},
}
}

export default function TemplatePage({
params
}: {
params: { slug: string }
}) {
const template = templates.find(t => t.slug === params.slug)
if (!template) notFound()

const relatedTemplates = templates
.filter(t => t.category === template.category && t.slug !== template.slug)
.slice(0, 3)

return (
<main className="mx-auto max-w-4xl px-4 py-8">
<Breadcrumb items={[
{ label: 'Home', href: '/' },
{ label: 'Templates', href: '/templates' },
{ label: template.title, href: `/templates/${template.slug}` },
]} />

<article className="mt-8">
<h1 className="text-4xl font-bold text-gray-900">{template.title}</h1>
<p className="mt-4 text-lg text-gray-600">{template.description}</p>
<p className="mt-2 text-sm text-gray-500">
{template.prompts.length} prompts • Updated January 2024
</p>

{/* Table of Contents */}
<nav className="mt-8 rounded-xl border border-gray-200 bg-gray-50 p-6">
<h2 className="font-semibold text-gray-900">Table of Contents</h2>
<ul className="mt-3 space-y-2">
{template.prompts.map((p, i) => (
<li key={i}>
<a href={`#prompt-${i}`} className="text-violet-600 hover:underline">
{i + 1}. {p.title}
</a>
</li>
))}
</ul>
</nav>

{/* Prompts */}
<section className="mt-12 space-y-8">
{template.prompts.map((prompt, i) => (
<div key={i} id={`prompt-${i}`} className="scroll-mt-24">
<h2 className="text-2xl font-bold text-gray-900">
{i + 1}. {prompt.title}
</h2>
<p className="mt-2 text-gray-600">{prompt.explanation}</p>
<div className="mt-4 rounded-xl border border-violet-200 bg-violet-50 p-6">
<pre className="whitespace-pre-wrap text-sm text-gray-800">
{prompt.prompt}
</pre>
<CopyButton text={prompt.prompt} />
</div>
{prompt.example && (
<p className="mt-3 text-sm text-gray-500 italic">
💡 Pro tip: {prompt.example}
</p>
)}
</div>
))}
</section>

{/* FAQ Section */}
<FAQSection faqs={template.faqs} />

{/* Related Templates */}
<RelatedTemplates templates={relatedTemplates} />
</article>
</main>
)
}

生成 100+ 模板页面的关键词列表

// src/data/keywords.ts
export const longTailKeywords = [
// Writing
'ai prompts for writing',
'chatgpt prompts for essay writing',
'ai prompts for blog writing',
'chatgpt prompts for creative writing',
'ai prompts for copywriting',
'chatgpt prompts for academic writing',
'ai prompts for technical writing',
'chatgpt prompts for story writing',

// Coding
'chatgpt prompts for coding',
'ai prompts for python',
'chatgpt prompts for javascript',
'ai prompts for react',
'chatgpt prompts for sql',
'ai prompts for debugging',
'chatgpt prompts for code review',
'ai prompts for api development',

// Marketing
'chatgpt prompts for marketing',
'ai prompts for social media',
'chatgpt prompts for seo',
'ai prompts for email marketing',
'chatgpt prompts for ad copy',
'ai prompts for content marketing',
'chatgpt prompts for brand strategy',

// Business
'ai prompts for business',
'chatgpt prompts for business plan',
'ai prompts for startup',
'chatgpt prompts for presentations',
'ai prompts for market research',
'chatgpt prompts for financial analysis',

// Education
'chatgpt prompts for students',
'ai prompts for teachers',
'chatgpt prompts for research',
'ai prompts for studying',
'chatgpt prompts for lesson plans',

// And 60+ more...
]

用 Codex 为每个关键词生成对应的模板数据,然后通过 generateStaticParams 静态生成所有页面。一次编码,100+页面自动上线。


🔧 Step 3:On-Page 优化实操

Title 标签优化

// ❌ 不好的 title
<title>Home</title>

// ✅ 好的 title
<title>AI Prompt Generator - Create Perfect Prompts for ChatGPT & Claude | Free Tool</title>

Title 规则:

  • 主关键词在最前面
  • 包含副关键词(ChatGPT, Claude)
  • 长度 50-60 字符
  • 每个页面的 title 唯一

Meta Description 优化

// ❌ 不好的 description
<meta name="description" content="Welcome to our website" />

// ✅ 好的 description
<meta name="description" content="Generate optimized AI prompts in seconds. 500+ free templates for ChatGPT, Claude & Gemini. Perfect for writers, developers, and marketers. Try now!" />

Description 规则:

  • 包含主关键词
  • 有行动号召(Try now!)
  • 长度 150-160 字符
  • 唯一、不重复

H1 标签优化

// ❌ 不好的 H1
<h1>Welcome</h1>

// ✅ 好的 H1
<h1>Best AI Prompts for Writing (2024)</h1>

H1 规则:

  • 每页只有一个 H1
  • 包含目标关键词
  • 和 Title 不完全相同但语义相关

Schema 结构化标记

添加 FAQ Schema,让 Google 在搜索结果中展示你的 FAQ:

// src/components/FAQSection.tsx
export function FAQSection({ faqs }: { faqs: { question: string; answer: string }[] }) {
const schema = {
'@context': 'https://schema.org',
'@type': 'FAQPage',
mainEntity: faqs.map(faq => ({
'@type': 'Question',
name: faq.question,
acceptedAnswer: {
'@type': 'Answer',
text: faq.answer,
},
})),
}

return (
<section className="mt-12">
<script
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(schema) }}
/>
<h2 className="text-2xl font-bold text-gray-900">
Frequently Asked Questions
</h2>
<dl className="mt-6 space-y-6">
{faqs.map((faq, i) => (
<div key={i} className="rounded-xl border border-gray-200 p-6">
<dt className="font-semibold text-gray-900">{faq.question}</dt>
<dd className="mt-2 text-gray-600">{faq.answer}</dd>
</div>
))}
</dl>
</section>
)
}

面包屑导航

// src/components/Breadcrumb.tsx
export function Breadcrumb({ items }: {
items: { label: string; href: string }[]
}) {
const schema = {
'@context': 'https://schema.org',
'@type': 'BreadcrumbList',
itemListElement: items.map((item, i) => ({
'@type': 'ListItem',
position: i + 1,
name: item.label,
item: `https://aipromptgenerator.com${item.href}`,
})),
}

return (
<>
<script
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(schema) }}
/>
<nav className="flex items-center gap-2 text-sm text-gray-500">
{items.map((item, i) => (
<span key={i} className="flex items-center gap-2">
{i > 0 && <span>/</span>}
{i === items.length - 1 ? (
<span className="text-gray-900">{item.label}</span>
) : (
<a href={item.href} className="hover:text-violet-600">
{item.label}
</a>
)}
</span>
))}
</nav>
</>
)
}

内部链接策略

每个模板页面底部都有「Related Templates」组件,自动推荐同分类的其他模板:

// src/components/RelatedTemplates.tsx
export function RelatedTemplates({ templates }: { templates: PromptTemplate[] }) {