Google AI Mode button remover

Removes or hides the "AI Mode" button from Google Search results

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(Tôi đã có Trình quản lý tập lệnh người dùng, hãy cài đặt nó!)

Advertisement:

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

Advertisement:

// ==UserScript==
// @name         Google AI Mode button remover
// @name:tr      Google AI Modu butonu silici
// @namespace    https://google.com/
// @license MIT
// @version      1.0
// @description  Removes or hides the "AI Mode" button from Google Search results
// @description:tr Google arama sonuçları sayfasında görünen “AI Modu” butonunu otomatik olarak kaldırmak veya gizlemektir.
// @match        https://www.google.com/search*
// @match        https://www.google.com.tr/search*
// @grant        none
// @run-at       document-start
// ==/UserScript==

(function () {
    'use strict';

    function removeAIModeButton() {
        const links = document.querySelectorAll('a');

        links.forEach(link => {
            const text = link.innerText?.trim();

            const href = link.getAttribute('href') || '';

            const isAIMode =
                text === 'AI Modu' ||
                text === 'AI Mode' ||
                href.includes('udm=50') ||
                href.includes('aep=1');

            if (isAIMode) {
                const container =
                    link.closest('[role="listitem"]') ||
                    link.closest('.olrp5b') ||
                    link.parentElement;

                if (container) {
                    container.remove();
                } else {
                    link.remove();
                }
            }
        });
    }

    document.addEventListener('DOMContentLoaded', removeAIModeButton);

    const observer = new MutationObserver(() => {
        removeAIModeButton();
    });

    observer.observe(document.documentElement, {
        childList: true,
        subtree: true
    });
})();