How To Block A Website In Safari (with Pictures) - WikiHow

Skip to ContentQuizzes
  • Home
  • Random
  • Browse Articles
  • Quizzes & Games
  • All QuizzesHot
  • Love Quizzes
  • Personality Quizzes
  • Fun Games
  • Dating Simulator
  • Learn Something New
  • Forums
  • Courses
  • Happiness Hub
  • Explore More
  • Support wikiHow
  • About wikiHow
  • Log in / Sign up
Terms of Use wikiHow is where trusted research and expert knowledge come together. Learn why people trust wikiHow How to Block a Website on Safari for an iPhone & Mac PDF download Download Article Prevent Safari from opening certain sites with this quick guide Written by Jack Lloyd

Last Updated: May 5, 2025

PDF download Download Article
  • On iPhone
  • |
  • On Desktop
  • |
  • Video
  • |
  • Q&A
  • |
  • Tips
  • |
  • Warnings
|Show more |Show less X

This article was co-authored by wikiHow staff writer, Jack Lloyd. Jack Lloyd is a Technology Writer and Editor for wikiHow. He has over two years of experience writing and editing technology-related articles. He is technology enthusiast and an English teacher. This article has been viewed 649,453 times. Learn more...

This wikiHow teaches you how to prevent Safari from accessing a specific site on both iPhone and Mac platforms. You can change this setting from within the Restrictions menu on an iPhone, but you'll need to edit the hosts file on Mac if you want to block a site on desktop.

Blocking Websites on Safari

On an iPhone, go to Settings > General > Restrictions. Enter your passcode and tap “Websites.” Then, tap “Limit Adult Content” and add the websites you want to block under “NEVER ALLOW.”

Steps

Method 1 Method 1 of 2:

On iPhone

PDF download Download Article
  1. Step 1 Open your iPhone's Settings icon. 1 Open your iPhone's Settings iPhone Settings App Icon. Tap the grey app with gears on it to do so. You'll likely find Settings on the Home Screen.
  2. Step 2 Scroll down and tap icon General. 2 Scroll down and tap iPhone Settings General Icon General. It's at the top of the third main group of options near the top of the Settings page. Advertisement
  3. Step 3 Scroll down and tap Restrictions. 3 Scroll down and tap Restrictions. It's in the middle of the page.
  4. Step 4 Enter your Restrictions passcode. 4 Enter your Restrictions passcode. This is the code you set when you turned on Restrictions—not necessarily the same as your iPhone's regular passcode.
    • If you haven't yet turned on Restrictions, instead tap Enable Restrictions and then enter your preferred passcode twice.
  5. Step 5 Scroll down to the "ALLOWED CONTENT" section and tap Websites. 5 Scroll down to the "ALLOWED CONTENT" section and tap Websites. This area is about halfway down the page.
  6. Step 6 Tap Limit Adult Content. 6 Tap Limit Adult Content. It's near the top of the page. A blue checkmark will appear to this option's left, signifying that it is active.
  7. Step 7 Tap Add a Website. 7 Tap Add a Website. Do this in the "NEVER ALLOW" section (not the "ALWAYS ALLOW" section) near the bottom of the page.
  8. Step 8 Type in your website's URL. 8 Type in your website's URL. This should be the website you want to block; make sure you include all parts of the website's URL (e.g., "www.example.com" rather than "example.com").
  9. Step 9 Tap Done. 9 Tap Done. It's a blue button in the bottom-right corner of the keyboard. This will block your selected website in Safari.
  10. Advertisement
Method 2 Method 2 of 2:

On Desktop

PDF download Download Article
  1. Step 1 Open Spotlight icon. 1 Open Spotlight Mac Spotlight. Click the magnifying glass icon in the top-right corner of the screen.
  2. Step 2 Type terminal into Spotlight. 2 Type terminal into Spotlight. This will search your Mac for the Terminal app.
  3. Step 3 Click icon Terminal. 3 Click Mac Terminal Terminal. It should be the top result beneath the Spotlight search bar.
  4. Step 4 Type sudo nano /etc/hosts into Terminal and press ⏎ Return. 4 Type sudo nano /etc/hosts into Terminal and press Return. This will run a command to open the hosts file, which is a file on your Mac that controls the websites you can access in all web browsers—Safari included.
  5. Step 5 Enter your Mac's administrator password and press ⏎ Return. 5 Enter your Mac's administrator password and press Return. This is the password you use to log into your Mac. You won't see the characters appear as you type, but they will be entered into Terminal nonetheless.
  6. Step 6 Wait for the hosts file to open. 6 Wait for the hosts file to open. This may take a few seconds. Once the file opens in a new window, you can proceed with editing it.
  7. Step 7 Scroll to the bottom of the file and press ⏎ Return. 7 Scroll to the bottom of the file and press Return. Use the arrow key to navigate to the bottom of the file. Pressing Return will create a new line.
  8. Step 8 Type in 127.0.0.1 and then press Tab ↹. 8 Type in 127.0.0.1 and then press Tab . This should leave a few spaces' worth of room between 127.0.0.1 and the next piece of text.
  9. Step 9 Type in the URL of the website you want to block. 9 Type in the URL of the website you want to block. This will typically consist of typing www., the website's name (e.g., Google), and .com, .net, or .org.
    • The line will look something like this: 127.0.0.1 www.facebook.com.
    • If you're blocking multiple websites, each URL must be on its own line.
  10. Step 10 Save and exit the editor. 10 Save and exit the editor. Once you have entered all of the sites that you want to block, save and exit by pressing Control+O and then pressing Return. To exit the hosts file, press Control+X.
  11. Step 11 Flush your DNS... 11 Flush your DNS. In order for the settings to take effect, you will need to flush your DNS cache. You can do this by typing sudo killall -HUP mDNSResponder;say DNS cache has been flushed and pressing Return.
  12. Advertisement

Community Q&A

Search Add New Question
  • Question How can I block something on an iOS device? Community Answer Community Answer To block a website like Facebook from stealing your information do the following: Follow these instructions to the "website" screen, but THEN, go to the "Limit Adult Content" section. There will be an option that says "Never Allow This site". Type in Facebook. Thanks! We're glad this was helpful. Thank you for your feedback. If wikiHow has helped you, please consider a small contribution to support us in helping more readers like you. We’re committed to providing the world with free how-to resources, and even $1 helps us in our mission. Support wikiHow Yes No Not Helpful 4 Helpful 6
  • Question At step 2 when I enter sudo nano /etc/hosts and press enter, I get a little symbol of a "key" which will not allow me to enter my administrator's password. Any suggestions to overcome this? Community Answer Community Answer When the key symbol appears, type the administrator's password and ignore the fact that what you type doesn't show up on the screen, then press enter. The password is just invisible on your screen for security reasons. Thanks! We're glad this was helpful. Thank you for your feedback. If wikiHow has helped you, please consider a small contribution to support us in helping more readers like you. We’re committed to providing the world with free how-to resources, and even $1 helps us in our mission. Support wikiHow Yes No Not Helpful 2 Helpful 6
  • Question I found that the method mentioned in the article blocks all the websites I have added except Bing. How do I block Bing? Community Answer Community Answer I have found that with some websites you need to add multiple versions of the url to get the block to work, such as one line with the 3 w's before the url and another without it. Thanks! We're glad this was helpful. Thank you for your feedback. If wikiHow has helped you, please consider a small contribution to support us in helping more readers like you. We’re committed to providing the world with free how-to resources, and even $1 helps us in our mission. Support wikiHow Yes No Not Helpful 2 Helpful 5
See more answers Ask a Question 200 characters left Include your email address to get a message when this question is answered. Submit Advertisement

Video

Tips

  • Blocking a website from the Restrictions menu will also block it in other browsers on your iOS device. Thanks Helpful 0 Not Helpful 1
Submit a Tip All tip submissions are carefully reviewed before being published Name Please provide your name and last initial Submit Thanks for submitting a tip for review! Advertisement

Warnings

  • Blocking a website in the hosts file will also block that website in all browsers on your Mac. Thanks Helpful 0 Not Helpful 0
Advertisement

You Might Also Like

Block a Website in All Web Browsers4 Ways to Block a Website in All Web Browsers Block Websites on an iPhoneHow toBlock Websites on an iPhone Block a Website on Your Computer4 Easy Ways to Block Any Website on Your Computer Block FacebookHow to Block Facebook Website and App on Windows, Mac, and Mobile Block Proxy WebsitesHow toBlock Proxy Websites Block Yahoo!How toBlock Yahoo! Block Websites on an iPadHow to Block Websites on iPads Using Screen Time or Apps Block Porn from an iPhoneHow to Block Porn Sites & Adult Content on an iPhone Block and Unblock Internet Sites (On a Mac)How to Block and Unblock Websites on a Mac Block YouTube4 Ways to Block YouTube on a Computer, Phone, or Tablet Disable Private Browsing on iPhoneHow to Disable Private Browsing in Safari on iPhone or iPad: Quick Guide Unblock Websites on SafariHow to Access Blocked Sites with Safari on Mac and iPhone Block a Website in Google ChromeHow toBlock a Website in Google Chrome Block Websites on Firefox6 Simple Ways to Block Websites on Mozilla Firefox Advertisement

About This Article

Jack Lloyd Written by: Jack Lloyd wikiHow Technology Writer This article was co-authored by wikiHow staff writer, Jack Lloyd. Jack Lloyd is a Technology Writer and Editor for wikiHow. He has over two years of experience writing and editing technology-related articles. He is technology enthusiast and an English teacher. This article has been viewed 649,453 times. How helpful is this? Co-authors: 24 Updated: May 5, 2025 Views: 649,453 Categories: Safari Browser Article SummaryX

1. Open your iPhone's Settings. 2. Tap General. 3. Tap Restrictions and enter your passcode. 4. Tap Websites in the "ALLOWED CONTENT" section. 5. Tap Limit Adult Content. 6. Tap Add a Website in the "NEVER ALLOW" section. 7. Enter your website's URL. 8. Tap Done. Did this summary help you?YesNo

In other languages Spanish Italian Portuguese Russian German French Indonesian Dutch Arabic Japanese
  • Print
  • Send fan mail to authors
Thanks to all authors for creating a page that has been read 649,453 times.

Is this article up to date?

Yes No Advertisement Cookies make wikiHow better. By continuing to use our site, you agree to our cookie policy. Jack Lloyd Written by: Jack Lloyd wikiHow Technology Writer Click a star to vote Co-authors: 24 Updated: May 5, 2025 Views: 649,453

Quizzes & Games

Am I Chronically Online QuizAm I Chronically Online QuizTake QuizDo I Have a Dirty Mind QuizDo I Have a Dirty Mind QuizTake QuizFunny or Cringe? (Brainrot Edition)Funny or Cringe? (Brainrot Edition)Take QuizHow Skibidi Am I QuizHow Skibidi Am I QuizTake QuizGeneral Knowledge QuizGeneral Knowledge QuizTake QuizGuess the Lyrics From First Letters QuizGuess the Lyrics From First Letters QuizTake Quiz

You Might Also Like

Block a Website in All Web Browsers4 Ways to Block a Website in All Web BrowsersBlock Websites on an iPhoneHow toBlock Websites on an iPhoneBlock a Website on Your Computer4 Easy Ways to Block Any Website on Your ComputerBlock FacebookHow to Block Facebook Website and App on Windows, Mac, and Mobile

Featured Articles

Remove Shorts from Search Results on YouTubeHow toRemove Shorts from Search Results on YouTubeWhat Are the Korean Animal Face Types? (And Which Type Do You Have?)What Are the Korean Animal Face Types? (And Which Type Do You Have?)Being the Little Spoon While Cuddling: Is It Better Than the Big Spoon?Being the Little Spoon While Cuddling: Is It Better Than the Big Spoon?115+ Funny “Get Well Soon” Messages to Make Someone Laugh115+ Funny “Get Well Soon” Messages to Make Someone Laugh110+ “Fun Facts” for Interviews, Introductions, & Icebreakers110+ “Fun Facts” for Interviews, Introductions, & IcebreakersHow Long Would You Survive In A Zombie Apocalypse?How Long Would You Survive In A Zombie Apocalypse?

Trending Articles

Which Fictional Character Would Crush On You?Which Fictional Character Would Crush On You?What's My Personality Based on My Song Choices QuizWhat's My Personality Based on My Song Choices QuizWhat's My Hottest Feature QuizWhat's My Hottest Feature QuizIs My Crush Pretending Not to Like Me QuizIs My Crush Pretending Not to Like Me QuizHypersexuality TestHypersexuality TestWhat Are the Gay Male Body Types (And Which Do You Have?)What Are the Gay Male Body Types (And Which Do You Have?)

Featured Articles

 Roast Someone in a Rap Battle (Plus the Best Bars of All Time)How to Roast Someone in a Rap Battle (Plus the Best Bars of All Time)What Turns a Girl On? 31 Things to Try on Your PartnerWhat Turns a Girl On? 31 Things to Try on Your PartnerLove AnalyzerLove AnalyzerSending Your Sweetie a Love Note? Here are 200+ Romantic IdeasSending Your Sweetie a Love Note? Here are 200+ Romantic IdeasExercise Your BrainHow toExercise Your BrainBe a Fun Person to Hang out WithHow toBe a Fun Person to Hang out With

Featured Articles

What Does Your Morning Routine Say About You?What Does Your Morning Routine Say About You?Develop Productive HabitsHow toDevelop Productive HabitsPractice Self CareHow toPractice Self CareWhat Song Matches Your Life Right Now?What Song Matches Your Life Right Now?Will 2026 Be Your Year? Reveal Your FutureWill 2026 Be Your Year? Reveal Your FutureUnderstanding the Most Attractive Face Shapes (& Determining Your Own)Understanding the Most Attractive Face Shapes (& Determining Your Own)

Watch Articles

Tie a Loop KnotHow toTie a Loop KnotMake Body OilHow toMake Body OilMake Almond MilkHow toMake Almond MilkWash White Clothes by HandHow toWash White Clothes by HandSkin a ChickenHow toSkin a ChickenClean Tile Floors with VinegarHow toClean Tile Floors with Vinegar

Trending Articles

What Are My Soulmate's Initials QuizWhat Are My Soulmate's Initials QuizChoose Your Own Adventure GameChoose Your Own Adventure GameYour Red Flag Based On Your Celeb CrushesYour Red Flag Based On Your Celeb CrushesHow Tall Will I Be QuizHow Tall Will I Be QuizIf I Had A Baby, What Would It Look Like?If I Had A Baby, What Would It Look Like?Lose Weight FastHow toLose Weight Fast

Quizzes & Games

What Age Is My Brain QuizWhat Age Is My Brain QuizTake QuizWhat Brainrot Word Am I QuizWhat Brainrot Word Am I QuizTake Quiz wikiHow
  • Categories
  • Computers and Electronics
  • Internet
  • Internet Browsers
  • Safari Browser
wikiHow Newsletter You're all set! Helpful how-tos delivered toyour inbox every week! Sign me up! By signing up you are agreeing to receive emails according to our privacy policy.
  • Home
  • About wikiHow
  • Experts
  • Jobs
  • Contact Us
  • Site Map
  • Terms of Use
  • Privacy Policy
  • Do Not Sell or Share My Info
  • Not Selling Info
  • Contribute

Follow Us

×

wikiHow Tech Help Pro:

Level up your tech skills and stay ahead of the curve

Let's go! X --515

Tag » How To Block A Website On Safari