Sign up ×
Web Applications Stack Exchange is a question and answer site for power users of web applications. It's 100% free, no registration required.

How do I set up the Google Custom Search to include only pages from a Stack Overflow tag?

For example adding will not find the article pages. There's no common pattern URL for the pages and tags are not subdomains.

share|improve this question
This isn't possible to do. Out of interest why don't you just search within SO? Why do you need to use Google? – codingbadger May 6 '11 at 10:37
I try to setup a custom search for all Guava project related content. (See The search results should combine the information from all these places. – Thomas Jung May 6 '11 at 11:17
you could use guava, although it would include everything with the word guava – user10629 Jun 8 '11 at 15:04

1 Answer 1

This isn't possible as said in the comments.
Google is really bad with explaining what the Custom Search Engine (CSE) is capable of doing.

Taking your example

The first question (at the current time of this posting)

Java Generics Wildcards Question

So let us try to get this from the CSE.

Using the URL pattern*, which according to the Help Page:

Matches all URLs beginning with or

This should take care of questions

One obtains for a custom search for "Java" ... no results

Trying to re-duplicate with a regular old search -inurl:java Java inurl:page

Notice that without inurl:page we get one of the results

Text file into Java Set using Commons or Guava

Not the result we wanted but a result nonetheless. So now it is time to refine the CSE because now it means that the CSE is not searching the first page but only those under pagination.

So the updated URL patterns*

where the second should only match a single page according to the Help Page. Does it ? No. It matches the URL Pattern*. At first I thought that maybe it is implicit but I re-read the help center:

For example, the pattern '' will only match the single page ''. To cover all the pages where the URL starts with '', you must explicitly add a '*' at the end

So I did not add the wildcard pattern and the CSE went ahead and searched for results I did not want

Comparing the results

Google CSE

Google Search

So at least they are returning the same results now. Though we still have not got the first result Java Generics Wildcards Question. With it being known that the number of results changes for whatever reason within Google, let us try refining the search and assume the result could still be found with "Java Generics".

This makes the results really different with the CSE giving 0 results and Google Search giving 21 results. So in the end, I really don't think you should rely on Google search in the way you are looking to do it. It just doesn't seem to be searching properly.

Another way I have tried is using the link: parameter


but you cannot use other parameters when using this.

A third way would be to use StackOverflow Search

(but this is rate limited, you will not reach far) and you cannot couple it with the CSE.

You may need to look for a site that has proper attribution (This is at the bottom of every Stackoverflow page) and organizes the questions according to tags


Or something like that, this way it would be more Google friendly to your needs.

share|improve this answer
The best way to search for a tag - I found - is to use keywords in the custom search engine. The results are okay (at least for guava on SO). – Thomas Jung May 17 '11 at 15:30

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.