Strudels

remove Google AI Overview and AI Mode tab

Dec 8th, 2025 (edited)
25
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         remove stupid AI Overview on stupid google results. stupid-ass website
  3. // @namespace    http://tampermonkey.net/
  4. // @version      2025-08-27
  5. // @description  ugh
  6. // @author       Rippy
  7. // @match        http*://*.google.com/*
  8. // @icon         https://www.google.com/s2/favicons?sz=64&domain=google.com
  9. // @grant        none
  10. // ==/UserScript==
  11.  
  12. (function() {
  13.     'use strict';
  14.     for (const a of document.querySelectorAll("span")) {
  15.         if (a.textContent.includes("AI Mode")) {
  16.             a.remove();
  17.         }
  18.     }
  19.     // this part stolen from https://greasyfork.org/en/scripts/518154-remove-the-ai-summary-from-google-search/code
  20.     const patterns = [
  21.         /ai overview/i
  22.     ];
  23.     const observer = new MutationObserver(() => {
  24.         const aiOverviewH1 = [...document.querySelectorAll('h1')].find(h1 => patterns.some(pattern => pattern.test(h1.innerText)));
  25.         if (aiOverviewH1?.parentElement) {
  26.             aiOverviewH1.parentElement.style.display = 'none';
  27.         }
  28.         document.querySelectorAll("div").forEach((e) => {
  29.             if (e.innerText === "AI Overview") {
  30.                 e.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.remove();
  31.             }
  32.         });
  33.     });
  34.     observer.observe(document, {
  35.         childList: true,
  36.         subtree: true,
  37.     });
  38. })();
Advertisement
Add Comment
Please, Sign In to add comment