SEO

SEO教學

http://schema.org/
https://search.google.com/structured-data/testing-tool/

初始設定

  1. 先查看網站是什麼類型(例如: 產品,美術,電影…)
    到此網站https://schema.org/docs/schemas.html找符合的類型

WebSite(網站名稱)

WebSite寫法

  1. head 加上 itemscope=”itemscope” itemtype=”http://schema.org/WebSite"
  2. title 加上 itemprop=”name”
1
2
3
4
<head itemscope="itemscope" itemtype="http://schema.org/WebSite">
<meta name="copyright" content="CopyRight © All Rights Reserved."/>
<title itemprop="name">全球資訊網‧</title>
</head>

SiteNavigationElement寫法

  1. HTML5寫法

    1. ul 加上 itemscope=”itemscope” itemtype=”http://schema.org/SiteNavigationElement"

    2. li 加上 itemprop=”name”

      1
      2
      3
      4
      5
      6
      7
      <nav class="nav">
      <ul class="nav__list" itemscope="itemscope" itemtype="http://schema.org/SiteNavigationElement">
      <li itemprop="name"><a class="nav__link" href="../XXX.html" itemprop="url">連結A</a></li>
      <li itemprop="name"><a class="nav__link" href="../XXX.html" itemprop="url">連結B</a></li>
      <li itemprop="name"><a class="nav__link" href="../XXX.html" itemprop="url">連結C</a></li>
      </ul>
      </nav>
  2. JSON寫法

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    <!-- 網站導航架構標記 SiteNavigationElement-->
    <script type="application/ld+json">
    {
    "@context": "https://schema.org",
    "@type":"ItemList",
    "itemListElement":
    [
    {
    "@context": "https://schema.org",
    "@type":"SiteNavigationElement",
    "position":1,
    "name": "選單1",
    "url": "http://選單連結"
    },
    {
    "@context": "https://schema.org",
    "@type":"SiteNavigationElement",
    "position":2,
    "name": "選單2",
    "url": "http://選單連結"
    },
    {
    "@context": "https://schema.org",
    "@type":"SiteNavigationElement",
    "position":3,
    "name": "選單3",
    "url": "http://選單連結"
    ]
    }
    </script>

BreadcrumbList寫法

  1. 直接使用javascript json格式
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<!-- BreadcrumbList -->
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [{
"@type": "ListItem",
"position": 1,
"item": {
"@id": "http://網站地址",
"name": "全球資訊網"
}
}]
}
</script>

網站類型(例如: Product, ArtGallery, Store…)

網站類型寫法

  1. 直接使用javascript json格式
  2. “@type”: “網站類型”
  3. 參照網站類型屬性填寫
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<!-- ProfessionalService -->
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Store",
"url": "http://網站地址",
"sameAs":[
"https://www.facebook.com/XXX",
"https://www.facebook.com/XXX",
"https://www.facebook.com/XXX",
"https://www.facebook.com/XXX",
"https://www.facebook.com/XXX",
"https://www.facebook.com/XXX",
"https://www.youtube.com/XXX"
],
"name": "網站名稱",
"description": "主題說明",
"logo": "http://連結/img/logo_menu.png",
"image": "http://連結/upload/F2E/home/windows_01_715_445.jpg",
"email": "email@gmail.com",
"address": {
"@type": "PostalAddress",
"addressCountry": "台灣 Taiwan",
"addressLocality": "XX市 XX City",
"addressRegion": "XX區",
"postalCode": "郵遞區號",
"streetAddress": "XX路X段XX號 No. XXX, Sec. X, XX Rd"
},
"telephone": "+886 X XXXX-XXXX",
"hasMap": "https://www.google.com/maps/place/googleMap",
"priceRange": "$0 - $2,000,000,000",
"geo": {
"@type": "GeoCoordinates",
"latitude": "XX.XXXXXX",
"longitude": "XXX0.XXXXXX"
}
}
分享到