← All examples

JavaScript Ads & clutter quora.com

Quora: hide promoted posts in the feed

Detects "Promoted" and "Sponsored" labels in the feed and hides whole cards with advertising answers and questions.

Code to copy

// Hide promoted/sponsored answers and questions in the feed
function hidePromoted() {
  const labels = ['Promoted', 'Sponsored', 'Promowane', 'Gesponsert', 'Sponsorisé', 'Sponsorizzato', 'Patrocinado', 'Реклама'];
  document.querySelectorAll('[class*="q-box"]').forEach(function (box) {
    const t = (box.textContent || '').trim();
    if (t.length > 60) { return; }
    if (labels.some(function (l) { return t === l || t.startsWith(l + ' '); })) {
      let card = box.closest('[class*="q-box"][id]') || box.parentElement;
      for (let i = 0; i < 6 && card; i++) {
        if (card.getAttribute('id') && card.getAttribute('id').length > 8) { break; }
        card = card.parentElement;
      }
      if (card) { card.style.setProperty('display', 'none', 'important'); }
    }
  });
}
hidePromoted();
const obs = new MutationObserver(hidePromoted);
obs.observe(document.documentElement, { childList: true, subtree: true });

How to use this example

  1. Copy the code with the button above.
  2. Install JustZix (2 minutes) and open the extension on the target page.
  3. Add a new rule matching that page.
  4. Paste the code into the rule's JavaScript panel and save — it runs on every page visit.

Rate this example

No ratings yet — be the first.

Does this example work?

Snippets are useless without somewhere to paste them.

JustZix takes 2 minutes to install and runs your code on every matching page. No account, no payment.

Download free See use cases