Block YouTube Shorts Completely

Hides YT Shorts (I use this to focus better on my work)

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

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.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name                Block YouTube Shorts Completely
// @namespace    http://tampermonkey.net/
// @version            2.0
// @description    Hides YT Shorts (I use this to focus better on my work)
// @author             Emree.el on instagram 
// @match             https://www.youtube.com/*
// @grant               none
// @license           MIT
// ==/UserScript==

(function() {
    'use strict';

    const removeShorts = () => {
        const selectors = [
            'ytd-rich-shelf-renderer:has(a[href^="/shorts"])',
            'ytd-reel-shelf-renderer',
            'a[href^="/shorts"]',
            'ytd-grid-video-renderer:has(a[href^="/shorts"])',
            'ytd-reel-item-renderer',
            'ytd-video-renderer:has(a[href*="shorts"])',
            'a[title="Shorts"]', // Sidebar Shorts button
            'a[href="/shorts"]'   // Any other direct shorts button
        ];

        selectors.forEach(selector => {
            document.querySelectorAll(selector).forEach(el => el.remove());
        });
    };

    setInterval(removeShorts, 1000); // run every second to clean up
})();