Need to clean up header.liquid due to previously used 3rd party app?

Need to clean up header.liquid due to previously used 3rd party app?

DaveD
Explorer
55 0 15

Hello,

I came across the header.liquid file under sections in the theme editor, while I was trying to get some knowledge on h1-h2 tags.

 

I had in the past smartseo installed but removed it again.

Below code is on the very top of the header.liquid file

I am wondering whether this complete part can be deleted since I do not use smartseo anymore?! I am also wondering about this url schema.org. Should it be not the URL of my store?


<script src="{{ 'header.min.js' | asset_url }}" defer="defer"></script>
{%- comment smartseo_integration_begin_meta_data -%}
<script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@type": "Organization",
  "name": {{ shop.name | json }},
  {% if section.settings.logo %}
    {% assign image_size = section.settings.logo.width %}
    "logo": {{ section.settings.logo | image_url: width: image_size | prepend: "https:" | json }},
  {% endif %}
  "sameAs": [
    {{ settings.social_twitter_link | json }},
    {{ settings.social_facebook_link | json }},
    {{ settings.social_pinterest_link | json }},
    {{ settings.social_instagram_link | json }},
    {{ settings.social_tumblr_link | json }},
    {{ settings.social_snapchat_link | json }},
    {{ settings.social_youtube_link | json }},
    {{ settings.social_vimeo_link | json }}
  ],
  "url": {{ shop.url | append: page.url | json }}
}
</script>
{%- endcomment smartseo_integration_end_meta_data -%}
{% if request.page_type == 'index' %}
  {% assign potential_action_target = shop.url | append: routes.search_url | append: "?q={search_term_string}" %}
  {%- comment smartseo_integration_begin_meta_data -%}
  <script type="application/ld+json">
    {
      "@context": "http://schema.org",
      "@type": "WebSite",
      "name": {{ shop.name | json }},
      "potentialAction": {
        "@type": "SearchAction",
        "target": {{ potential_action_target | json }},
        "query-input": "required name=search_term_string"
      },
      "url": {{ shop.url | append: page.url | json }}
    }
  </script>
{%- endcomment smartseo_integration_end_meta_data -%}
{% endif %}

 

 Thank you

Reply 1 (1)

Joda_Stoesser
Shopify Partner
24 0 6

Hi Dave,

 

luckily, the situation you are describing is getting less common, as Shopify is pushing app developers to use a modular approach instead of actually editing theme code.

 

To make sure you remove exactly the right code and not too much or too little, I would try a few things:

  1. Ask the app support to remove the added code snippets
  2. Install a clean version of the theme into the store and compare the files (either by hand/eye, with a "diff checker" tool or if you are more technical, with Git, a code versioning tool)

 

In addition, I would make sure to set up a GitHub integration, which creates a new version after every change to the theme as a kind of backup timeline. This makes it easy to revert changes like this.

 

Good luck

 

Joda

Building Club of Merchants -- the merchant-only community right in your Shopify admin dashboard

CTO @ coders.win for Shopify app development and consulting | All our apps
Please let me know if my reply is helpful by giving it a Like or marking it as the Solution!