Remove Chrome's Custom Search Engines

Flush Custom Search

At the time of writing, this “feature” cannot be disabled without a dedicated chrome extension1. And of course removing each item one by one is unreasonable.

Hence the following JS snippet iterate over each item in the list and clicks the delete button.

Usage#

  1. Go to the search engine settings chrome://settings/searchEngines.
  2. Open the Developer Tools by clicking F12 or CTRL+SHIFT+I.
  3. Copy the script below and paste it in the Javascript console tab.
  4. Fire Away.

Search Engine Settings Page

Snippet#

A slight delay has been added between clicks since after each action the browser takes a moment to render the view. feel free to adjust the sleep at line 16 as you see fit.

const otherEngines = 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

let n = otherEngines.querySelector('iron-list').childElementCount - 1;
let rmbtn = otherEngines.querySelector('#frb0')
                        .shadowRoot.querySelector('#delete')

const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms));

while(n--) {
	rmbtn.click();
	await sleep(2000);
}
Remove Chrome's Custom Search Engines