I have Safari synchonised between my Mac and iPad.
Fow weeks an iPad search for "far cry 6 pelicans" (I needed assistance finding pelicans in a videogame) has been listed in the cloud tabs, despite being closed weeks ago.
Wiping the Safari data on the iPad and resetting the cloud syncing didn't seem to affect anything. So instead I tried removing the tab directly on the Mac.
As with most macOS data, the Safari tabs live in an sqlite database somewhere under the users home directory.
Library/Safari/CloudTabs.db
has several tables, including cloud_tabs
with the following schema
device_uuid TEXT,
position BLOB,
title TEXT,
url TEXT,
is_showing_reader BOOLEAN,
is_pinned BOOLEAN,
reader_scroll_position_page_index INTEGER,
scene_id TEXT
So it should be pretty easy to close Safari and just delete the phantom tab in the database.
% sqlite ~/Library/Safari/CloudTabs.db
SQLite version 3.37.0 2021-12-09 01:34:53
Enter ".help" for usage hints.
sqlite> select url from cloud_tabs;
https://duckduckgo.com/?q=far+cry+6+pelicans&t=ipad&ia=web
https://www.some-innocuous-site.com/
sqlite> delete from cloud_tabs where url like "%pelicans%";
sqlite> .exit
The location is different in macOS 13