# So long, YouTube shorts!

Is that time of the year where I commit to being better, to be more present, to do more, to procrastinate less... you know... the whole New Year deal.

One thing I want more of is more control over my time and social media doesn't help me do that. Specially short format videos like TikTok, Instagram Reels or my ultimate nemesis: YouTube shorts. I manage to avoid the other two because I don't use TikTok and I download Instagram about once a month, check what's been going on with my friends and delete it again. But Shorts... damn Shorts. They pull me in and, even though I try very hard not to fall into their trap, I fall more often than I like to accept.

So to help me tackle this, I created a ridiculously simple browser extension for myself that simply removes Shorts from YouTube so I have the old school YouTube browsing experience. I won't go into too much detail into how extensions work –I learnt the very very basics to get this going [here](https://developer.chrome.com/docs/extensions/develop/concepts/content-scripts)– but for anyone else wanting to stick it to the man, here's the code.

Stick all of these into a folder:

A manifest:

```json
 {
    "manifest_version": 3,
    "name": "Shorts Blocker"
    "description": "An extensio to block YouTube Shorts",
    "version": "1.0",
    "action": {
      "default_popup": "ui.html",
      "default_icon": "default_icon.png"
    },
    "content_scripts": [
      {
        "matches": ["https://*.youtube.com/*"],
        "css": ["styles.css"],
        "run_at": "document_end"
      }
    ]
  }
```

A CSS file:

```css
/* styles.css */

a[title="Shorts"], [is-shorts], #shorts-container {
    display: none !important;
}
```

An HTLM file for the UI:

```xml
<!-- ui.html -->
<html>
  <body>
    <h1>Shorts blocked!</h1>
  </body>
</html>
```

And an icon. You can get one in the link above to the Chrome docs.

That's it. Now there's no visual queue to pull me into Shorts and if I navigate to `/shorts` it autoplays the first one but doesn't display anything and doesn't let me navigate. Hacky? Sure. Effective? 100%.

You can install this in any browser. I added it to Safari (docs [here](https://developer.apple.com/documentation/safariservices/safari_web_extensions/developing_a_safari_web_extension)) and to Chrome (docs [here](https://developer.chrome.com/docs/extensions/develop/concepts/content-scripts)).
