Download Article
Block a single specific website in Mozilla Firefox
Download Article
To block a certain website in Firefox, you can use the "Block Site" browser add-on. You can also create a new rule in Windows Defender, or edit your host files on Mac. Here's how to block websites on Firefox using your Windows or Mac computer, iPhone, iPad, or Android.
Blocking Specific Websites on Firefox
- Download the Block Site add-on to Firefox. Open Block Site's options, enter the URL you want to block and click Add .
- Create a new rule in Windows Firewall Defender. Add the website's IP address and select Block the connection .
- Download and use LeechBlock NG to block websites on the Firefox mobile app for Android.
Steps
-
Go to https://addons.mozilla.org/en-US/firefox/addon/block-website . This add-on, called Block Site (by Ray), lets you block individual websites in Firefox. It also lets you set up a private password so you'll be the only person who can remove sites from the block list.
- This Firefox add-on is a part of Firefox's Recommended Extensions program, which means Firefox staff has vetted its functionality and security. [1] X Research source Still, research add-ons before installing them.
-
Click the blue + Add to Firefox button. You can find this next to the add-on description.Advertisement
-
Click Add on the pop-up warning. This adds the extension to Firefox.
-
Check the box next to "Allow this extension to run in Private Windows". This appears in the top-right corner of the browser on the "Block Site has been added to Firefox" window. Checking this option ensures that websites you block will remain blocked when someone tries to open a private browsing window.
-
Click the blue Okay, Got It button to confirm. The add-on is now ready to use.
-
Click the puzzle piece icon. This is at the top-right corner of the window, next to the menu.
- The Add-ons page will open.
-
Click Extensions . This is in the left panel.
-
Open Block Site's options page. Scroll down until you find the Block Site heading, click the three horizontal dots beside it, and then select Options .
-
Type or paste the URL of a website you want to block. This address goes into the "Block a new hostname" field at the top of the page.
- For example, if you wanted to block X (Twitter), you would type www.x.com into this text box.
-
Click Add to add the site to the block list. The site you entered will now appear under "Existing Rules" at the top of the page.
- You can remove sites from this list at any time by clicking Remove next to its entry.
- If you want blocked sites to redirect to a specific page (e.g., Google), click the "Redirect to" text box and type an address. If you skip this step, Block Site will simply redirect people who attempt to go to the site to a page that says "Restricted Access".
- Add additional sites to the block list by entering their addresses into the "Block a new hostname" field and clicking Add .
-
Create a master password. Scroll down to the "Master password" text box at the bottom of the page and type a password you'll remember. This password will be required to make changes to the blocked site list.
-
Click Save to save your changes. It's at the bottom of the page. Once your settings are saved, the sites you entered will be blocked to everyone who uses Firefox. When you want to edit your settings, return to the Options area of Block Site , enter the master password, and make your changes.
Advertisement
-
Open the Command Prompt as an administrator. Open the Start menu and search for "cmd". Right-click the Command Prompt and select Run as administrator . [2] X Research source
-
Type nslookup followed by the website URL. Press Enter when you're finished. This will retrieve the website's IP address.
- Take note of the IP address.
-
Open Windows Defender Firewall. You can type this into the Start menu or find it in the settings.
-
Click Advanced settings . This is in the left panel.
- A new window will open.
-
Click New Rule… . This is underneath the Actions header in the right panel.
-
Select Custom and click Next . This is the last option.
-
Select All programs and click Next . This is the top option.
-
Click Add… . This is in the bottom section, under Which remote IP addresses does this rule apply to? .
-
Enter the IP address of the website and click OK . The window will close.
-
Select Block the connection and click Next .
-
Enter a name and click Finish . The website will now be blocked on Firefox and any other browser.
Advertisement
-
Open Firefox's settings. Click ☰ in the top-right corner and select Settings . A new window will open.
- Use this method to disable cookies and other site data in Firefox.
-
Click Privacy & Security . This is in the left panel.
-
Click Manage Exceptions… . You can find this under the Cookies and Site Data header; you may need to scroll down to find it.
-
Type or paste the URL of a website. This goes in the Address of website field.
-
Click Add Exception . This will add the website to the list.
-
Click Save Changes . This is the blue button at the bottom of the window.
Advertisement
-
Open a Terminal window. To do this on your Mac, click the magnifying glass at the top-right corner of the screen to open Spotlight, type terminal into the search bar, and then press ⏎ Return .
- This method will block a specific website from all browsers, not just Firefox.
- You must have your administrator password to use this method.
-
Type sudo nano /etc/hosts and press ⏎ Return . A password prompt will appear.
-
Enter your administrator password and press ⏎ Return . You won't see the characters you type, but that's by design. This opens the file for editing.
-
Use the arrow keys to move to the bottom of the file. You can stop moving downward once the mouse cursor is on its own new line. There should be no other characters on the line you'll be typing on.
-
Type 127.0.0.1 and press the Tab ↹ key.
-
Type the web address of the site you want to block. For example, if you want to block YouTube, type www.youtube.com . Don't include the "https://" or anything after the domain name.
- To block another site, press the Return key to open a new line, type 127.0.0.1 , press the Tab key, and then enter the next address.
-
Press Control + O . This saves the file.
-
Press Control + X . This exits the editor.
-
Flush your Mac's DNS cache. To do this on macOS Sierra and later, type sudo killall -HUP mDNSResponder;sudo killall mDNSResponderHelper;sudo dscacheutil -flushcache at the prompt and press the Return key. [3] X Research source This resets your computer’s DNS cache, allowing the blocking to begin.
- If you're using macOS El Capitan, use sudo killall -HUP mDNSResponder instead.
Advertisement
-
Visit https://addons.mozilla.org/en-US/android/addon/leechblock-ng in Firefox. Leechblock NG is a free Firefox add-on that lets you block websites in the browser. You can even choose to block the site only during certain time periods and set a password so nobody else can edit the block list.
- Leechblock NG has nearly all positive ratings on the Firefox Add-ons site and is updated regularly. Still, make sure to research add-ons before installing them.
- This will only work for Firefox, not other browsers on your Android.
-
Tap + Add to Firefox . A warning message will show you which permissions Leechblock NG needs to work.
-
Review the warning and tap ADD . This installs the add-on.
-
Tap the menu ⋮ . It's the three vertical dots at the top-right corner of Firefox.
-
Tap Add-ons on the menu. A list of installed add-ons will appear.
-
Tap LeechBlock NG and select Options . This opens the settings page for LeechBlock.
- You'll see several tabs called Block Set 1, Block Set 2, etc. You can designate a tab for specific blocking settings. For example, if you want to block certain sites 100% of the time, you could add those to one tab. If you only wanted to block certain sites between midnight and 6 AM, you could add those to a separate tab.
-
Enter a name for your block set. You could call it "Block List" or something similar.
- If you want to create separate block lists, feel free to enter a name that's more reflective of the sites/settings you'll be using on this tab.
-
Enter the site(s) you want to block. Each blocked site should appear on its own line. Don't worry about adding the "https://" at the beginning.
- For example, if you wanted to block X, you could just enter www.x.com or x.com .
- To add another site, press the Enter key on your keyboard and type the next address.
-
Choose when to block the site(s). You can choose times and dates if you'd like.
- If you want to block the site(s) all the time, tap the All Day button. Otherwise, enter your desired times.
- To block sites every day of the week, check the boxes next to all 7 days.
-
Tap Save Options at the bottom of the page. You can return to that tab any time you wish.
- Feel free to create additional tabs for other times and dates now.
-
Tap the General tab. This is where you can set a password so nobody can undo your settings.
-
Select a password option under "Access Control." It's the first drop-down menu on the page. For best results, select Require the user to enter a password here.
-
Enter a password you'll remember. It can be as many or as few letters as you'd like.
-
Scroll down and tap Save Options & Close . Now that your options are saved, anyone who attempts to visit the selected sites in Firefox will be unable to do so. If they attempt to change the app settings, they won't be able to without your password.
Advertisement
-
Scroll down and tap Screen Time . It's in the second group of settings.
-
Tap Turn On Screen Time if you haven’t already. If you don’t see this option, Screen Time is already enabled and you can skip to step 6.
-
Tap Continue . This turns on Screen Time, a tool that allows you to monitor and regulate your iPhone or iPad usage.
-
Tap This is My iPhone . If you’re using your child’s iPhone, you can tap This is my Child’s iPhone instead, giving you other options for regulating your child’s time on this device.
-
Tap Content & Privacy Restrictions . This is towards the bottom of the page.
-
Tap Store, Web, Siri & Game Center Content . It’s near the top of the menu.
-
Tap Web Content . It’s under the WEB CONTENT header.
-
Tap Limit Adult Websites . This is the middle option.
-
Tap Add Website under “NEVER ALLOW.” It’s the second instance of “Add Website” on the menu (at the bottom).
-
Enter the address of the site you want to block and tap Done . This adds the website to the block list and begins blocking it immediately.
- For example, if you wanted to block Google, you would type in www.google.com here.
Advertisement
Community Q&A
Search
-
QuestionIs it possible to put a custom message on the blocked site?Community AnswerNot without a serious amount of effort and, more importantly, considerable risk to your privacy and security. You can have a local file containing a custom layout and message displayed, but the method to achieve this overrides browser security protocols, which is not a good idea. In any case, it won't be possible for the whole network using OpenDNS, but only for single PCs or mobile devices, manipulating host files and browser configurations on each of them. I don't recommend it, as you'd leave your machines wide open to attack.
-
QuestionIs this part of Firefox or another third party program?Community AnswerThis is a third party program. However, reputable Firefox addons are almost always safe to install and use.
-
QuestionHow do I unblock a site on Firefox that was blocked by mistake?Tom SmithCommunity AnswerPress Ctrl+Shift+A to open the add-ons and go to extensions. Find the "Block Site" add-on and open the menu by pressing the "---". Click "Options". This will open the page of options for the add-on. Find the blocked website under "Existing Rules" and click the word "Remove". Scroll down and click "Save". It is now unblocked!
Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit
Advertisement
Video
Tips
Submit a Tip
All tip submissions are carefully reviewed before being published
Name
Please provide your name and last initial
Thanks for submitting a tip for review!
References
About This Article
Article Summary
X
1. Go to https://addons.mozilla.org/en-US/firefox/addon/block-website
.
2. Click + Add to Firefox
.
3. Click Add
.
4. Check the box and click OK, Got It
.
5. Open the menu and select Add-ons
> Extensions
.
6. Click the Block Site menu button and select Options
.
7. Enter a web address and click Add
.
8. Create a password and click Save
.
Did this summary help you?
Thanks to all authors for creating a page that has been read 882,035 times.
Reader Success Stories
- "I'm trying to block my children from getting distracted on YouTube when they are supposed to be using the computer for school. So far, I've installed a browser extension, which worked wonderfully. Next, I will edit the host file so that all the children who use the computer will be blocked. Very valuable information, thank you for sharing!" ..." more
Advertisement