FROM CACHE - en_header

Syntax error sitelinks searchbox

Moonglowattrac
Tourist
3 0 2
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 😀
Replies 78 (78)
BrianAtWork
Shopify Partner
245 59 166

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

Moonglowattrac
Tourist
3 0 2
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 😀
BrianAtWork
Shopify Partner
245 59 166

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

semug
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

BrianAtWork
Shopify Partner
245 59 166

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

semug
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/

BrianAtWork
Shopify Partner
245 59 166

@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

semug
New Member
4 0 0

i also remove code completly but it shows same error

please help me

BrianAtWork
Shopify Partner
245 59 166

@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

gyrohome
New Member
1 0 0

Hi,I also have this problem, please help to check. my website is https://gyrohome.store/

BrianAtWork
Shopify Partner
245 59 166

For future readers:

 

Please send me a private message for more details on solving this problem.

 

 

Thank you,

Brian

 

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

Yayiz123
New Member
5 0 0

 


@BrianAtWork wrote:

@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.


 

anabolicsarms
New Member
2 0 0

hi Bryan i have the same issue.

please can you help

wwww,anabolicsarms.co.uk

 

 

Moonglowattrac
Tourist
3 0 2
Hi Brian.

The advice you gave worked, thank you. I received an email earlier saying it was fixed. I did check webmaster again earlier though and it now says 2 errors lol. I clicked the validate button again, see what happens.

Cheers

Dan
Yayiz123
New Member
5 0 0

Hi Can you inform me on how to fix mine exactly? Thank you

BrianAtWork
Shopify Partner
245 59 166

@Moonglowattrac Looks like you made a mistake when implementing the code changes. I see that you've fixed it now. Good job!

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

Yayiz123
New Member
5 0 0
Fixed mine also. 💪🏾
raluca98
New Member
1 0 0

Good evening , I wanted to ask you if it is possible to check what my problem could be as the message is the following : Syntax error in Sitelinks Searchbox and I did what you adviced but I still got the same problem . I would be grateful if you could look into my matter as well. Thank you in advance . Have a lovely day !

Site name : www.soricelulmicut.com     ;    https://soricelulmicut.com 

Best regards , 

Raluca 

 

BrianAtWork
Shopify Partner
245 59 166

@raluca98 Hello, welcome to the Shopify Community! It looks like you've made the correct changes. It takes time (sometimes several days) for the error to disappear in Search Console.

 

For future readers:

 

Please send me a private message for more details on solving this problem.

 

 

Thank you,

Brian

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