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
-
Anyone used Fatjoe?
Interested to know if anyone has used or using Fatjoe content/blogger outreach. Seems fairly expensive, but reasonable quality. Reviews or comments welcome. Thanks Richard
Intermediate & Advanced SEO | | seoman100 -
Multiple distinct businesses owned by Group
I work for a company which owns 14 different brands, all of which have their own domain, website, sales teams, management teams etc. 10 of the websites sit on the same IP address and have the same (or very similar) WHOIS records. The group website links to all the other sites on an 'Our Companies' page, using the anchor text 'visit site' underneath a brief about that company. My question is what are the ramifications of having those 10 sites sitting on the same servers? They are distinct companies but they mostly have a similar theme. They don't really link to each other unless it's a genuine reason for a cross-over. My CEO has asked me to arrange to move some to other servers but I'm not 100% convinced it's necessary - and wouldn't moving over at this stage look like we're trying to hide something? (Most of the sites have been going for 5 years +). Looking at the WHOIS, or the address in each site's footer makes it clear that they're all part of the same umbrella group. And should I nofollow any links between all the sites? There's not many, it's mainly just the ones on the main group website.
Intermediate & Advanced SEO | | Betfred_James0 -
What are the effects of having Multiple Redirects for pages under the same domain
Dear Mozers, First of all let me wish you all a Very Happy, Prosperous, Healthy, Joyous & Successful New Year ! I'm trying to analyze one of the website's Web Hosting UK Com Ltd. and during this process I've had this question running through my mind. This project has been live since the year 2003 and since then there have be changes made to the website (obviously). There have also been new pages been added, the same way some new pages have even been over-written with changes in the url structures too. Now, coming back to the question, if I've have a particular url structure in the past when the site was debuted and until date the structure has been changes thrice (for example) with a 301 redirect to every back dated structure, WOULD it impact the sites performance SEOwise ? And let's say that there's hundreds of such redirections under the same domain, don't you think that after a period of time we should remove the past pages/urls from the server ? That'd certainly increase the 404 (page not found) errors, but that can be taken care of. How sensible would it be to keep redirecting the bots from one url to the other when they only visit a site for a short stipulated time? To make it simple let me explain it with a real life scenario. Say if I was staying a place A then switched to a different location in another county say B and then to C and so on, and finally got settled at a place G. When I move from one place to another, I place a note of the next destination I'm moving to so that any courier/mail etc. can be delivered to my current whereabouts. In such a case there's a less chance that the courier would travel all the destinations to deliver the package. Similarly, when a bot visits a domain and it finds multiple redirects, don't you think that it'd loose the efficiency in crawling the site? Ofcourse, imo. the redirects are important, BUT it should be there (in htaccess) for only a period of say 3-6 months. Once the search engine bots know about the latest pages, the past pages/redirects should be removed. What are your opinions about this ?
Intermediate & Advanced SEO | | eukmark0 -
Monthly Searches from Google Keyword Planner
I've used Google Adwords, Google Analytics and competitors keywords to compile a master list. I'm now looking to evaluate metrics on the keywords / phrases / long tail phrases. My question is this ... Based on Googles use of Geo Targeting, would I be better to evaluate metrics (Avg. Monthly Searches, Competition, Avg CPC) based on United Kingdom or my local city (I only operate in my local city). I am looking to use the results to redesign my website. I will use the favorable keywords / phrases / long tail keywords to implement a new menu, new content page creation, articles, etc. Thanks Mark
Intermediate & Advanced SEO | | Mark_Ch0 -
Block search engines from URLs created by internal search engine?
Hey guys, I've got a question for you all that I've been pondering for a few days now. I'm currently doing an SEO Technical Audit for a large scale directory. One major issue that they are having is that their internal search system (Directory Search) will create a new URL everytime a search query is entered by the user. This creates huge amounts of duplication on the website. I'm wondering if it would be best to block search engines from crawling these URLs entirely with Robots.txt? What do you guys think? Bearing in mind there are probably thousands of these pages already in the Google index? Thanks Kim
Intermediate & Advanced SEO | | Voonie0 -
Using a 302 instead of a 301
I am trying to figure out the best way to garner the most amount of link value. We have an app that lives on a sub-domain ... For the purposes of this question, let's call it app.mydomain.com. We provide a service with this app that requires clients (with very high ranking websites) to link into app located on the sub-domain. Would I garner more authority if had the high ranking client website link into a url that wasn't a sub-domain and redirect it using a 302? For example: What if I created a 302 that was www.mydomain.com/app and have it redirected to the sub-domain version of app.mydomain.com? Additionally am I correct to assume that a 301 would merely pass that value to the sub domain and NOT provide much value to the root?
Intermediate & Advanced SEO | | NextGenEDU0 -
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 -
What would be the SEO benefits of using Lulu ? (ebook)
Hi there, how are you guys doing? We wrote an ebook to promote our new website and I was investigating the idea of putting it on Lulu. Did anyone ever use Lulu? If so, do you have any feedback please? I got a free ISBN number on Lulu and it looks like I may be able to distribute it on Amazaon. Also, I'm giving out the ebook for free. Thanks guys! I hope you're having a great day
Intermediate & Advanced SEO | | Ericc220