Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
All my page Titles and Meta descriptions have been edited in my shopify source code - so no longer display what I enter in shopify backend.
I am unsure what to edit in the theme code to remove these. The Meta Descriptions have been deleted sitewide, and Page Title has been set to 'American Express'.
I am unsure where to edit this in the shopify source code so that it reverts to what I enter in the shopify backend
Site is https://kenkomatcha.com/
Thanks
Open your theme code editor and search for theme.liquid
then add this just under your <head> tag
<meta name="description" content="{% if template == 'product' %}{{ product.description | strip_html | truncate: 160 }}{% elsif template == 'collection' %}{{ collection.description | strip_html | truncate: 160 }}{% elsif template == 'page' %}{{ page.description | strip_html | truncate: 160 }}{% elsif template == 'blog' %}{{ blog.description | strip_html | truncate: 160 }}{% else %}Default store description{% endif %}">
<meta name="keywords" content="{% if template == 'product' %}{{ product.tags | join: ', ' }}{% else %}default, keywords, here{% endif %}">
<title>{% if template == 'product' %}{{ product.title }}{% elsif template == 'collection' %}{{ collection.title }}{% elsif template == 'page' %}{{ page.title }}{% elsif template == 'blog' %}{{ blog.title }}{% else %}{{ shop.name }}{% endif %}</title>
{{ content_for_header }}
<!-- Any additional meta tags -->
<meta property="og:title" content="{% if template == 'product' %}{{ product.title }}{% else %}{{ shop.name }}{% endif %}">
<meta property="og:description" content="{% if template == 'product' %}{{ product.description | strip_html | truncate: 160 }}{% else %}Default store description{% endif %}">
<meta property="og:image" content="{% if template == 'product' %}{{ product.featured_image | img_url: 'large' }}{% else %}URL to your default image{% endif %}">
<meta property="og:url" content="{{ canonical_url }}">
I do see the shop name in homepage, what do you want to show ?
I can't get the Title or Meta description in the Shopify backend to show up, it is just showing the Store name
Ah I see - ok can you try this:
If you have a <title> remove it and replace with the one below.
<title>{{ seo_title }}</title>
{% if page_description %}
<meta name="description" content="{{ page_description | escape }}">
{% else %}
<meta name="description" content="{{ shop.description | escape }}">
{% endif %}
{%- liquid
assign og_title = page_title | default: shop.name
assign og_url = canonical_url | default: shop.url
assign og_type = 'website'
assign og_description = page_description | default: shop.description | default: shop.name
if request.page_type == 'product'
assign og_type = 'product'
elsif request.page_type == 'article'
assign og_type = 'article'
elsif request.page_type == 'collection'
assign og_type = 'product.group'
elsif request.page_type == 'password'
assign og_url = shop.url
endif
-%}
<meta property="og:site_name" content="{{ shop.name }}">
<meta property="og:url" content="{{ og_url }}">
<meta property="og:title" content="{{ og_title | escape }}">
<meta property="og:type" content="{{ og_type }}">
<meta property="og:description" content="{{ og_description | escape }}">
{%- if page_image -%}
<meta property="og:image" content="http:{{ page_image | img_url: 'master' }}">
<meta property="og:image:secure_url" content="https:{{ page_image | img_url: 'master' }}">
<meta property="og:image:width" content="{{ page_image.width }}">
<meta property="og:image:height" content="{{ page_image.height }}">
{%- endif -%}
{%- if request.page_type == 'product' -%}
<meta property="og:price:amount" content="{{ product.selected_or_first_available_variant.price | money_without_currency | strip_html }}">
<meta property="og:price:currency" content="{{ cart.currency.iso_code }}">
{%- endif -%}
{%- if settings.social_twitter_link != blank -%}
<meta name="twitter:site" content="{{ settings.social_twitter_link | split: 'twitter.com/' | last | prepend: '@' }}">
{%- endif -%}
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="{{ og_title | escape }}">
<meta name="twitter:description" content="{{ og_description | escape }}">
Hi @Anonymous
You can solve this issue by backup the previous version of your theme.liquid. Please follow these steps to do that.
- Helpful? Like and Accept solution! or Buy me coffee
- Ryviu - Reviews & QA app: Collect product reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Shopee, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image: Easy and fast to create Photo Gallery, Lookbook, Shop The Look.
- Ryviu: Aliexpress Reviews - AliExpress Reviews Importer, one-click import aliexpress reviews, export reviews to CSV file.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024