How to Block Sites in Safari (with Pictures)

Table of contents:

How to Block Sites in Safari (with Pictures)
How to Block Sites in Safari (with Pictures)

Video: How to Block Sites in Safari (with Pictures)

Video: How to Block Sites in Safari (with Pictures)
Video: 3 Ways to Delete Safari Website Data on iPhone and iPad 🔥 2024, November
Anonim

This wikiHow teaches you how to prevent Safari from accessing certain sites on both iPhone and Mac platforms. You can change this setting from the " Restrictions " menu on your iPhone, but you'll need to edit the hosts file on a Mac if you want to block sites on the desktop version of Safari.

Step

Method 1 of 2: Via iPhone

Block a Website in Safari Step 1
Block a Website in Safari Step 1

Step 1. Open the iPhone settings menu (“Settings”)

Iphonesettingsappicon
Iphonesettingsappicon

Touch the app icon that looks like a gray gear to open it. Usually, the icon Settings ” can be found on the device's home screen.

Block a Website in Safari Step 2
Block a Website in Safari Step 2

Step 2. Swipe the screen and touch

Iphonesettingsgeneralicon
Iphonesettingsgeneralicon

"General".

This option is at the top of the third main group of options, at the top of the “Settings” page.

Block a Website in Safari Step 3
Block a Website in Safari Step 3

Step 3. Scroll down and select Restrictions

It's in the middle of the page.

Block a Website in Safari Step 4
Block a Website in Safari Step 4

Step 4. Enter the restriction passcode or “Restrictions”

This code is set when you previously enabled the restriction feature, and is not always the same as the regular passcode applied to the device.

If you haven't enabled the restriction feature, touch the option “ Enable Restrictions ” and enter the desired passcode twice.

Block a Website in Safari Step 5
Block a Website in Safari Step 5

Step 5. Scroll to the "ALLOWED CONTENT" section and tap Websites

This segment is in the bottom half of the page.

Block a Website in Safari Step 6
Block a Website in Safari Step 6

Step 6. Touch Limit Adult Content

It's at the top of the screen. A check mark will appear on the left side of the option and indicate that this option is active.

Block a Website in Safari Step 7
Block a Website in Safari Step 7

Step 7. Touch Add a Website

Select this option in the " NEVER ALLOW " section (not the " ALWAYS ALLOW " segment) at the bottom of the page.

Block a Website in Safari Step 8
Block a Website in Safari Step 8

Step 8. Type in the website URL

The URL entered is the URL of the website you want to block. Make sure you include all parts of the site URL (eg "www.example.com" and not just "example.com").

Block a Website in Safari Step 9
Block a Website in Safari Step 9

Step 9. Touch Done

It's a blue button in the lower-right corner of your keyboard. After that, the selected website will be blocked in Safari.

Method 2 of 2: Via Desktop

Block a Website in Safari Step 10
Block a Website in Safari Step 10

Step 1. Open the Spotlight app

Macspotlight
Macspotlight

Click the magnifying glass icon in the upper-right corner of the screen.

Block a Website in Safari Step 11
Block a Website in Safari Step 11

Step 2. Type terminal into the Spotlight window

After that, your Mac will search for the Terminal app.

Block a Website in Safari Step 12
Block a Website in Safari Step 12

Step 3. Click

Macterminal
Macterminal

"Terminals".

This option is the top search result displayed below the Spotlight search bar.

Block a Website in Safari Step 13
Block a Website in Safari Step 13

Step 4. Type

sudo nano /etc/hosts

in the Terminal window and press the button Returns.

The command to open the hosts file will be executed. These files are files on your computer that control websites that are accessible in all web browsers, including Safari.

Block a Website in Safari Step 14
Block a Website in Safari Step 14

Step 5. Enter the computer administrator password and press the Return key

The password entered is the password used to log into the Mac computer. You won't see any characters when you type your password, but each character will still be entered into the Terminal window.

Block a Website in Safari Step 15
Block a Website in Safari Step 15

Step 6. Wait for the hosts file to open

This process takes only a few seconds. Once the file is opened in a new window, you can move on to the file editing process.

Block a Website in Safari Step 16
Block a Website in Safari Step 16

Step 7. Scroll to the bottom of the rice and press Return key

Use the arrow keys to move to the bottom of the file. Press Return key to create a new line.

Block a Website in Safari Step 17
Block a Website in Safari Step 17

Step 8. Type

127.0.0.1

and press the button tab.

After that, a sufficiently large space or space will be added between the code 127.0.0.1 and the next text.

Block a Website in Safari Step 18
Block a Website in Safari Step 18

Step 9. Type in the URL of the website you want to block

Generally, this URL includes the www., website name (eg Google), and.com,.net, or.org sections.

  • This line of code should look like: 127.0.0.1 www.facebook.com.
  • If you want to block multiple websites, each URL must be added to its own line.
Block a Website in Safari Step 19
Block a Website in Safari Step 19

Step 10. Save the file and close the editor window

After entering all the sites you want to block, save the file and exit the editor window by pressing the Control+O key combination and pressing Return. To exit the hosts file, press the key combination Control+X.

Block a Website in Safari Step 20
Block a Website in Safari Step 20

Step 11. Clear DNS

For the setting effect to take effect, you need to clear the DNS cache. You can leave it blank by typing

sudo killall -HUP mDNSResponder;say DNS cache has been flushed

and pressing the Return key.

Tips

Blocking a website through the " Restrictions " menu will also block the website in question in other browsers on your iOS device

Recommended: