How To Disable Auto-Play Videos in Safari – macOS

You open Safari to browse the Internet. You visit a web site and want to read an interesting article, you are very happy but while the website is loading, you hear something, someone is talking, because a video has automatically started playing without your permission.

Some websites (e.g., CNET) do this so a video or audio automatically plays when the webpage is loaded. These are usually some sort of video based advertisings.

This in-fact is very annoying. I think it is safe to say that automatically starting a video can annoy a lot of visitors. For instance, suppose you are in a quiet library and studying. Autoplay can be intrusive for someone who is in a quiet area.

Yesterday morning I visited CNET. Then I heard someone talking. I had no idea what was going on and who was talking. Then I realized the sound was coming from my MacBook. It took me a few seconds to realize what was going on. I think many users are like me. Some users may even have troubles finding the mechanism to stop it.

Furthermore, sometimes when people are reading their social media feeds (e.g., Facebook, Twitter etc), disturbing, often graphic, videos automatically start playing. For instance, the killing of Russian ambassador was recorded on video and it was watched by many people on social media unwittingly.

Cnet autoplay example
CNET Auto play

Turn off autoplay

So you want to stop videos (HTML5 videos) from autoplaying when you visit a website that has autoplaying contents, because autoplay is (1) annoying (2) time consuming (3) causing people to use more cellular data. Here is how:

First thing we need to do is to enable Safari’s debug menu in macOS. The debug menu offers additional features for the purpose of debugging.

  • Quit Safari (Safari > Quit Safari)
  • Open the Terminal app (/Applications/Utilities)
  • Enter this command. This command will unhide the debug menu:
  • defaults write com.apple.Safari IncludeInternalDebugMenu 1terminal app
  • Press Return
  • Close the Terminal app
  • Now reopen Safari

Now you have enabled the debug mode and you will see the debug menu in Safari’s menubar.

Safari debug menu

Now go to Safari > Debug > Media Flags and select Disallow Inline Video. Selecting this will stop videos from automatically playing when you visit a webpage. This will stop all soft of autoplaying, including social media videos. So you do not see unwanted contents.

disallow inline videos to sop autoplay

Now you can hide Debug Menu again. If you want to turn off Debug Menu, follow these steps:

  • Open the Terminal app
  • And enter the following command:
  • defaults write com.apple.Safari IncludeInternalDebugMenu 0
  • Close the Terminal app
  • And restart Safari

And one note to the web developers: 

Auto play is an accessibility and usability issue. Word Wide Web Consortium (W3C) does not recommend it by saying “we discourage the practice of automatically starting sounds (especially if they last more than 3 seconds), and encourage that the sound be started by an action initiated by the user after they reach the page…”

See also:

Dr. Serhat Kurt worked as a Senior Technology Director. He holds a doctoral degree (or doctorate) from the University of Illinois at Urbana / Champaign and a master’s degree from Purdue University. Here is his LinkedIn profile.

Thank you for choosing to leave a comment.

Please note the following:

  • All comments are moderated.
  • Your email will NOT be published nor shared.
  • All SPAM comments will be deleted.
  • Please see our comment policy page for more info.

34 thoughts on “How To Disable Auto-Play Videos in Safari – macOS”

  1. I’ve enabled the debug drop down but the “Media Flags” option is missing from my list? I am using OS 10.11.6 I have very limited bandwidth due to remote location and the automatic video loading is incredibly annoying.

    Reply
  2. It works for me but now my games won’t start. FB was easy to fix in settings, videos, change default to no. But my games! I have to go to debug to allow them to work. Is there another option?

    Reply
  3. the problem I have is that it seems that the command is not being saved, did all the steps and no debug, when I go into the terminal is not showing the command, how can I make sure the command is being saved?

    Reply
  4. Thanks! Easy! If I had to listen to that IBM Watson ad on CNN ONE MORE TIME I wouldn’t be responsible for my actions :\

    Reply
  5. one thing i’ve found is that youtube videos now open in fullscreen when you hit play. i found that if you choose “Video Needs User Action” from the drop down menu instead, it cures that, and the tendency of facebook videos to open fullscreen while still blocking autoplay…

    thank you so much! autoplay videos are a plague.

    Reply
    • Did you just close Safari? You need to “QUIT” Safari before doing the
      terminal command. I made that mistake myself and after “QUITTING”
      Safari and then issuing the commands it worked.

      Reply
  6. Thank you so much for providing this update. I have been frustrated with the annoying interruption of sites when visiting., NO longer, thanks again.
    Like all others I am happy that I not forced or subjected to auto running of videos that I do not enjoy or want to watch.
    John 10 May 2017

    Reply
  7. When I use this tip on youtube, it only works for one time. when click ‘related videos’ or go back to the last page, starts autoplay again. (MacOs Sierra, 10.12.4)

    Reply
  8. “Serhat, the frustration saver” 🙂
    I was considering a class action lawsuit against autoplay supporting websites and ad providers for unauthorized use of my contracted ISP data, associated costs, wear and tear on hardware and productive time.
    Thanks Serhat!

    Reply
  9. Thank you Serhat for solving this incredibly frustrating problem (I have no idea why sites use these types of videos — they absolutely drive people away). I was at my wit’s end trying various ad blockers and changing different Safari settings … this is the only tip I’ve found that effectively worked. Thank you!

    Reply
  10. After doing this I cannot open my Facebook game………I get this:

    Error
    Warning
    Login Error: There is an error in logging you into this application. Please try again later.

    Please help!

    Reply
  11. Thank you for this! I have noticed that the fix makes Facebook videos play fullscreen when clicking to start them, which I don’t really like, so I tried tinkering and found that checking “Video Needs User Action” instead of “Disallow Inline Video” seems to work better–just click on a video and it plays like normal. I’m not expert enough to offer advice to others, but maybe the author could comment on whether or not this is also a good solution?

    Reply

Leave a Comment