16

This question asks how to delete all Firefox cookies and cache, but I need to delete cookies from a specific site. How do I do it?

Braiam
  • 67,791
  • 32
  • 179
  • 269
mattiav27
  • 875

7 Answers7

18

Go to Preferences -> Privacy & Security -> Cookies and Site Data then click on the Manage Data button then search for the site. Click on the site(s) to select and click on Remove Selected, then Save Changes.

That's all you need to do.

digiwizkid
  • 2,535
12

You can use sqlite3 to delete cookies from terminal (Install if necessary: sudo apt install sqlite3)

sqlite3 ~/.mozilla/firefox/*.default/cookies.sqlite \
'delete from moz_cookies where baseDomain="example.com";'

or

sqlite3 ~/.mozilla/firefox/*.default/cookies.sqlite \
'delete from moz_cookies where baseDomain LIKE "%google.%";'

To delete history for a specific site:

sqlite3 ~/.mozilla/firefox/*.default/places.sqlite \
'
delete from moz_historyvisits where place_id in (select h.place_id from moz_historyvisits h join moz_places p on h.place_id = p.id where p.url like "%example.com/%");
delete from moz_places where url like "%example.com/%";
'

There are some more interesting tables and you might need to delete from e.g. moz_origins, moz_bookmarks or moz_bookmarks_deleted to remove more trails from a domain.


Note: Firefox must be closed, or you will see an error message:

Error: database is locked
pLumo
  • 26,947
  • 1
    Do you know of a similar command to delete history for a given domain? I went to remove history for a search engine after years of use and opened the GUI and pressed delete and it took 3 hours while the GUI was hung to delete all the history. – Kristopher Ives Sep 04 '19 at 09:34
  • 2
    It's saved in places.sqlite, but this is a bit more complex and you need to join two tables. I added how to do it. – pLumo Sep 04 '19 at 11:05
  • 1
    Though it's probably fine in practice, it might be worth mentioning that this would also delete history from sites with URLs like https://foo.com/example.com/ and https://foo.com/bar?baz=example.com/ – JoL Sep 05 '19 at 01:13
4

See "manage data" in "options" and "privacy and security". It will show a list of sites with cookies; you can delete a single one from the list.

enter image description here

Rinzwind
  • 299,756
  • 1
    This is the right answer - but would be humblesome, by backtracking data-floods to delete one single certain cookie manually. Ghostery as add-on is taking over this for you. – dschinn1001 Sep 04 '19 at 22:08
4

There's an even easier way, when you click the padlock on address bar, there's a "Clear cookies and site data" button:

enter image description here

enter image description here

enter image description here

cagri
  • 186
2

Press Ctrl+Shift+Delete you will get the Clear browsing data select cookies and other site data click on Clear data.

jasbir
  • 21
2

One-click solution

Here's a quick and handy method I use often:

Save the following JavaScript code as a bookmarklet, visit the site you want to clear all cookies of, and simply click on it:

javascript:(function(){C=document.cookie.split(&quot;; &quot;);for(d=&quot;.&quot;+location.host;d;d=(&quot;&quot;+d).substr(1).match(/\..*$/))for(sl=0;sl<2;++sl)for(p=&quot;/&quot;+location.pathname;p;p=p.substring(0,p.lastIndexOf('/')))for(i in C)if(c=C[i]){document.cookie=c+&quot;; domain=&quot;+d.slice(sl)+&quot;; path=&quot;+p.slice(1)+&quot;/&quot;+&quot;; expires=&quot;+new Date((new Date).getTime()-1e11).toGMTString()}})()

Click here to make the process easier! | JSFiddle


Bookmarklet source: https://www.squarefree.com/bookmarklets/zap.html

undo
  • 121
2

To save energy and time, you could install an add-on for this. Then you dont need to clear the cache of cookies manually any more. In FF browser go to menu in right corner above. Select "add-ons" and type as search word there above "cookie blocker" - so you have the free choice for data-protection of your privacy. There you can install for example "Ghostery" as add-on, then adjust it to your needs.

dschinn1001
  • 3,829