Remove Google AI Overview

Automatically hides the AI Overview section from Google search pages.

As of 20. 06. 2025. See the latest version.

// ==UserScript==
// @name        Remove Google AI Overview
// @description Automatically hides the AI Overview section from Google search pages.
// @namespace   Violentmonkey Scripts
// @match       https://www.google.com/search*
// @icon        https://www.google.com/s2/favicons?sz=64&domain=google.com
// @grant       none
// @version     1.0
// @author      klaufir216
// @license     MIT
// ==/UserScript==

function parentUntil(elem, cond) {
  while (elem) {
    if (cond(elem)) return elem;
    elem = elem.parentNode;
  }
  return null;
}

function removeAiOverview() {
    // detect the sparkly AI symbol based on SVG path
    elem = document.querySelector("path[d='M235.5 471C235.5 438.423 229.22 407.807 216.66 379.155C204.492 350.503 187.811 325.579 166.616 304.384C145.421 283.189 120.498 266.508 91.845 254.34C63.1925 241.78 32.5775 235.5 0 235.5C32.5775 235.5 63.1925 229.416 91.845 217.249C120.498 204.689 145.421 187.811 166.616 166.616C187.811 145.421 204.492 120.497 216.66 91.845C229.22 63.1925 235.5 32.5775 235.5 0C235.5 32.5775 241.584 63.1925 253.751 91.845C266.311 120.497 283.189 145.421 304.384 166.616C325.579 187.811 350.503 204.689 379.155 217.249C407.807 229.416 438.423 235.5 471 235.5C438.423 235.5 407.807 241.78 379.155 254.34C350.503 266.508 325.579 283.189 304.384 304.384C283.189 325.579 266.311 350.503 253.751 379.155C241.584 407.807 235.5 438.423 235.5 471Z']")
      || document.querySelector('div#m-x-content');
    if (!elem) return;
    ai_elem = parentUntil(elem, function(elem) { return elem.getAttribute('data-mlros'); })
    ai_elem?.remove();
}

removeAiOverview();
setInterval(function() { removeAiOverview(); }, 2000);