Mute Spotify Ads on Mac OS X

Automatically mute Spotify when ads play and unmute when music resumes

Download and Install

For users who prefer a simple, one-click solution.
(macOS Monterey version 12 or newer)

This method uses a pre-made Shortcut app to launch this script. No technical knowledge required

1

Download the Shortcut App

2

Follow the instructions on the video

3

Launch It

  1. Launch Spotify App
  2. Find Mute Spotify Ads in your Shortcut library or search it using Spotlight
  3. Click the Play button to run it

The shortcut will run in the background and automatically mute Spotify when ads play.

Note: Once Spotify is closed the shortcut will stop running too.

How It Works

This shortcut does exactly what the console install does, but with a user-friendly interface. The shortcut runs quietly in the background without interrupting your listening experience.

Console Install

For tech savvy users or macOS versions without Shortcut App

Terminal Knowledge Required

This method requires familiarity with Terminal commands. If you're not comfortable with the command line, we recommend using the Simple Method above.

This method runs the same shell script in the background to detect and mute Spotify ads. You'll need to use Terminal and have basic command-line knowledge.

1

Download and Install

  1. Open the application Terminal. Search it inside your Applications folder or using Spotlight search (cmd+space bar) and type terminal.app
  2. Inside that white window (that’s the terminal app) paste this command and then hit enter. Make sure to copy the whole content.
  3. mkdir -p ~/MuteSpotifyAds && curl https://raw.githubusercontent.com/gdi3d/mute-spotify-ads-mac-osx/master/NoAdsSpotify.sh > ~/MuteSpotifyAds/NoAdsSpotify.sh
  4. This will create a new folder inside your Home folder called MuteSpotifyAds and will place a new file called NoAdsSpotify.sh
2

Run the script

  1. To run the program just copy and paste the code below in the terminal and hit enter
  2. sh ~/MuteSpotifyAds/NoAdsSpotify.sh

    If you want to enable desktop notifications run this

    sh ~/MuteSpotifyAds/NoAdsSpotify.sh show
  3. Open Spotify App and enjoy!
  4. After you’re done listening to your tracks you can close this application by closing the terminal app. Remember: You need to run this program the next time you open Spotify if you want to mute the Ads

Full process demo


Stats file (Advanced Users)

The script generates a file called stats.txt that stores the amount of seconds of ads blocked.

By default the file is created in the same folder where script is installed.

You can change the location of this file by defining the environment variable MUTE_SPOTIFY_STATS_PATH using the full path. Ex: /Users/joe/.local/mute-spotify-ads-mac-osx

You can view the stats file at any time to see how many seconds of ads you've muted. The file is automatically created and updated by the script.

How to uninstall?

  1. Open Finder and navigate to your Home folder (🏠 icon)
  2. Find the folder called MuteSpotifyAds and delete it.
  3. Open Shortcut App and remove the Mute Spotify Ads item.

Which Method Should You Choose?

Simple Method (Shortcut App)

  • Best for: Most users, especially those not comfortable with Terminal
  • Setup time: 1-2 minutes
  • Technical knowledge: None required

Advanced Method (Terminal Script)

  • Best for: Developers, power users, and Terminal enthusiasts
  • Setup time: 2-3 minutes
  • Technical knowledge: Basic Terminal skills required

Both Methods Achieve the Same Result

Whether you choose the Simple Method or the Advanced Method, both approaches accomplish the same goal: automatically muting Spotify when ads play and unmuting when your music resumes. The Shortcut app essentially packages the terminal script into a user-friendly application that's easier to install and run for most users.

How does it work?

The script detects Spotify ads using AppleScript (osascript), turns down the volume when ads play, and restores the previous volume when music resumes.

Repository

The complete source code for this project is available on GitHub. Feel free to explore, contribute, or report issues.

GitHub Repository

https://github.com/gdi3d/mute-spotify-ads-mac-osx

This is an open-source project. Contributions, bug reports, and feature requests are welcome!

Need help?

If you've any questions or feedback, you can send me a message on LinkedIn or use the form bellow: