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

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Let's say I ran the following query in Google's web search:

site:"superuser.com" "windows 7"

This will return results on the blog.superuser.com subdomain.

How can I restrict results to only be from the superuser.com domain and not any other subdomain?

share|improve this question
up vote 2 down vote accepted

This will do the trick:

[ "windows 7" site:superuser.com -site:*.superuser.com ]

This method has varying results and does not work for sites such as

  • stackexchange.com
  • cnn.com
  • fox.com
  • internet.com
share|improve this answer
    
This works, until a new subdomain is added. Probably better to change it to -site:*.superuser.com. – mindless.panda Jul 26 '11 at 20:06
2  
Doesn't work for a domain like stackexchange.com - replace your example with stackexchange.com and you'll see tex.stackexchange.com and apple.stackexchange.com come up – Eight Days of Malaise Oct 3 '11 at 12:48
2  
This also does not work for: bbc.co.uk, cnn.com, fox.com, internet.com, cnet.com, etc – Eight Days of Malaise Oct 3 '11 at 14:17
    
This does not work at all, it just happens to work for the domain in the question by chance. webapps.stackexchange.com/q/19493/10579 – Pacerier Oct 3 '11 at 15:18
site:superuser.com -site:*.superuser.com "windows 7"
share|improve this answer
    
This seems to be identical to the solution in this answer, which apparently doesn't work. – Al E. Apr 5 at 15:58

Rather than using the site: search operator try using inurl: instead along with the + operator. Seems to work pretty well for me.

asd +[inurl:http://stackexchange.com]

or in the case of this question:

"windows 7" +[inurl:http://superuser.com]

Note: Posting this answer in response to this recent duplicate question

Tests for other sites

  • newspulse +[inurl:http://cnn.com] no newspulse.cnn.com
  • The Latest Scripts from JavaScript Source +[inurl:http://internet.com] no javascript.internet.com
share|improve this answer
    
This doesn't work for me, at least not from mobile. – Drazen Bjelovuk May 8 '15 at 6:54
    
@codingbadger, What's the point of the plus operator? (Isn't + operator gone since a long time ago... searchengineland.com/google-sunsets-search-operator-98189 ) – Pacerier Jan 16 at 0:29

Your Answer

 
discard

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.