Syntax error sitelinks searchbox

Tourist
3 0 1
Hi
I have recently signed up yo shopify. I have progressed ok with setting up my site but have one issue.
I used Google webmaster to crawl my page and it returns 1 error. 'Syntax error in sitelinks searchbox'.
How can I resolve this?
I tried the shopify support but they have directed me here.

P.s I have very limited computer knowledge 😀
0 Likes
Shopify Partner
239 59 70

Hi @Moonglowattrac,

 

Welcome to the Shopify Community!

 

I understand that you're having an issue with Google Webmaster. When it crawls your page, you are getting an error "Syntax error in sitelinks searchbox".

 

This is often caused by a third-party app conflicting with your theme's default sitelink code.

 

I may be able to hep you with this. Will you send me a link to your store?

 

Cheers!

Brian | Shopify Partner | Ecommerce Consultant
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution  
 - Need further assistance? Visit www.BrianAtWork.com

1 Like
Tourist
3 0 1
Thanks for the reply. Yes that is the issue I'm having. The link to my store is
https://www.moonglowattractors.co.uk/

Any help would be great 😀
0 Likes
Shopify Partner
239 59 70

Hi @Moonglowattrac,

 

Thank you for the link.

 

It seems like the problem is being caused by a third-party SEO app.

 

You have duplicate schema declarations in your output code:

 

<script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@type": "Organization",
  "name": "Moonglow fishing                                                  ",
  
    
    "logo": "https:\/\/cdn.shopify.com\/s\/files\/1\/0116\/4351\/9038\/files\/website_header_x_923x.jpg?v=1566117522",
  
  "sameAs": [
    "",
    "https:\/\/www.facebook.com\/Moonglowattractors-2173268539663534\/",
    "",
    "",
    "",
    "",
    "",
    ""
  ],
  "url": "https:\/\/www.moonglowattractors.co.uk"
}
</script>

 

 

Also here:

 

<script type="application/ld+json">
    {
      "@context": "http://schema.org",
      "@type": "WebSite",
      "name": "Moonglow fishing                                                  ",
      "potentialAction": {
        "@type": "SearchAction",
        "target": "https:\/\/www.moonglowattractors.co.uk{{ routes.search_url }}?q={search_term_string}",
        "query-input": "required name=search_term_string"
      },
      "url": "https:\/\/www.moonglowattractors.co.uk"
    }
  </script>

 

 

You must remove one of these. They may both be found in the same file – however, the 2nd code snippet is for sure found in the Sections folder of your header.liquid file.

 

You can disable the code by "commenting" it out, using HTML comment tags: <!--   bad_code_goes_here    -->

 

Here's the 2nd code snippet from above, with the HTML comment tags included:

 

<!--<script type="application/ld+json">
    {
      "@context": "http://schema.org",
      "@type": "WebSite",
      "name": "Moonglow fishing                                                  ",
      "potentialAction": {
        "@type": "SearchAction",
        "target": "https:\/\/www.moonglowattractors.co.uk{{ routes.search_url }}?q={search_term_string}",
        "query-input": "required name=search_term_string"
      },
      "url": "https:\/\/www.moonglowattractors.co.uk"
    }
  </script>-->

 

 

Before you customize your theme:

  • Duplicate your theme to create a backup copy. This makes it easy to discard your changes and start again if you need to.

Here's how to access and edit your theme files:

  1. From your Shopify admin, go to Online Store > Themes.
  2. Click Actions > Edit code.
    • The code editor shows a directory of theme files on the left, and a space to view and edit the files on the right.
    • When you click a file in the directory on the left, it opens in the code editor.
  3. In the Sections folder, click header.liquid.
  4. Edit the file.
  5. Click Save.

 

Let me know if this solves your problem or if you need further help!

Brian | Shopify Partner | Ecommerce Consultant
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution  
 - Need further assistance? Visit www.BrianAtWork.com

1 Like
New Member
4 0 0

i also facing the same problem, you mentioned above 

i tried all instruction given by you but not work for me 

it display same error please help meerror.PNG

0 Likes
Shopify Partner
239 59 70

Hey @semug,

 

If you're having the same problem, then that means the code change should have worked. It may take some time for Google to crawl your store again, so that the error disappears from your report.

 

However, if you share a link to your store, I will verify that the changes were made correctly.

Brian | Shopify Partner | Ecommerce Consultant
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution  
 - Need further assistance? Visit www.BrianAtWork.com

0 Likes
New Member
4 0 0

Thanks for the reply. Yes that is the issue I'm having. The link to my store is

https://semug.co/

0 Likes
Shopify Partner
239 59 70

@semug I have verified that you made the correct code change. If you want to be 100% certain that the error is fixed, you may remove the code completely rather than just "commenting" it out.

Brian | Shopify Partner | Ecommerce Consultant
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution  
 - Need further assistance? Visit www.BrianAtWork.com

0 Likes
New Member
4 0 0

i also remove code completly but it shows same error

please help me

0 Likes
Shopify Partner
239 59 70

@semug Everything is okay – it will take time for the error to disappear. The error does not disappear instantly. You have to wait until Google crawls your store again.

Brian | Shopify Partner | Ecommerce Consultant
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution  
 - Need further assistance? Visit www.BrianAtWork.com

0 Likes