Skip to content

Instantly share code, notes, and snippets.

@viki53
Last active April 15, 2026 13:56
Show Gist options
  • Select an option

  • Save viki53/5d0f45e5f7ff2f77a772cb1f5694f2dc to your computer and use it in GitHub Desktop.

Select an option

Save viki53/5d0f45e5f7ff2f77a772cb1f5694f2dc to your computer and use it in GitHub Desktop.
LinkedIn distraction-free

LinkedIn distraction free

What does this do?

It hides some distracting elements on LinkedIn's pages (especially the main feed), such as:

  • Upsell links
  • The news block
  • The games block
  • The "For companies" menu in the navbar

How to install

There is two main ways, depending on which browser/extension you use.

Stylus, for Firefox, Chrome, Opera (or any Chrome-based browser)

You need to install and activate an extension that accepts UserStyle files, such as Stylus.

Then open the raw firefox-stylus.user.css file in a new tab. The extension should install the styles automatically, or prompt you to do so. You can also manually create a new style in the extension and paste the contents of that raw file.

Browse LinkedIn with less distractions ✨

Userscripts, for Safari (iOS and macOS)

You need to have the Userscripts extension installed and activated.

Note: you will need to allow its use on the linkedin.com domain.

You can then open the extension page, and add a New CSS file in the sidebar and paste the contents of the raw safari.userscripts.css file into the editor, or add a New Remote and enter the URL of the raw file.

Updates

You should ask the extension to update the script whenever a new version is available. Both extensions have an auto-update feature that will fetch and install the new versions when available (based on the updateURL parameter in the comment block at the top of the file).

/* ==UserStyle==
@name linkedin-no-distraction
@namespace linkedin.com
@description Remove most distractions on LinkedIn
@version 1.7.0
@author Corentin Hatte (https://www.github.com/viki53)
@homepageURL https://gist.github.com/viki53/5d0f45e5f7ff2f77a772cb1f5694f2dc
@updateURL https://gist.github.com/viki53/5d0f45e5f7ff2f77a772cb1f5694f2dc/raw/firefox-stylus.user.css
@preprocessor default
==/UserStyle== */
@-moz-document domain("linkedin.com") {
/* Hide Enterprise menu in navbar */
header > div > div > div > div:last-child > div > div:last-child {
display: none !important;
}
/* ====== Hide upsell links ====== */
/* Enterprise & premium links in header */
header div:has(> [data-view-name="premium-nav-upsell-text"]),
header [data-testid="primary-nav"] hr + nav + div,
/* News module on the side */
main > div > div > div:nth-child(3):last-child > div > div > div > div > div:first-child,
/* Games suggestions in sidebar */
main > div > div > div:nth-child(3):last-child > div > div > div > div > div:last-child:has(> p + div) {
display: none;
}
/* Empty sidebar card, now that news and games are hidden */
main > div > div > div:nth-child(3):last-child > div > div:first-child > div::before {
content: '🫥';
display: block;
text-align: center;
font-size: 2rem;
}
}
/* ==UserStyle==
@name linkedin-no-distraction
@namespace linkedin.com
@description Remove most distractions on LinkedIn
@match https://*.linkedin.com/*
@version 1.7.0
@author Corentin Hatte (https://www.github.com/viki53)
@homepageURL https://gist.github.com/viki53/5d0f45e5f7ff2f77a772cb1f5694f2dc
@updateURL https://gist.github.com/viki53/5d0f45e5f7ff2f77a772cb1f5694f2dc/raw/safari.userscripts.css
==/UserStyle== */
/* Hide Enterprise menu in navbar */
header > div > div > div > div:last-child > div > div:last-child {
display: none !important;
}
/* ====== Hide upsell links ====== */
/* Enterprise & premium links in header */
header div:has(> [data-view-name="premium-nav-upsell-text"]),
header [data-testid="primary-nav"] hr + nav + div,
/* News module on the side */
main > div > div > div:nth-child(3):last-child > div > div > div > div > div:first-child,
/* Games suggestions in sidebar */
main > div > div > div:nth-child(3):last-child > div > div > div > div > div:last-child:has(> p + div) {
display: none;
}
/* Empty sidebar card, now that news and games are hidden */
main > div > div > div:nth-child(3):last-child > div > div:first-child > div::before {
content: '🫥';
display: block;
text-align: center;
font-size: 2rem;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment