<title></title>我有幾家商店,我注意到 Shopify 似乎會在附加商店名稱之前自動截斷 中長度超過 65 或 70 的產品標題。例如這個產品頁面。頁面標題變為:<title>Boho Beach Lace Cap Sleeves Ivory Chiffon Wedding Flower Girl Dress wi - Flower Girl Dresses</title>雖然應該是:<title>Boho Beach Lace Cap Sleeves Ivory Chiffon Wedding Flower Girl Dress with Pink Lining - Flower Girl Dresses</title>我知道谷歌不關心標題長度超過一定數量的字符,例如 65 或 70,但仍然保留整個關鍵字也沒有什么壞處。例如,在這種情況下,如果人們搜索“粉紅色”,標題中包含“粉紅色”關鍵字仍然很有幫助。我認為最好保留標題而不截斷它。那么如何防止 Shopify 截斷標題呢?我只能在 theme.liquid 中看到這個:<title>{{ page_title }}{% if current_tags %}{% assign meta_tags = current_tags | join: ', ' %} - {{ 'general.meta.tags' | t: tags: meta_tags }}{% endif %}{% if current_page != 1 %} - {{ 'general.meta.page' | t: page: current_page }}{% endif %}{% unless page_title contains shop.name %} - {{ shop.name }}{% endunless %}</title>我不知道我應該修改哪里才能實現這一點?
1 回答

泛舟湖上清波郎朗
TA貢獻1818條經驗 獲得超3個贊
我不相信它在前端 Liquid 中被截斷。您看到的輸出是page_title而非product.title. 前者來自產品管理頁面底部的“SEO”部分。默認情況下,該字段是product.title.
你可以做的是這樣的:
{% assign desiredTitle = page_title %}
{% if template == 'product' %}
{% assign desiredTitle = product.title %}
{% endif %}
<title>
{{ desiredTitle }} // etc. etc.
</title>
- 1 回答
- 0 關注
- 160 瀏覽
添加回答
舉報
0/150
提交
取消