Hi Dave. Maybe I’ve missed this somewhere, but how do I get the search to only look at one directory in my domain? I’m looking for it to only search files in my help file, but not to look in the rest of the site. I’m unsuccessful. I looked at that bot thing, and i didn’t see an answer [cf how to add a Google search box to your site]
So, for example, it currently looks at www.mywebsite.com, but I want it to look at www.mywebsite.com/directoryA. Is there a way to do that? Entering that path simply returns 0 results.
This is a tricky problem, actually, because as you have noticed Google doesn’t allow you to constrain searches to just a specific subdirectory on a site, even when you go directly to their search engine. A good way to see what you can and can’t do, by the way, is to both check out the Advanced Search Page and the oh-so-helpful list of search operators.
Noodling on this, however, there are a couple of ways you could try to address the problem… 🙂
First off, the operator intitle: is interesting. It lets you specify search results that contain a specific word or phrase in the title of the page. If your FAQ pages have a unique set of words in the title, perhaps “Help Pages”, then you could try to use that constraint. For example, search for turkey dinner and look at the top four or five matches. Now search for turkey dinner intitle:recipe to see what I mean.
Even better, though, is if you have a specific subdirectory name, you can try using inurl: to constrain search results to just those matches in that area of your site. It’s not foolproof, as a quick test with turkey dinner inurl:recipe reveals (that is, some of the matches are because the word appears in the filename, rather than as a subdirectory) but I imagine you can work around that by having a more complicated directory name. For example, instead of a potentially recurring word like “help” try “helpdir”, which is unlikely to appear in the name of a file elsewhere on the site.
So that’s a reasonable, workable search solution, one that will certainly let you do searches on Google itself for just that subset of files you desire.