| 值 | content 範例 | 作用 | 建議 |
|---|---|---|---|
| Content-Type | text/html; charset=UTF-8 | 宣告編碼 (HTML5 用 `` 取代) | 改用 charset 屬性 |
| X-UA-Compatible | IE=edge | 指定 IE 渲染引擎 (Edge 模式) | IE 已淘汰,可移除 |
| refresh | 5;url=https://example.com | 延遲導向 | 不建議,用 301/302/JS |
| Cache-Control | no-store, must-revalidate | 快取控制 | 建議用 HTTP 標頭 |
| Content-Security-Policy | default-src 'self'; script-src 'self' https://cdn.example.com | CSP 防 XSS | 建議用 HTTP 標頭,避免 meta 限制 |
| Set-Cookie | name=value; Secure; HttpOnly; SameSite=Lax | 設定 Cookie | 建議用 HTTP 標頭 |
| name | content 範例 | 用途 |
|---|---|---|
| viewport | width=device-width, initial-scale=1.0 | RWD 視口控制 (必填) |
| description | 頁面摘要,150 字內 | 搜尋結果片段、社群預覽 |
| keywords | 關鍵字1, 關鍵字2 | 舊式 SEO,現代權重極低 |
| robots | index, follow / noindex, nofollow | 爬蟲指令 (配合 robots.txt) |
| author | 作者名稱 | 作者資訊 |
| generator | 工具名稱 (如 WordPress 6.4) | 識別產生器 |
| theme-color | #0d6efd | 瀏覽器標籤/工具列顏色 (Chrome/Android) |
| color-scheme | light dark | 宣告支援淺/深色模式 (CSS color-scheme 配合) |
| apple-mobile-web-app-capable | yes | iOS PWA 全螢幕 |
| apple-mobile-web-app-status-bar-style | black-translucent | iOS 狀態列樣式 |
| apple-mobile-web-app-title | App 名稱 | iOS 主畫面圖示標題 |
| format-detection | telephone=no | 禁用 iOS 電話號碼自動連結 |
<meta property="og:type" content="article">
<meta property="og:title" content="文章標題">
<meta property="og:description" content="文章摘要">
<meta property="og:image" content="https://example.com/og.jpg">
<meta property="og:url" content="https://example.com/article">
<meta property="article:published_time" content="2024-01-15T08:00:00+08:00">
<meta property="article:author" content="作者名">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@username">
<meta name="twitter:creator" content="@author">