Skip to content

Instantly share code, notes, and snippets.

@JJK96
Created July 31, 2023 06:49
Show Gist options
  • Save JJK96/63160cf49dfd241787ea9ed07e2d730f to your computer and use it in GitHub Desktop.
Save JJK96/63160cf49dfd241787ea9ed07e2d730f to your computer and use it in GitHub Desktop.
Fully delete URL from firefox
# run in ~/Library/Application Support/Firefox/Profiles/<profile>
import sqlite3
url = "%<url>%"
con = sqlite3.connect("places.sqlite")
cur = con.cursor()
cur.execute("delete from moz_places where url LIKE :url;", (url,))
cur.execute("delete from moz_origins where host like :url;", (url,))
con.commit()
con.close()
con = sqlite3.connect("favicons.sqlite")
cur = con.cursor()
cur.execute("delete from moz_icons where icon_url like :url;", (url,))
cur.execute("delete from moz_pages_w_icons where page_url like :url;", (url,))
con.commit()
con.close()
con = sqlite3.connect("weave/bookmarks.sqlite")
cur = con.cursor()
cur.execute("delete from urls where url like :url;", (url,))
con.commit()
con.close()
con = sqlite3.connect("webappsstore.sqlite")
cur = con.cursor()
cur.execute("delete from webappsstore2 where value like :url;", (url,))
con.commit()
con.close()
@JJK96
Copy link
Author

JJK96 commented Jul 31, 2023

I had an old URL that was still shown in my suggestions, even though I told firefox to forget about the site. After running this script it was finally gone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment