• Resolved shamank

    (@shamank)


    Hi. I’m getting the schema.org code twice in the homepage. I guess this is why Google is not understanding the schema I want. This happens only in home:

    
    <script type="application/ld+json">{"@context":"http:\/\/schema.org","@type":"Organization","@id":"#organization","name":"iMaat, Agencia de Marketing Digital","url":"https:\/\/imaat.com.ar","logo":"https:\/\/imaat.com.ar\/wp-content\/uploads\/2016\/01\/isotipo-color-rounded-112x112.png","contactPoint":{"@type":"ContactPoint","telephone":"+54-11-3221-2742","contactType":"sales"},"sameAs":["https:\/\/www.facebook.com\/iMaat.Argentina","https:\/\/twitter.com\/imaatargentina","https:\/\/www.linkedin.com\/company\/imaat"]}</script>
    <script type="application/ld+json">
    {
    "@context": "https://schema.org",
    "@type": "WebSite",
    "@id": "#website",
    "name": "iMaat, Agencia de Marketing Digital",
    "url": "https://imaat.com.ar/",
    "potentialAction": {
    "@type": "SearchAction",
    "target": "https://imaat.com.ar/?s={search_term_string}",
    "query-input": "required name=search_term_string"
    }
    }
    </script>
    

    Is this normal? I’m also using Yoast but I’ve completly disabled schema generation by code, so it’s not their fault (AFAIK).

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter shamank

    (@shamank)

    It’s because of this:

    includes/json/search-results.php

    
    28         if ( ! isset($sitelinks_search_box) ) return;
    

    The issue there is that $sitelinks_search_box is false instead of null (I have enabled it and disabled it in /wp-admin/admin.php?page=schema&tab=search_results, so I think it may be the origin of this issue).

    My proposed solution is:

    
    if ( ! isset($sitelinks_search_box) || !$sitelinks_search_box ) return;
    

    or directly

    
     28         if ( !$sitelinks_search_box ) return;                                                                                             
    
    
    • This reply was modified 6 years, 8 months ago by shamank.

    Hi @shamank – thanks for this post. I had the same issue & applied your suggested fix which worked a treat.

    Plugin Author Hesham Zebida

    (@hishaman)

    @shamank Thanks for your suggestions, I will add this check int he next update.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Duplicated schema entry… is it normal?’ is closed to new replies.