Google - Block unwanted results

Last update on May 16, 2007

Remove unwanted results from google, filtered by your own customizable blacklist

To block a certain domain from google's search results, simply click the newly added "Block result":

When clicking on a result that has a sub-domain, you are given the option to block either the sub-domain, or the entire domain:

You can unblock domains, or set a different blocking method (either completely hiding the result, or fading it) in the blocking options panel, accessible through the top bar in google:

This panel is really very self explanatory.

Version history

Version 0.1 - May 16, 2007
  • First release

Disclaimer

I have nothing against WoW's forums. I DO, however, have something against expert-exchange.com.

Creative Commons License
This work is licensed under a Creative Commons Attribution-Noncommercial 3.0 License.



You could comment on this script if you were logged in.

14 comments Feed-icon

1 point
login to vote
daniel Rozen... script's author
Posted Oct 12, 2008 8:06am

I didn't forget you people... I promise to rewrite the script (using your fixes) and upload it in the next few days (weeks?)

1 point
login to vote
Bunnywabbit scriptwright
Posted Oct 7, 2008

hi, very good script,

liked it so much i couldn't stand living without it when google changed its html.

after editing in LuisNaver's new addControlLink function, i made the following changes:
(note that line numbers are probably an approximation, if you want a no-brainer update, follow the link below)

changed line 68

var xpAnchor = "//div[@class='g']/h2[@class='r']/a";

to:

var xpAnchor = "//li[@class='g']/h3[@class='r']/a";

changed line 122

var nodeCorrectPlace = node.getElementsByTagName("nobr")[0];

to:

var nodeList = node.getElementsByTagName("span")
var z = 1
while(nodeList[nodeList.length-z].className != "gl"){
z = z +1
}
var nodeCorrectPlace = nodeList[nodeList.length-z]

and line 127

if (nodeControl && nodeControl.nodeName == "SPAN" && nodeControl.hasAttribute("href")) {

to:

if (nodeControl && nodeControl.className == "fl" && nodeControl.hasAttribute("href")) {

I think those were all the changes i made, but just to be sure, here's the entire code as per my updates:

[edit: decided to host the script version 0.2 instead, because the huge codeblock looked a bit spammy. ]

thanks for a great script!

1 point
login to vote
Imfego user
Posted Aug 25, 2008

Great idea, but is it possible to import url list from txt file or whatever into it? At least in future versions.

1 point
login to vote
Noel Reid user
Posted Aug 13, 2008

This script has stopped working for me - I have FF 2.0.0.16 installed.

Dang...

1 point
login to vote
zeefreak user
Posted Aug 8, 2008

the latest comment by luis seems to be necessary on ffx3. what isn't working properly is the list in the script config. blocked sites do not show up there, and sites added there are not blocked.

i am not really a coder, and looking through here i cannot see what might be causing this behaviour.

i am not sure what the change by mexaon does. it doesn't seem to change anything.

1 point
login to vote
LuisNaver user
Posted Aug 5, 2008

Great script, needed a little work for me to get it to work. I had to rewrite how the script finds where to place the config button:

      function addControlLink() {
        
        // Create the link and add a click event to it
        var nodeControl = document.createElement("span");
        nodeControl.setAttribute("id", "GBUR_controlPanelLink");
        nodeControl.textContent = "Blocking options";
        nodeControl.addEventListener("click", openControlPanel, false);
        
        // Create a hyphen space ;)
        var nodeHyphen = document.createElement("span");
        nodeHyphen.textContent = " - ";
        nodeHyphen.style.fontSize = "small";
        
        // Get the paragraph where the result count is displayed
        var resultsP = $x("//div[@id='ssb']/p")[0];
        // Attach CP link and hyphen before said font node
        resultsP.insertBefore(nodeHyphen, resultsP.firstChild);
        resultsP.insertBefore(nodeControl, resultsP.firstChild);
        
      }
      

2 points
login to vote
Hank Baig user
Posted Aug 4, 2008

Here's another voice that asserts the world would be a better place if expert-exchange.com disappeared forever. Their style and operation are so antithetical to the spirit of open computing it's sickening.

1 point
login to vote
lorax scriptwright
Posted Jul 17, 2008

Very slick! Another default kill for me is jstor.org. Those guys are the experts-exchange of the research world.

Now I'm going to get busy and knock off those "Free to download! But useless unless you buy it!" shareware sites like brothersoft.com and their ilk.

Thanks billions!

1 point
login to vote
mcgoxel user
Posted Jun 6, 2008

nice scrpit thanks,
thank u for fix @MeXaon

1 point
login to vote
Posted May 27, 2008

I too arrived here looking for a way to block experts-exchange from google search results.

1 point
login to vote
MeXaon scriptwright
Posted May 19, 2008

hi daniel Rozenberg
Need small update :)

str 121

var nodeCorrectPlace = node.getElementsByTagName("nobr")[0];

replace to

  var nodeList = node.getElementsByTagName("nobr")
        var nodeCorrectPlace = nodeList[nodeList.length - 1];
      

1 point
login to vote
Sir Robert user
Posted Dec 26, 2007

Daniel, this is excellent. I was just about to write the exact same script (and for Experts-Exchange.com, actually) when I thought, "Well, *maybe* someone else is as irritated as I am... I'll check userscripts.org."

Thanks!

1 point
login to vote
daniel Rozen... script's author
Posted Aug 13, 2007

@Noel - Honestly, I didn't think anyone would have that problem :)
I didn't imagine anyone blocking more than 10 domains... I guess I can put a reset-all or some sort of saving/massive toggling feature, but not soon - RLâ„¢ has kept me busy... In any case, I've put it in my todo list

1 point
login to vote
Noel Reid user
Posted Aug 12, 2007

Love the script - very intuitive

Any chance of being able to UNblock lots of sites at the same time rather than having to uncheck each site one at a time?

Thanks

You could comment on this script if you were logged in.