Sitelink Search Box mark-up when multiple query strings are used
-
Hi all,
I'm looking to implement sitelink search box mark-up in Google Tag Manager in JSON-LD format. This would be popped into the Custom HTML tag and would look a little something like:
The above option is great if you have one query string for your search term, but what if you had a URL that triggered two query strings - for example:
https://www.example.com/search?q=searchterm&category=all
Would you need to amend the code something like the below:
Any help would be much appreciated!
Cheers,
Sean
-
Hi Sean,
While multiple variables are technically allowed—Schema.org only requires that your URI templates follow RFC6570, and that does allow multiple variables—there's no indication that Google will recognise it.
In fact, if you look at schema.org/SearchAction, you'll see there's no such property as "query-input". The property they've agreed on is the more flexible "query". Google isn't using that, and it seems that, for now, they'll only expand and use one variable in your target URL.
They might change it in the future. For now, as a bit of a rubbish workaround, you could hardcode the value of category to be "all", like this:
"target": "https://www.example.com/search?q={search_term_string}&category=all"
This way, sitelink search results will always at least come through to your site and by default search through all categories. But by then, at least users are on your site, and you could then use faceted navigation to help them drill down into particular categories.
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Use of "/" and using fractions in titles
We are a company that sells pipe and fittings. An example of a part that someone will search for is : 3/4" PVC Socket I am not sure how best to represent the fraction in the title of the page that has such a product. I am concerned that if I use the forward slash it will be misinterpreted by search engines (although it will be interpreted properly by users). A lot of folk search for the product by the fraction size and so it would be good to be able to represent it in the title, but I don't want to get "punished" by confusing search engines. I could replace the forward slash with a hyphen or pipe symbol, but then may look a bit weird to our users... Any recommendations? Bob
Intermediate & Advanced SEO | | BobBawden11 -
Is Google Filling in Search Forms?
Hi Mozers, Is it true that Google will fill in search forms and thus generate potentially thousands of pages by itself? We have a spike in number of pages indexed and it corresponds with the time we added an advanced search form to the site... Thanks for the advice! Yael
Intermediate & Advanced SEO | | yaelslater0 -
Kinds of organic search results (Google)
Not sure if this is a new "unit" for Google organic results. Please see the attached image. When searching for "invoice software", the top quarter of the page is a ribbon of products/brands with badly formatted logos. The fact that it's so ugly, and there's nothing marking it as a paid result, leads me to think it's organic. Anyone know what this SERP unit is called; and better still: How do you get included? We rank super high in the normal organic results, but don't appear at all in this product ribbon. y71A9
Intermediate & Advanced SEO | | RobM4161 -
Can I use two sitemaps?
I have a Magento website. I am going to add a Wordpress blog under /blog. If I setup each with its own webmaster tools to submit a sitemap does it hurt anything?
Intermediate & Advanced SEO | | Tylerj0 -
How to target for misspelled Brand name searches
Hi to all the SEO experts here, I am working on SEO of my 4 months old website. For example, its 'abz.com'. We like the brand name 'abz' for the business and we are able to SEO well for keyword 'abz'. However, we would also like to target for the keyword 'abc'. There are 2 reasons for that: 'abc' is an actual word. So there is a possibility that our users may type 'abc' instead of 'abz' to reach us. For 'abc', the top result is 'abct.us', which is a site of adult in nature. Also our website doesn't feature at all in the results. This is hitting us hard in terms of or brand visibility. So the questions are: How to feature in results of keyword search of 'abc'? Will the following approach work: Buying an available domain 'abc.co.in', and use it to feature in 'abc' results and 301 redirect to 'abz.com' Having 'abc' in the page meta (title and description). This is hard for us, since we need to rethink our taglines and copyrights. 2. If we search for 'abz', Google says "Do you mean abc". Is there a way to not have this suggestion? It would helpful to have some more ideas for this problem.
Intermediate & Advanced SEO | | manasag0 -
Miniclip has a search box showing in Google SERP: how?
For their brand keyword search - miniclip - Google SERP includes a search box reading "Search miniclip.com". Any one has an idea how this can be done?
Intermediate & Advanced SEO | | vivekg0 -
Does Google crawl the pages which are generated via the site's search box queries?
For example, if I search for an 'x' item in a site's search box and if the site displays a list of results based on the query, would that page be crawled? I am asking this question because this would be a URL that is non existent on the site and hence am confused as to whether Google bots would be able to find it.
Intermediate & Advanced SEO | | pulseseo0 -
Not using a robot command meta tag
Hi SEOmoz peeps. Was doing some research on robot commands and found a couple major sites that are not using them. If you check out the code for these: http://www.amazon.com http://www.zappos.com http://www.zappos.com/product/7787787/color/92100 http://www.altrec.com/ You fill not find a meta robot command line. Of course you need the line for any noindex, nofollow, noarchive pages. However for pages you want crawled and indexed, is there any benefit for not having the line at all? Thanks!
Intermediate & Advanced SEO | | STPseo0