63

Google Chrome saves lots of Other Search Engines from websites I visit, under Settings > Search; Manage search engines. I believe this is called ‘OpenSearch’.

Clicking the remove icon ❌ on each one would be very cumbersome.

Is there a way to delete all of them, without having to do it manually?


NB: This extension supposedly prevents Chrome from adding custom search engines.

P A N
  • 1,417
  • 4
  • 23
  • 42
  • Bloody Chrome needs to allow users select multiple entries in Settings, not just for search engines but other things like saved passwords. Everything in Settings allows only single selection, and we are supposed to repeat the action multiple times... Are the developers stupid or are they enjoying torturing the users? – Damn Vegetables Aug 26 '19 at 19:08
  • The Chrome UX for managing other search engines is not keyboard friendly. Consequently, it's a highly unproductive UX if one wishes to delete a large collection of entries. Happily, the code below suffices if one wishes to remove all entries. – CalvinDale Dec 11 '19 at 15:36

1 Answers1

136

Changed to work with the new inactive shortcuts.

Go to chrome://settings/searchEngines, hit F12 and paste this into the Console tab:

for (let el of document.querySelector("body > settings-ui")
    .shadowRoot.querySelector("#main")
    .shadowRoot.querySelector("settings-basic-page")
    .shadowRoot.querySelector("#basicPage > settings-section.expanded > settings-search-page")
    .shadowRoot.querySelector("#pages > settings-subpage > settings-search-engines-page")
    .shadowRoot.querySelector("settings-search-engines-list[expand-list-text='Additional inactive sites']")
    .shadowRoot.querySelectorAll(":scope settings-search-engine-entry"))
{
    el.shadowRoot.querySelector("#delete").click();
}

NOTE: If you have more than a few custom search engines, you might need to run this more than once (press the up arrow in the console, and Enter again.)

You can also access the Javascript console via Option + Command + J on OSX.

Thanks to Mahmoud K. in the comments for providing a version of this, which I automated.

Ramhound
  • 41,734
  • 35
  • 103
  • 130
Rod Boev
  • 1,505
  • 1
  • 10
  • 11
  • 2
    What does F12 do? I have MacOS and it does nothing. Is there a menu item to achieve the same? – Petruza Mar 14 '17 at 15:08
  • 1
    Right click and Inspect does the same thing – Rod Boev Mar 16 '17 at 03:35
  • Yes, I realized I'd just run that on the console. For some reason it didn't work at that time, but did now. Thanks. – Petruza Mar 17 '17 at 13:50
  • 1
    You have to hover your mouse over the list to make this work, else the querySelectorAll returns an empty array. In my case, the deletion took about 8 minutes(!), and you have to hover your mouse over that list the whole time, else there are no delete buttons to use. Oh, and I love you for that snippet. Saved me a lot of nerves. ;) – xpac May 04 '17 at 10:25
  • 1
    Chrome 59 introduced a new material-design UI, this solution doesn't work anymore. – rafi Jun 07 '17 at 15:58
  • 12
    The `querySelector` approach does not seem to work anymore with the new material-UI. I figured out the following solution: `settings.SearchEnginesBrowserProxyImpl.prototype.getSearchEnginesList().then(function (val) { val.others.forEach(function (engine) { settings.SearchEnginesBrowserProxyImpl.prototype.removeSearchEngine(engine.modelIndex); }); });` – alcohol Jun 15 '17 at 13:31
  • 2
    This worked for me today on 7/25/2017. I did have to run it a few times. – weisjohn Jul 25 '17 at 17:29
  • 2
    The Material Design code gave me errors as pasted. I had to arrow my cursor around in the code and find strange hidden characters and remove them. Maybe it's a safety mechanism. Maybe it was a bug. – Bruno Bronosky Sep 26 '17 at 21:01
  • 1
    These hidden characters are just the line breaks when copying directly here from the comment. Luckily, the chrome console highlights these characters and you can easily remove them. – swissspidy Oct 17 '17 at 09:55
  • Note that this doesn't seem to remove search engines added by extensions. – Roger Lipscombe Nov 01 '17 at 14:52
  • 1
    I expanded this answer a bit to let me keep some search engines by adding a word to their display name. Really needs a while loop to keep checking all the engines are gone since it doesn't seem to get them all in one pass. https://gist.github.com/dmwyatt/0917eb1232b324903843f57f27656ccd – Dustin Wyatt Nov 25 '17 at 04:31
  • I fixed the strange characters from the line breaks. Not sure how they got there. – Rod Boev Jan 30 '18 at 17:55
  • 2
    On a related note, if you want to PREVENT these from being added automagically to your browser, you can install the extension linked here: https://superuser.com/questions/886982/how-to-prevent-additions-to-chrome-search-engines-not-just-default – Marcello Grechi Lins Apr 04 '18 at 20:42
  • 1
    "Uncaught ReferenceError: settings is not defined" – bg17aw Oct 03 '18 at 19:50
  • 2
    @bg17aw You must not be at chrome://settings/searchEngines. On the latest stable 69.0.3497.100 settings is defined on that page – Rod Boev Oct 07 '18 at 00:09
  • 12
    The following JS snippet clicks on the "Remove from list" of first entry in the other search engine list, you can put it in a loop and call a bunch of times: `document.querySelector("body > settings-ui").shadowRoot.querySelector("#main").shadowRoot.querySelector("settings-basic-page").shadowRoot.querySelector("#basicPage > settings-section.expanded > settings-search-page").shadowRoot.querySelector("#pages > settings-subpage > settings-search-engines-page").shadowRoot.querySelector("#otherEngines").shadowRoot.querySelector("#frb0").shadowRoot.querySelector("#delete").click()` – Mahmoud Apr 28 '20 at 05:56
  • 1
    it works for me on 17 may 2020. Thanks for your answer! – Vincenzo Lo Palo May 17 '20 at 01:46
  • 4
    VM94:1 Uncaught ReferenceError: settings is not defined at :1:1 – Predrag Stojadinović Aug 21 '20 at 07:52
  • unfortunaltely i could not fix the code from above, but i found another tricky method to delete the entries faster: 1) open dev tools and dock the panel to the bottom side. 2) enlarge the dev tools to make the actual settings page very small, then scroll the settings page to the bottom 3) now click on the upper of the 3 dots to open the submenu-dropdown of last element 4) you pointer will be right on the delete button. 5) now just click as fast as you can – Marat Feb 24 '21 at 18:06
  • 1
    Another trick for faster manual removal is to use the keyboard navigation: delete the first item manually with the mouse, then you can repeat `enter` - `up-arrow` - `enter` until they're all gone. – mrucci Apr 13 '21 at 19:25
  • This is only deleting them one at a time not all of them together! – Anonymous Aug 18 '21 at 09:08
  • It deletes them a few at a time, as mentioned in the response: "You might in fact need to run this multiple times to completely clear out all the search engines." I'll try to call this out more with an edit. – Rod Boev Aug 18 '21 at 20:04
  • still working 3/2022. ty! – Zeb Mar 08 '22 at 02:41