← ブログ一覧

Shopify サイトを AI エージェント対応にする 5 ステップ

Shopify ストアを ChatGPT / Claude / Perplexity から正しく読まれる状態にするための 5 つの実装手順を、Liquid テンプレートのコード例とともに解説します。

·2·YomuScore 編集部

Shopify ストアは標準で sitemap.xml や Product / Article の JSON-LD が出力されるので、「基本的な SEO」は最初から備わっている。一方で AI エージェント対応の観点では、サイトルートにファイルを置けないなど Shopify 特有の制約があって、追加の実装がいくつか必要になる。

本記事では Shopify ストアを Grade B 以上に持っていくための 5 つのステップを、Liquid のコード例とともに書いていく。Dawn / Sense / Refresh のような主要テーマを前提にしているが、カスタムテーマでも考え方は同じだ。所要時間は全部で 2〜3 時間、テーマファイルの編集に慣れている人なら 1 時間くらいで終わる。

ステップ 1: robots.txt で AI ボットを明示許可 (15 分)

Shopify は /robots.txt を自動生成するが、デフォルトでは AI ボットを明示許可しない。templates/robots.txt.liquid をテーマファイルとして作成すると、Shopify 公式が認める唯一の方法でデフォルトの内容を上書きできる。

Shopify 管理画面 → オンラインストア → テーマ → 現在のテーマで「コードを編集」をクリック。左側のファイルツリーで Templates フォルダを探し、「新しいテンプレートを追加」から種別 robots.txt を選んで、ファイル名は robots.txt のまま保存する (拡張子は自動で .liquid が付く)。中身はこれ。

{% comment %}
  Shopify default groups + explicit allow for AI crawlers.
  See: https://shopify.dev/docs/storefronts/themes/seo/robots-txt
{% endcomment %}

{{ robots.default_groups }}

User-agent: GPTBot
Allow: /

User-agent: OAI-SearchBot
Allow: /

User-agent: ChatGPT-User
Allow: /

User-agent: ClaudeBot
Allow: /

User-agent: Google-Extended
Allow: /

User-agent: PerplexityBot
Allow: /

User-agent: CCBot
Allow: /

保存後、ブラウザで https://yourstore.myshopify.com/robots.txt を開いて、AI ボットの Allow ブロックが末尾に追加されていることを確認すれば完了。{{ robots.default_groups }} が Shopify 標準の Disallow ルール (admin / cart / checkout など) をそのまま維持してくれるので、安心して上書きできる。robots.txt の書き方のもっと細かい話は GPTBot / ClaudeBot / Google-Extended を robots.txt で許可する正しい書き方 を参照してほしい。

ステップ 2: Organization JSON-LD を theme.liquid に埋め込む (20 分)

Shopify の主要テーマ (Dawn / Sense / Refresh) は Product と Article のスキーマを各テンプレートで出力するが、Organization スキーマがトップページや About ページに無い、というのが共通の弱点だ。AI エージェントは「このサイトを運営しているのは誰か」を Organization スキーマから把握するので、全ページで出しておく価値がある。

テーマ → コードを編集 → Layout → theme.liquid を開いて、</head> の直前にこれを追加する。

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Organization",
  "name": {{ shop.name | json }},
  "url": {{ shop.url | json }},
  "logo": {{ shop.brand.logo.image.src | image_url: width: 600 | json | default: "https://yourstore.example/logo.png" | json }},
  "description": {{ shop.description | default: "" | json }},
  "sameAs": [
    "https://twitter.com/yourbrand",
    "https://www.facebook.com/yourbrand",
    "https://www.instagram.com/yourbrand"
  ],
  "contactPoint": [{
    "@type": "ContactPoint",
    "contactType": "customer support",
    "email": "support@yourstore.example",
    "availableLanguage": ["ja", "en"]
  }]
}
</script>

{{ shop.name | json }} のような Liquid 変数は実際の店舗名や URL に展開される。sameAs の URL と contactPoint の email は実値に書き換えてほしい。保存したら商品ページのソースを表示して、JSON-LD が </head> 直前に入っていることを確認すれば、YomuScore の P10 (JSON-LD 存在) が pass する。

ステップ 3: Product / Article テンプレートに dateModified と BreadcrumbList を追加 (30 分)

Shopify の Product JSON-LD は nameimagedescriptionoffers は出力するが、AI エージェントが「最新情報か」を判定するのに使う dateModified と、サイト内位置を示す BreadcrumbList が抜けている。これを補完すると P11 (JSON-LD 必須フィールド) が pass する。

商品テンプレート (sections/main-product.liquid 等) の中の既存の application/ld+json ブロックを探して、Product オブジェクトに dateModified を追加し、BreadcrumbList を別の script タグで追加する。

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Product",
  "name": {{ product.title | json }},
  "description": {{ product.description | strip_html | truncatewords: 60 | json }},
  "image": {{ product.featured_image | image_url: width: 1200 | json }},
  "url": {{ product.url | within: collection | absolute_url | json }},
  "sku": {{ product.selected_or_first_available_variant.sku | json }},
  "dateModified": {{ product.updated_at | date: "%Y-%m-%dT%H:%M:%S%z" | json }},
  "offers": {
    "@type": "Offer",
    "price": {{ product.selected_or_first_available_variant.price | money_without_currency | replace: ",", "" | json }},
    "priceCurrency": {{ cart.currency.iso_code | json }},
    "availability": "{{ product.available | tern: 'https://schema.org/InStock', 'https://schema.org/OutOfStock' }}"
  }
}
</script>

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "BreadcrumbList",
  "itemListElement": [
    {
      "@type": "ListItem",
      "position": 1,
      "name": "ホーム",
      "item": {{ shop.url | json }}
    },
    {% if collection %}
    {
      "@type": "ListItem",
      "position": 2,
      "name": {{ collection.title | json }},
      "item": {{ collection.url | absolute_url | json }}
    },
    {
      "@type": "ListItem",
      "position": 3,
      "name": {{ product.title | json }},
      "item": {{ product.url | absolute_url | json }}
    }
    {% else %}
    {
      "@type": "ListItem",
      "position": 2,
      "name": {{ product.title | json }},
      "item": {{ product.url | absolute_url | json }}
    }
    {% endif %}
  ]
}
</script>

ブログ記事のテンプレート (sections/main-article.liquid 等) も同じ要領で。

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Article",
  "headline": {{ article.title | json }},
  "description": {{ article.excerpt_or_content | strip_html | truncatewords: 30 | json }},
  "image": {{ article.image | image_url: width: 1200 | json }},
  "datePublished": {{ article.published_at | date: "%Y-%m-%dT%H:%M:%S%z" | json }},
  "dateModified": {{ article.updated_at | date: "%Y-%m-%dT%H:%M:%S%z" | json }},
  "author": {
    "@type": "Person",
    "name": {{ article.author | json }}
  },
  "publisher": {
    "@type": "Organization",
    "name": {{ shop.name | json }}
  }
}
</script>

ステップ 4: pages/llms-txt で llms.txt を配信 (40 分)

ここが Shopify 特有の難所だ。Shopify はサイトルートにファイルを物理配置できないので、/llms.txt を返す正攻法は 2 つしかない。一つは /pages/llms-txt というパスで配信して /llms.txt の代わりに見てもらう方法、もう一つは Shopify App proxy で /apps/llms-txt 経由配信する方法だ。後者は Shopify Partner アプリの作成が必要で工数が一気に増えるので、ここでは前者で進める。

完全には URL が /pages/llms-txt になってしまうので YomuScore の S1 (/llms.txt の存在) では fail のままになるが、Shopify でできる範囲としては最も実用的だと思う。Bing や Google の AI 側は、/pages/llms-txt を手動で取りに行ってくれる場合もある。

オンラインストア → ページ → ページを追加から、タイトルを llms.txt に設定する (URL ハンドルが自動で llms-txt になる)。コンテンツタブで <> アイコン (HTML を表示) をクリックして、こんなテンプレートで埋める。

# 株式会社サンプル

> 〇〇業界向けの△△を提供するブランドの公式オンラインストア。商品ラインナップ、ブランドストーリー、店舗情報を掲載。

## 商品ライン

- [新作コレクション](https://yourstore.example/collections/new): 最新シーズンの商品
- [定番商品](https://yourstore.example/collections/classics): ロングセラー
- [セール](https://yourstore.example/collections/sale): 割引商品一覧

## ブランド情報

- [ブランドストーリー](https://yourstore.example/pages/about): 創業の経緯、デザイン哲学
- [素材へのこだわり](https://yourstore.example/pages/materials): 使用素材と産地
- [サステナビリティ](https://yourstore.example/pages/sustainability): 環境への取り組み

## サポート

- [配送について](https://yourstore.example/pages/shipping): 配送料、納期
- [返品交換](https://yourstore.example/pages/returns): ポリシー
- [サイズガイド](https://yourstore.example/pages/size-guide): 商品別の採寸

## Optional

- [プライバシーポリシー](https://yourstore.example/policies/privacy-policy)
- [利用規約](https://yourstore.example/policies/terms-of-service)
- [特定商取引法に基づく表記](https://yourstore.example/policies/legal-notice)

可視性を「表示中」にして保存。ブラウザで https://yourstore.example/pages/llms-txt を開いて表示できることを確認すれば完了。雛形は YomuScore の llms.txt ジェネレーター で店舗 URL を入れて自動生成することもできる。

ステップ 5: meta description を全ページで 50 字以上に (15 分)

Shopify はテーマ設定の SEO 欄が空だと、商品説明文の冒頭をそのまま meta description として出力する。これが「商品名 - 商品名 - お買い物は Shop で」のような短文だと P6 (50 字以上) で fail する。

オンラインストア → 各ページ / 商品 / コレクションで「検索エンジンの表示」セクションを展開して、メタディスクリプションを 50 字以上で記述する。商品なら「[商品名] は [素材・特徴] を採用した [カテゴリ]。[使用シーン・対象ユーザー] におすすめ。[ブランド名] 公式ストアからの送料無料配送、安心の返品ポリシー対応。」のようなテンプレを使うと、自然に 50 字を超える。サイト全体共通の文言は、テーマ設定の SEO デフォルトに 50 字以上で設定しておく。

5 ステップを終えたあと

ここまで実装したら YomuScore でスキャン して以下が pass しているか確認する。ステップ 1 で S5 / S6 / S7 (robots.txt 系)、ステップ 2 + 3 で P10 / P11 (JSON-LD)、ステップ 5 で P6 (meta description)、ステップ 4 で S2 / S3 (llms.txt 配信、ただし /pages/llms-txt 経由なので S1 は fail のまま)。

通常はここまでで Grade B (70〜89 点) に到達する。Grade A まで持っていくには、P15 / P17 / P19 の Markdown ミラー対応が必要で、Shopify では App proxy 経由でないと実装困難なので別途相談、という形になる。S12 / S13 の AGENTS.md は EC サイトには本質的に不要なので、無理に対応しなくても問題ない。


関連リンク

Shopify実装LiquidEC

自社サイトを今すぐ診断

47項目のチェックを約5秒で実行。登録不要・無料。

診断ページへ