Delete Browsing History on Safari: Quick Steps & Tips
Delete browsing history on Safari by opening the History menu, choosing "Clear History," and selecting the desired time range. This removes visited URLs, cached pages, and stored form data.
Background
Safari, Apple’s default browser, tracks every site you visit to provide quick navigation, auto‑complete suggestions, and personalized content. The history list appears in the sidebar and is also used by the search bar to offer predictive results. While convenient, history can expose sensitive browsing patterns to anyone who gains access to your device, so clearing it is a common privacy practice. Users often ask how to delete history on Safari, especially on newer macOS or iOS releases where menu labels have shifted.
How Safari Stores History
Safari records history in a SQLite database called History.db located in ~/Library/Safari. Each entry includes the URL, title, visit count, and timestamps. The browser also creates a cache folder that stores downloaded resources, and a cookies folder that holds session data. When you clear history, Safari deletes rows from the database and removes associated cache files, but it does not automatically purge all cookies unless you explicitly choose that option. Understanding this structure helps explain why some sites may still remember you after a clear.
Step‑by‑Step: macOS
On a Mac, follow these steps to erase your Safari history:
- Open Safari and click History in the menu bar.
- Select “Clear History…” from the dropdown.
- Choose a time range: the last hour, today, today and yesterday, or all history.
- Click the Clear History button.
- Optionally, open Safari Preferences > Privacy, then click “Manage Website Data…” and remove any lingering cookies or local storage.
After clearing, Safari will immediately remove the selected entries from the sidebar. If you selected “all history,” the History.db file will be truncated, and the cache folder will be emptied, leaving only fresh browsing data.
Step‑by‑Step: iOS / iPadOS
On an iPhone or iPad, the interface is slightly different but the core process is the same:
- Open the Settings app and scroll to Safari.
- Tap “Clear History and Website Data.”
- Confirm the action by selecting “Clear History and Data.”
- Safari will erase the history list, remove cookies, and clear cached files.
- For finer control, go to Settings > Safari > Advanced > Website Data and delete specific sites.
These steps ensure that even third‑party scripts that store data in localStorage are purged, providing a clean slate for future browsing.
Common Problems & Fixes
Some users report that Safari still shows recently visited sites after a clear. This usually happens when:
- They have “Show Recently Visited” enabled in the sidebar, which pulls from the cache rather than the database.
- They use a shared iCloud account that syncs history across devices; clearing on one device may not remove entries from the cloud.
- Third‑party extensions store their own history logs, which Safari does not automatically delete.
To resolve these issues, disable sidebar history, sign out of iCloud temporarily, or review and remove extensions that maintain their own logs.
Privacy Settings & Alternatives
Beyond manual clearing, Safari offers several privacy‑enhancing features:
- Private Browsing mode, which never records history or cookies.
- “Prevent Cross‑Site Tracking” in Preferences > Privacy, which limits third‑party tracking cookies.
- “Block All Cookies” for maximum isolation, though it may break some sites.
- “Erase All Website Data” button in Safari Preferences > Privacy for a one‑click purge.
These options provide a balance between convenience and privacy, allowing users to decide how aggressively they want Safari to retain or delete data.
Safari History File Structure
The History.db file is a lightweight SQLite database. Each row in the “history_items” table contains a unique ID, URL, title, and visit count. The “history_visits” table links visits to items with timestamps. When you clear history, Safari performs a SQL DELETE command that removes all rows within the chosen time window. The cache folder, located in ~/Library/Caches/com.apple.Safari, stores compressed HTML, images, and scripts. Clearing history triggers a cleanup routine that deletes files older than the selected range, but it leaves newer cache entries untouched unless “Clear History” is chosen.
Using Terminal to Clear History
Advanced users can remove history via the command line, which is handy for scripts or when the GUI fails:
- Open Terminal.
- Run:
sqlite3 ~/Library/Safari/History.db "DELETE FROM history_items; DELETE FROM history_visits; VACUUM;" - Then clear the cache with:
rm -rf ~/Library/Caches/com.apple.Safari/* - Restart Safari to apply changes.
These commands force a complete wipe of the database and cache. Use them with caution, as they cannot be undone without a backup.
Misconceptions About Clearing History
Many believe that deleting history automatically logs them out of every site. In reality, Safari only removes the stored session cookies unless you explicitly clear website data. Passwords saved in iCloud Keychain, bookmarks, and reading lists remain untouched. Additionally, clearing history does not affect the browsing data stored on the server side; websites can still retain logs of your visits.
Additional Tips for Maintaining Privacy
Consider the following practices to keep your browsing footprint minimal:
- Use Private Browsing for sensitive searches.
- Regularly review and delete website data in Preferences > Privacy.
- Enable “Ask websites not to track me” in Safari’s privacy settings.
- Keep Safari and macOS updated to benefit from the latest privacy patches.
- Use a dedicated password manager so you don’t need to rely on Safari’s autofill.
Combining these habits with periodic history clears gives you a robust privacy strategy.
Frequently Asked Questions
How does Safari handle history on a shared Mac account?
Each user profile has its own history database. Clearing history in one account does not affect another. However, if iCloud syncing is enabled, history may be shared across devices, so you must clear it on each device or disable sync.
Can I restore deleted history?
Unless you have a Time Machine backup or a third‑party backup of the History.db file, Safari does not provide a built‑in restore. Once the database rows are deleted, they are permanently lost.
Will clearing history affect my bookmarks?
No. Bookmarks are stored in a separate file called Bookmarks.plist and are not touched by the history clear operation.
How often should I clear Safari history?
The frequency depends on your privacy needs. For most users, clearing weekly or monthly is sufficient. If you share a device, consider clearing after each session.
Does Safari automatically delete history after a certain period?
Safari does not have an automatic expiration policy for history. You must manually clear it or use a third‑party tool to automate the process.