首页 SEO营销工具 Meta标签生成器

Meta标签生成器

Meta Tag Generator

自动生成完整的SEO meta标签,支持Open Graph和Twitter Card

Generate complete SEO meta tags with Open Graph and Twitter Card support

🌐 基础信息

🌐 Basic Information

0 / 60
0 / 160

📱 Open Graph 标签

📱 Open Graph Tags

🐦 Twitter Card 标签

🐦 Twitter Card Tags

📋 常用模板

📋 Common Templates

点击上方模板按钮加载预设数据

Click a template button above to load preset data

🔍 搜索引擎预览

🔍 Search Engine Preview

Your Page Title
https://example.com
Your page description will appear here. Make sure it's compelling and includes relevant keywords.

📱 社交媒体预览

📱 Social Media Preview

💡 提示:Title建议控制在60字符以内,Description建议控制在160字符以内,以获得最佳展示效果。
💡 Tip: Keep title under 60 characters and description under 160 characters for best display in search results.

🏷️ 相关标签

免费网页开发隐私安全SEO站长工具纯前端生成器在线工具
`; const blob = new Blob([fullHtml], { type: 'text/html' }); const url = URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = 'meta-tags.html'; a.click(); URL.revokeObjectURL(url); } function clearForm() { document.querySelectorAll('input, textarea').forEach(el => el.value = ''); document.getElementById('robots').value = 'index, follow'; document.getElementById('ogType').value = 'website'; document.getElementById('ogLocale').value = 'zh_CN'; document.getElementById('twitterCard').value = 'summary'; document.getElementById('metaResult').textContent = ''; updatePreview(); } function loadTemplate(type) { const templates = { blog: { title: '10 Tips for Better Content Writing', url: 'https://example.com/blog/content-writing-tips', desc: 'Discover the top 10 expert tips for creating engaging content that ranks. Learn SEO best practices and writing techniques from industry professionals.', keywords: 'content writing, SEO tips, blog writing, copywriting', author: 'John Smith', ogType: 'article', ogTitle: '10 Tips for Better Content Writing | Expert Guide', ogImage: 'https://images.unsplash.com/photo-1455390582262-044cdead277a?w=1200', twitterCard: 'summary_large_image', twitterCreator: '@johnsmith' }, product: { title: 'Premium Wireless Headphones | TechGear Pro', url: 'https://shop.example.com/headphones/pro-x1', desc: 'Experience crystal-clear sound with our Premium Wireless Headphones. 40-hour battery life, active noise cancellation, and premium comfort. Free shipping available.', keywords: 'wireless headphones, noise cancelling, premium audio', author: 'TechGear Pro', ogType: 'product', ogImage: 'https://images.unsplash.com/photo-1505740420928-5e560c06d30e?w=1200', twitterCard: 'summary_large_image', twitterSite: '@techgearpro' }, portfolio: { title: 'Jane Doe - UI/UX Designer & Developer', url: 'https://janedoe.design', desc: 'Award-winning UI/UX designer with 8+ years of experience creating beautiful, user-centered digital experiences for global brands.', keywords: 'UI design, UX design, portfolio, web developer', author: 'Jane Doe', ogType: 'website', ogImage: 'https://images.unsplash.com/photo-1561070791-2526d30994b5?w=1200', twitterCard: 'summary_large_image', twitterCreator: '@janedoedesign' }, news: { title: 'Breaking: Major Tech Company Announces Revolutionary AI Product', url: 'https://news.example.com/tech/ai-announcement-2025', desc: 'In a landmark announcement today, TechCorp unveiled their latest AI-powered product line, promising to transform how we interact with technology.', keywords: 'AI, technology, tech news, innovation', author: 'News Team', ogType: 'article', ogImage: 'https://images.unsplash.com/photo-1485827404703-89b55fcc595e?w=1200', twitterCard: 'summary_large_image', twitterSite: '@newsfeed' }, video: { title: 'How to Master Photography in 30 Days | Complete Course', url: 'https://learn.example.com/courses/photography-masterclass', desc: 'Join our comprehensive 30-day photography course and learn everything from camera basics to advanced composition techniques. Includes practical assignments.', keywords: 'photography course, learn photography, camera tutorial', author: 'ProPhoto Academy', ogType: 'video', ogImage: 'https://images.unsplash.com/photo-1452780212940-6f5c0d14d848?w=1200', twitterCard: 'summary_large_image', twitterSite: '@prophotoacademy' } }; const t = templates[type]; if (t) { document.getElementById('siteTitle').value = t.title; document.getElementById('siteUrl').value = t.url; document.getElementById('siteDesc').value = t.desc; document.getElementById('keywords').value = t.keywords; document.getElementById('author').value = t.author; document.getElementById('ogType').value = t.ogType; document.getElementById('ogTitle').value = t.ogTitle; document.getElementById('ogImage').value = t.ogImage; document.getElementById('twitterCard').value = t.twitterCard; document.getElementById('twitterSite').value = t.twitterSite || ''; document.getElementById('twitterCreator').value = t.twitterCreator || ''; updatePreview(); switchTab('form'); document.getElementById('templatePreview').innerHTML = `

${document.body.classList.contains('zh') ? '已加载模板: ' : 'Loaded template: '} ${type.toUpperCase()}

${document.body.classList.contains('zh') ? '点击"生成Meta标签"查看结果' : 'Click "Generate Meta Tags" to see the result'}

`; } } function showToast(msg) { const toast = document.createElement('div'); toast.style.cssText = 'position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #10B981; color: white; padding: 12px 24px; border-radius: 8px; z-index: 1000;'; toast.textContent = msg; document.body.appendChild(toast); setTimeout(() => toast.remove(), 2000); } // Initialize updatePreview();