ITOBEN STYLE > EC-CUBE4 > EC-CUBEデフォルト:メタ設定の検証 2026年5月8日カテゴリー: EC-CUBE4 EC-CUBEデフォルト:メタ設定の検証 EC-CUBE4.3.1で検証 (1)トップページ ① メタ設定の入力ボックスに何も入力しないと、 <title>サンプルサイト / TOPページ</title> <meta property=”og:type” content=”website”/> <meta property=”og:site_name” content=”サンプルサイト”/> <meta property=”og:url” content=”https://sample.com/”/> <link rel=”canonical” href=”https://sample.com/” /> ② metatagを除いて、4つのボックスに入力すると、赤字が追加される。 <title>サンプルサイト / TOPページ</title> <meta property=”og:type” content=”website”/> <meta property=”og:site_name” content=”サンプルサイト”/> <meta name=”description” content=”トップページdescription”> <meta property=”og:description” content=”トップページdescription”/> <meta property=”og:url” content=”https://sample.com/”/> <link rel=”canonical” href=”https://sample.com/” /> <meta name=”author” content=”トップページauthor”> <meta name=”keywords” content=”トップページkeyword”> <meta name=”robots” content=”トップページrobot”> ③ 続けて、metatagに「テスト」と入力すると、OGPタグとカノニカルが表示されない。 <title>サンプルサイト / TOPページ</title> テスト <meta name=”description” content=”トップページdescription”> <meta name=”author” content=”トップページauthor”> <meta name=”keywords” content=”トップページkeyword”> <meta name=”robots” content=”トップページrobot”> ④ そこで、metatagに個別のOGPとカノニカルを入力(下記)すると、 {% set meta_canonical = url(‘homepage’) %} <meta property=”og:title” content=”{{ BaseInfo.shop_name }}” /> <meta property=”og:description” content=”{{ Page.description }}” /> <meta property=”og:type” content=”website” /> <meta property=”og:site_name” content=”{{ BaseInfo.shop_name }}” /> <meta property=”og:url” content=”{{ meta_canonical }}” /> <meta property=”og:image” content=”表示させたい画像の個別URL” /> <link rel=”canonical” href=”{{ meta_canonical }}” /> ↓結果 <title>サンプルサイト / TOPページ</title> <meta property=”og:title” content=”サンプルサイト” /> <meta property=”og:description” content=”トップページdescription” /> <meta property=”og:type” content=”website” /> <meta property=”og:site_name” content=”サンプルサイト” /> <meta property=”og:url” content=”https://sample.com/” /> <meta property=”og:image” content=”表示させたい画像の個別URL” /> <link rel=”canonical” href=”https://sample.com/” /> <meta name=”description” content=”トップページdescription”> <meta name=”author” content=”トップページauthor”> <meta name=”keywords” content=”トップページkeyword”> <meta name=”robots” content=”トップページrobot”> (2)商品詳細ページ ① メタ設定の入力ボックスに何も入力しないと、 <title>サンプルサイト / チェリーアイスサンド1</title> <meta property=”og:title” content=”チェリーアイスサンド1″ /> <meta property=”og:image” content=”https://sample.com/html/upload/save_image/sand-1.png” /> <meta property=”product:price:amount” content=”3080″/> <meta property=”product:price:currency” content=”JPY”/> <meta property=”product:product_link” content=”https://sample.com/products/detail/2″/> <meta property=”product:retailer_title” content=”サンプルサイト”/> <meta property=”og:type” content=”og:product”/> <meta property=”og:site_name” content=”サンプルサイト”/> <meta name=”description” content=”チェリーアイスサンドは北海道産のチェリーのアイスをサクサクのクッキーでサンドしたスイーツです。 立方体なので大量に持ち運ぶときも便利です。 いまだけ、頑丈な箱つきです。”> <meta property=”og:description” content=”チェリーアイスサンドは北海道産のチェリーのアイスをサクサクのクッキーでサンドしたスイーツです。 立方体なので大量に持ち運ぶときも便利です。 いまだけ、頑丈な箱つきです。”/> <meta property=”og:url” content=”https://sample.com/products/detail/2″/> <link rel=”canonical” href=”https://sample.com/products/detail/2″ /> ② metatagを除いて、4つのボックスに入力すると、赤字が追加される。 <title>サンプルサイト / チェリーアイスサンド1</title> <meta property=”og:title” content=”チェリーアイスサンド1″ /> <meta property=”og:image” content=”https://sample.com/html/upload/save_image/sand-1.png” /> <meta property=”product:price:amount” content=”3080″/> <meta property=”product:price:currency” content=”JPY”/> <meta property=”product:product_link” content=”https://sample.com/products/detail/2″/> <meta property=”product:retailer_title” content=”サンプルサイト”/> <meta property=”og:type” content=”og:product”/> <meta property=”og:site_name” content=”サンプルサイト”/> <meta name=”description” content=”チェリーアイスサンドは北海道産のチェリーのアイスをサクサクのクッキーでサンドしたスイーツです。 立方体なので大量に持ち運ぶときも便利です。 いまだけ、頑丈な箱つきです。”> <meta property=”og:description” content=”チェリーアイスサンドは北海道産のチェリーのアイスをサクサクのクッキーでサンドしたスイーツです。 立方体なので大量に持ち運ぶときも便利です。 いまだけ、頑丈な箱つきです。”/> <meta property=”og:url” content=”https://sample.com/products/detail/2″/> <link rel=”canonical” href=”https://sample.com/products/detail/2″ /> <meta name=”author” content=”商品詳細ページ管理author”> <meta name=”keywords” content=”商品詳細ページ管理keyword”> <meta name=”robots” content=”商品詳細ページ管理robot”> ※ メタ設定のdescriptionの入力内容が反映されず、商品説明のまま。 ③ 続けて、metatagに「テスト」と入力すると、OGPタグとカノニカルが表示されない。 <title>サンプルサイト / チェリーアイスサンド2</title> テスト <meta name=”description” content=”商品詳細ページ管理description”> <meta name=”author” content=”商品詳細ページ管理author”> <meta name=”keywords” content=”商品詳細ページ管理keyword”> <meta name=”robots” content=”商品詳細ページ管理robot”> ④ そこで、metatagに個別のOGPとカノニカルを入力(下記)すると、 {% set meta_og_type = “og:product” %} {% set meta_description = Product.description_list | default(Product.description_detail) | default(Page.description) %} {% set meta_canonical = url(‘product_detail’, {‘id’: Product.id}) %} <meta property=”og:title” content=”{{ Product.name }}” /> <meta property=”og:image” content=”{{ absolute_url(asset(Product.main_list_image|no_image_product, ‘save_image’)) }}” /> <meta property=”product:price:amount” content=”{{ Product.getPrice02IncTaxMin }}”/> <meta property=”product:price:currency” content=”{{ eccube_config.currency }}”/> <meta property=”product:product_link” content=”{{ url(‘product_detail’, {‘id’: Product.id}) }}”/> <meta property=”product:retailer_title” content=”{{ BaseInfo.shop_name }}”/> <meta property=”og:type” content=”website” /> <meta property=”og:site_name” content=”{{ BaseInfo.shop_name }}” /> <meta property=”og:description” content=”{{ Page.description }}” /> <meta property=”og:url” content=”{{ meta_canonical }}” /> <link rel=”canonical” href=”{{ meta_canonical }}” /> ↓結果 <title>サンプルサイト / チェリーアイスサンド1</title> <meta property=”og:title” content=”チェリーアイスサンド1″ /> <meta property=”og:image” content=”https://sample.com/html/upload/save_image/sand-1.png” /> <meta property=”product:price:amount” content=”3080″/> <meta property=”product:price:currency” content=”JPY”/> <meta property=”product:product_link” content=”https://sample.com/products/detail/2″/> <meta property=”product:retailer_title” content=”サンプルサイト”/> <meta property=”og:type” content=”website” /> <meta property=”og:site_name” content=”サンプルサイト” /> <meta property=”og:description” content=”商品詳細ページ管理description” /> <meta property=”og:url” content=”https://sample.com/products/detail/2″ /> <link rel=”canonical” href=”https://sample.com/products/detail/2″ /> <meta name=”description” content=”商品詳細ページ管理description”> <meta name=”author” content=”商品詳細ページ管理author”> <meta name=”keywords” content=”商品詳細ページ管理keyword”> <meta name=”robots” content=”商品詳細ページ管理robot”> (3)商品一覧ページ ① メタ設定の入力ボックスに何も入力しないと、 <title>サンプルサイト / 新入荷</title> <meta property=”og:type” content=”article”/> <meta property=”og:site_name” content=”サンプルサイト”/> <meta property=”og:url” content=”https://sample.com/products/list?category_id=2″/> <link rel=”next” href=”https://sample.com/products/list?category_id=2&pageno=2″ title=”新入荷 2ページ目”> <link rel=”canonical” href=”https://sample.com/products/list?category_id=2″ /> ② metatagを除いて、4つのボックスに入力すると、赤字が追加される。 <title>サンプルサイト / 新入荷</title> <meta property=”og:type” content=”article”/> <meta property=”og:site_name” content=”サンプルサイト”/> <meta name=”description” content=”商品一覧description”> <meta property=”og:description” content=”商品一覧description”/> <meta property=”og:url” content=”https://sample.com/products/list?category_id=2″/> <link rel=”next” href=”https://sample.com/products/list?category_id=2&pageno=2″ title=”新入荷 2ページ目”> <link rel=”canonical” href=”https://sample.com/products/list?category_id=2″ /> <meta name=”author” content=”商品一覧author”> <meta name=”keywords” content=”商品一覧keyword”> <meta name=”robots” content=”商品一覧robot”> ③ 続けて、metatagに「テスト」と入力すると、OGPタグとカノニカル、ページネーションが表示されない。 <title>サンプルサイト / 新入荷</title> テスト <meta name=”description” content=”商品一覧description”> <meta name=”author” content=”商品一覧author”> <meta name=”keywords” content=”商品一覧keyword”> <meta name=”robots” content=”商品一覧robot”> ④ そこで、metatagに個別のOGPとカノニカルを入力(下記)すると、 (ページネーションを組み込むことが出来ない) {% set meta_canonical = url(‘product_list’, {‘category_id’: Category.id|default(null)}) %} <meta property=”og:title” content=”{{ Category.name }}” /> <meta property=”og:description” content=”{{ Page.description }}” /> <meta property=”og:type” content=”article” /> <meta property=”og:url” content=”{{ meta_canonical }}”/> <meta property=”og:image” content=”表示させたい画像の個別URL” /> <meta property=”og:site_name” content=”{{ BaseInfo.shop_name }}” /> <link rel=”canonical” href=”{{ meta_canonical }}” /> ↓結果 <title>サンプルサイト / 新入荷</title> <meta property=”og:title” content=”新入荷” /> <meta property=”og:description” content=”商品一覧description” /> <meta property=”og:type” content=”article” /> <meta property=”og:url” content=”https://sample.com/products/list?category_id=2″/> <meta property=”og:image” content=”表示させたい画像の個別URL” /> <meta property=”og:site_name” content=”サンプルサイト” /> <link rel=”canonical” href=”https://sample.com/products/list?category_id=2″ /> <meta name=”description” content=”商品一覧description”> <meta name=”author” content=”商品一覧author”> <meta name=”keywords” content=”商品一覧keyword”> <meta name=”robots” content=”商品一覧robot”> 検証結果 metatagについて 入力する場合は、twigで利用されている変数を記述する必要がある。 商品一覧ページでは、ページネーションを組み込むことが出来ない。 特別な理由がない限り、metatagの入力は不要でしょう。 商品詳細・商品一覧 設定しないよりは、設定した方がよいと思うが、各商品ページや各カテゴリページでは同じ内容のdescription・author・keywords・robotsが表示される。 各ページごとに個別のメタを設定したい場合は、下記プラグインを利用して下さい。 商品一覧・詳細ページSEO対策(独自titleタグ・独自メタ設定)プラグイン
<title>サンプルサイト / TOPページ</title>
<meta property=”og:type” content=”website”/>
<meta property=”og:site_name” content=”サンプルサイト”/>
<meta property=”og:url” content=”https://sample.com/”/>
<link rel=”canonical” href=”https://sample.com/” />
<title>サンプルサイト / TOPページ</title>
<meta property=”og:type” content=”website”/>
<meta property=”og:site_name” content=”サンプルサイト”/>
<meta name=”description” content=”トップページdescription”>
<meta property=”og:description” content=”トップページdescription”/>
<meta property=”og:url” content=”https://sample.com/”/>
<link rel=”canonical” href=”https://sample.com/” />
<meta name=”author” content=”トップページauthor”>
<meta name=”keywords” content=”トップページkeyword”>
<meta name=”robots” content=”トップページrobot”>
<title>サンプルサイト / TOPページ</title>
テスト
<meta name=”description” content=”トップページdescription”>
<meta name=”author” content=”トップページauthor”>
<meta name=”keywords” content=”トップページkeyword”>
<meta name=”robots” content=”トップページrobot”>
{% set meta_canonical = url(‘homepage’) %}
<meta property=”og:title” content=”{{ BaseInfo.shop_name }}” />
<meta property=”og:description” content=”{{ Page.description }}” />
<meta property=”og:type” content=”website” />
<meta property=”og:site_name” content=”{{ BaseInfo.shop_name }}” />
<meta property=”og:url” content=”{{ meta_canonical }}” />
<meta property=”og:image” content=”表示させたい画像の個別URL” />
<link rel=”canonical” href=”{{ meta_canonical }}” />
<title>サンプルサイト / TOPページ</title>
<meta property=”og:title” content=”サンプルサイト” />
<meta property=”og:description” content=”トップページdescription” />
<meta property=”og:type” content=”website” />
<meta property=”og:site_name” content=”サンプルサイト” />
<meta property=”og:url” content=”https://sample.com/” />
<meta property=”og:image” content=”表示させたい画像の個別URL” />
<link rel=”canonical” href=”https://sample.com/” />
<meta name=”description” content=”トップページdescription”>
<meta name=”author” content=”トップページauthor”>
<meta name=”keywords” content=”トップページkeyword”>
<meta name=”robots” content=”トップページrobot”>
<title>サンプルサイト / チェリーアイスサンド1</title>
<meta property=”og:title” content=”チェリーアイスサンド1″ />
<meta property=”og:image” content=”https://sample.com/html/upload/save_image/sand-1.png” />
<meta property=”product:price:amount” content=”3080″/>
<meta property=”product:price:currency” content=”JPY”/>
<meta property=”product:product_link” content=”https://sample.com/products/detail/2″/>
<meta property=”product:retailer_title” content=”サンプルサイト”/>
<meta property=”og:type” content=”og:product”/>
<meta property=”og:site_name” content=”サンプルサイト”/>
<meta name=”description” content=”チェリーアイスサンドは北海道産のチェリーのアイスをサクサクのクッキーでサンドしたスイーツです。
立方体なので大量に持ち運ぶときも便利です。
いまだけ、頑丈な箱つきです。”>
<meta property=”og:description” content=”チェリーアイスサンドは北海道産のチェリーのアイスをサクサクのクッキーでサンドしたスイーツです。
立方体なので大量に持ち運ぶときも便利です。
いまだけ、頑丈な箱つきです。”/>
<meta property=”og:url” content=”https://sample.com/products/detail/2″/>
<link rel=”canonical” href=”https://sample.com/products/detail/2″ />
<title>サンプルサイト / チェリーアイスサンド1</title>
<meta property=”og:title” content=”チェリーアイスサンド1″ />
<meta property=”og:image” content=”https://sample.com/html/upload/save_image/sand-1.png” />
<meta property=”product:price:amount” content=”3080″/>
<meta property=”product:price:currency” content=”JPY”/>
<meta property=”product:product_link” content=”https://sample.com/products/detail/2″/>
<meta property=”product:retailer_title” content=”サンプルサイト”/>
<meta property=”og:type” content=”og:product”/>
<meta property=”og:site_name” content=”サンプルサイト”/>
<meta name=”description” content=”チェリーアイスサンドは北海道産のチェリーのアイスをサクサクのクッキーでサンドしたスイーツです。
立方体なので大量に持ち運ぶときも便利です。
いまだけ、頑丈な箱つきです。”>
<meta property=”og:description” content=”チェリーアイスサンドは北海道産のチェリーのアイスをサクサクのクッキーでサンドしたスイーツです。
立方体なので大量に持ち運ぶときも便利です。
いまだけ、頑丈な箱つきです。”/>
<meta property=”og:url” content=”https://sample.com/products/detail/2″/>
<link rel=”canonical” href=”https://sample.com/products/detail/2″ />
<meta name=”author” content=”商品詳細ページ管理author”>
<meta name=”keywords” content=”商品詳細ページ管理keyword”>
<meta name=”robots” content=”商品詳細ページ管理robot”>
※ メタ設定のdescriptionの入力内容が反映されず、商品説明のまま。
<title>サンプルサイト / チェリーアイスサンド2</title>
テスト
<meta name=”description” content=”商品詳細ページ管理description”>
<meta name=”author” content=”商品詳細ページ管理author”>
<meta name=”keywords” content=”商品詳細ページ管理keyword”>
<meta name=”robots” content=”商品詳細ページ管理robot”>
{% set meta_og_type = “og:product” %}
{% set meta_description = Product.description_list | default(Product.description_detail) | default(Page.description) %}
{% set meta_canonical = url(‘product_detail’, {‘id’: Product.id}) %}
<meta property=”og:title” content=”{{ Product.name }}” />
<meta property=”og:image” content=”{{ absolute_url(asset(Product.main_list_image|no_image_product, ‘save_image’)) }}” />
<meta property=”product:price:amount” content=”{{ Product.getPrice02IncTaxMin }}”/>
<meta property=”product:price:currency” content=”{{ eccube_config.currency }}”/>
<meta property=”product:product_link” content=”{{ url(‘product_detail’, {‘id’: Product.id}) }}”/>
<meta property=”product:retailer_title” content=”{{ BaseInfo.shop_name }}”/>
<meta property=”og:type” content=”website” />
<meta property=”og:site_name” content=”{{ BaseInfo.shop_name }}” />
<meta property=”og:description” content=”{{ Page.description }}” />
<meta property=”og:url” content=”{{ meta_canonical }}” />
<link rel=”canonical” href=”{{ meta_canonical }}” />
<title>サンプルサイト / チェリーアイスサンド1</title>
<meta property=”og:title” content=”チェリーアイスサンド1″ />
<meta property=”og:image” content=”https://sample.com/html/upload/save_image/sand-1.png” />
<meta property=”product:price:amount” content=”3080″/>
<meta property=”product:price:currency” content=”JPY”/>
<meta property=”product:product_link” content=”https://sample.com/products/detail/2″/>
<meta property=”product:retailer_title” content=”サンプルサイト”/>
<meta property=”og:type” content=”website” />
<meta property=”og:site_name” content=”サンプルサイト” />
<meta property=”og:description” content=”商品詳細ページ管理description” />
<meta property=”og:url” content=”https://sample.com/products/detail/2″ />
<link rel=”canonical” href=”https://sample.com/products/detail/2″ />
<meta name=”description” content=”商品詳細ページ管理description”>
<meta name=”author” content=”商品詳細ページ管理author”>
<meta name=”keywords” content=”商品詳細ページ管理keyword”>
<meta name=”robots” content=”商品詳細ページ管理robot”>
<title>サンプルサイト / 新入荷</title>
<meta property=”og:type” content=”article”/>
<meta property=”og:site_name” content=”サンプルサイト”/>
<meta property=”og:url” content=”https://sample.com/products/list?category_id=2″/>
<link rel=”next” href=”https://sample.com/products/list?category_id=2&pageno=2″ title=”新入荷 2ページ目”>
<link rel=”canonical” href=”https://sample.com/products/list?category_id=2″ />
<title>サンプルサイト / 新入荷</title>
<meta property=”og:type” content=”article”/>
<meta property=”og:site_name” content=”サンプルサイト”/>
<meta name=”description” content=”商品一覧description”>
<meta property=”og:description” content=”商品一覧description”/>
<meta property=”og:url” content=”https://sample.com/products/list?category_id=2″/>
<link rel=”next” href=”https://sample.com/products/list?category_id=2&pageno=2″ title=”新入荷 2ページ目”>
<link rel=”canonical” href=”https://sample.com/products/list?category_id=2″ />
<meta name=”author” content=”商品一覧author”>
<meta name=”keywords” content=”商品一覧keyword”>
<meta name=”robots” content=”商品一覧robot”>
<title>サンプルサイト / 新入荷</title>
テスト
<meta name=”description” content=”商品一覧description”>
<meta name=”author” content=”商品一覧author”>
<meta name=”keywords” content=”商品一覧keyword”>
<meta name=”robots” content=”商品一覧robot”>
(ページネーションを組み込むことが出来ない)
{% set meta_canonical = url(‘product_list’, {‘category_id’: Category.id|default(null)}) %}
<meta property=”og:title” content=”{{ Category.name }}” />
<meta property=”og:description” content=”{{ Page.description }}” />
<meta property=”og:type” content=”article” />
<meta property=”og:url” content=”{{ meta_canonical }}”/>
<meta property=”og:image” content=”表示させたい画像の個別URL” />
<meta property=”og:site_name” content=”{{ BaseInfo.shop_name }}” />
<link rel=”canonical” href=”{{ meta_canonical }}” />
<title>サンプルサイト / 新入荷</title>
<meta property=”og:title” content=”新入荷” />
<meta property=”og:description” content=”商品一覧description” />
<meta property=”og:type” content=”article” />
<meta property=”og:url” content=”https://sample.com/products/list?category_id=2″/>
<meta property=”og:image” content=”表示させたい画像の個別URL” />
<meta property=”og:site_name” content=”サンプルサイト” />
<link rel=”canonical” href=”https://sample.com/products/list?category_id=2″ />
<meta name=”description” content=”商品一覧description”>
<meta name=”author” content=”商品一覧author”>
<meta name=”keywords” content=”商品一覧keyword”>
<meta name=”robots” content=”商品一覧robot”>
入力する場合は、twigで利用されている変数を記述する必要がある。
商品一覧ページでは、ページネーションを組み込むことが出来ない。
特別な理由がない限り、metatagの入力は不要でしょう。
設定しないよりは、設定した方がよいと思うが、各商品ページや各カテゴリページでは同じ内容のdescription・author・keywords・robotsが表示される。
各ページごとに個別のメタを設定したい場合は、下記プラグインを利用して下さい。
商品一覧・詳細ページSEO対策(独自titleタグ・独自メタ設定)プラグイン