ogitzcdm
ogitzcdm

Reputation: 11

Schema.org Sitelinks Search Box for Google Custom Search

we want to implement the new Google Sitelinks Search Box Rich Snippet (https://developers.google.com/webmasters/richsnippets/sitelinkssearch) into our site, which uses the Google Custom Search Engine.

<div id="cse-search-form">
    <form itemprop="potentialAction" itemscope itemtype="http://schema.org/SearchAction" id="cse-search-box" action="/suche/q.php">
        <meta itemprop="target" content="http://www.example.com/suche/q.php?cx=017002835581306790937%3A802l7atpqxs&ie=UTF-8&q={q]&sa=Suchen"/>
        <input type="hidden" value="017002835581306790937:802l7atpqxs" name="cx">
        <input type="hidden" value="UTF-8" name="ie">
        <input itemprop="query-input" id="googleSearchField" type="text" size="31" name="q" style="background: url("https://www.google.com/cse/images/google_custom_search_watermark.gif") no-repeat scroll 50% 50% transparent;">
        <input class="btn" type="submit" value="Suchen" name="sa">
    </form>
</div>

Do you guys think this will work?

Upvotes: 1

Views: 2739

Answers (1)

unor
unor

Reputation: 96737

You are using the potentialAction property without showing us the parent item this property belongs to. A WebSite item would probably make the most sense here (as also documented by Google).

The variable in your target property is {q], but you probably meant {q}.

It’s not clear if Google requires it, but they list the url property in their specification, so you might want to add:

<link itemprop="url" href="http://www.example.com/"> <!-- use the canonical URI of your homepage here -->

Upvotes: 1

Related Questions