There are lots of reasons why you might wish to block certain websites on a Mac. Probably the two most common ones are stopping kids from looking at porn on the family computer (but still being able to look things up for homework), and stopping employees from wasting time on Facebook or similar when they should be using work sites.
One method is to install monitoring software on the Mac(s) whose access you want to limit. Possibilities include Norton Family and Net Nanny. Another is to spend some time setting up Parental Controls on the machine they're going to be using.
But if you only want to set up a few restrictions on a single Mac, it's probably easier to just tinker with the settings - and we explain how to do this in following tutorial. Note that this applies restrictions to a separate non-admin user account; the main admin account will still be able to access all the sites it wants to.
We'll assume here that you haven't already set up a separate user account for your kids or whoever isn't supposed to be looking at the sites, but if you have - and that account simply needs to have web-access restrictions placed on it - then we'll explain which steps to skip. This method cannot apply restrictions to administrator accounts.
One final word. You'll spot a few Safari icons in the following dialogue boxes, but don't be fooled: the restrictions will apply to any and every web browser on your Mac. You don't need to set up separate restrictions for Firefox, Chrome and so on.
Open Parental Controls
Open System Preferences - from the dock, or via the apple icon at the top-left corner of the screen - then select Parental Controls. It's got a bright yellow icon.
If you can't see it (and in some versions of Mac OS X the icon will be different), remember that you can find preferences sub-categories using the search field at the top right.
Create a new user account
Since we haven't yet set up our child-friendly, non-administrator user account, the Parental Controls screen doesn't have much to offer. Select 'Create a new user account with parental controls' and click Continue.
(If you've already set up a separate non-admin account, you'll be seeing rather different options. Skip ahead to the step entitled 'Web parental controls'.)
User account details
Creating a new user account is simple. Fill in the five fields, selecting a name (the account name will fill in automatically based on this, but you can edit the choice), password and password hint. Hit Continue.
Web parental controls
Now that we've got a separate user account to apply them to, we can see the full range of parental controls options. You can restrict the apps the user can open, the contacts they can chat to and the times they can use the Mac, but we're focusing on restricted websites.
Make sure the correct account is selected in the lefthand pane; we have only one non-administrator account at present, so that's not an issue here. Select Web (or Content, in older versions of macOS and Mac OS X) in the top bar.
(If another administrator has made changes to the account's restrictions and then locked it, you'll need to click the padlock at the bottom left and then enter your admin password.)
Limit adult websites automatically
You've got three options: allow the user account to visit any websites; stop the account from visiting adult websites (based on Apple's own list - but you can add or remove sites from the restricted list); or restrict the account to a whitelist of approved sites.
Let's start with the second option. Select 'Try to limit access to adult websites automatically' (note the word "try" - Apple doesn't claim that it knows every adult website in the world, so cannot guarantee your child won't stumble across something dodgy if you use this option) and then click Customize.
Customise the blacklist
On this page we can make modifications to Apple's blacklist, either preventing access to a site that Apple isn't aware of (or simply doesn't classify as adult), or allowing something that's been wrongly zapped.
Click the + symbol beneath either box and enter the URL of the site to be allowed or blocked. Click OK.
Set up a whitelist of accepted sites
For greater safety, it's better to go for the whitelist approach - that way you have complete control over the sites your child can visit. (The only way you can get in trouble under this system is if one of the whitelisted sites gets hacked.)
Select the third option - 'Allow access to only these websites' - and then start sorting out the list. Apple starts you off with 10 kid-friendly sites. Press the + symbol to add more or organise permitted bookmarks in folders, or highlight one of the sites and press the - button to take it away.
When you're finished, click on the padlock icon at the bottom left. This locks the settings in place, and will require an admin password in order to change them.
How to unblock websites
Unblocking sites for the account is easy. If you're working from a whitelist (as in step headlined 'Set up a whitelist of accepted sites'), you can add sites to the whitelist as you decide your child is ready for them. Or you can just lift all the site restrictions in one go by selecting the first option in the Web tab: 'Allow unrestricted access to websites'.