How to block div on website permanently using Chrome?

12

7

There is one website that I like, but with a comment section that super annoys me. I want to block the div that holds the comments permanently, across pages, in Google Chrome.

For a temporary deletion, I can just remove the node using Chrome's Web Developer Tools. But how to remove it forever?

How can I do that? I bet Adblock does not help me, nor do good intentions. Even if I try, I end up skimming through the comments which is not good for my mental health. Hint: It's a sports website with very low-quality comments.

So here is the virtual example:

  • SITE: www.sportsrumours.com
  • DIV to block: <div class="comments">All annoying comments go here</div>
  • The DIV is the same on all pages of www.sportsrumours.com

mcbetz

Posted 2014-05-28T13:43:57.440

Reputation: 338

Answers

25

For this kind of thing, I normally recommend the Stylish Addon for chrome.

Browse to the site when you have installed teh addon and go to:

Stylish (Icon) > Manage Installed Styles > Write New Style. Give it a name and select "applies to". Give the domain of the site you want to remove the comments from and select "URLs on the domain".

use code similar to the following to hide the div:

.comments {display: none !important;}

Save, and you should notice the div is now hidden

EDIT: Stylish is now Stylus - you can download it here: https://chrome.google.com/webstore/detail/stylus/clngdbkpkpeebahjckkjfobafhncgmne

Fazer87

Posted 2014-05-28T13:43:57.440

Reputation: 11 177

FYI: After the scandal following Stylish's data collection practices, the code has been forked, cleaned and re-published as "Stylus". Rejoice! – Vincent Vancalbergh – 2018-08-16T08:39:47.037

11

You can use Adblock Plus chrome or firefox extension. When enabled, click its extension icon and then click "Block element". Then you can click an element in the page that you want blocked.

Adblock Plus will then block that element each time it is found.

Andrew

Posted 2014-05-28T13:43:57.440

Reputation: 121

2Dunno why this was downvoted. Adblockers have supported blocking elements for a very long time now. So if you can create a rule for it in Stylish, you can block it using Adblock Plus or uBlock Origin, because they support CSS selectors. – Daniel B – 2016-12-23T17:28:22.347

1Nice! Used AdBlock Plus for many years but never noticed that neat feature. Sometimes I get those "duh" moments ;-) – deryb – 2018-03-20T22:00:02.723

WOW! Great tip. Thank you. With Adblock Plus you can easily remove any element you wish. – HomTom – 2018-06-26T09:16:44.423

Much easier than the accepted solution – Owen – 2018-09-25T13:32:55.677

1

You can use Stylebot chrome extension. After installing go to the website, open Stylebot and use the arrow-tool for selecting the DIV. Then look for Layout and visibility and click on hide. The DIV will disappear and the change will be persisted. Of course, you can undo that whenever you want.

drk.com.ar

Posted 2014-05-28T13:43:57.440

Reputation: 2 287

1Stylebot did not seem to work for me. Stylish recommended in the other anwer works great. – Tim Swast – 2016-02-18T18:19:14.227