Web/API/URLSearchParams/delete

From Get docs

The delete() method of the URLSearchParams interface deletes the given search parameter and all its associated values, from the list of all search parameters.

Note: This feature is available in Web Workers.

Syntax

URLSearchParams.delete(name)

Parameters

name
The name of the parameter to be deleted.

Return value

Void

Examples

let url = new URL('https://example.com?foo=1&bar=2&foo=3');
let params = new URLSearchParams(url.search);

// Delete the foo parameter.
params.delete('foo'); //Query string is now: 'bar=2'

Specifications

Specification Status Comment
URLThe definition of 'delete()' in that specification. Living Standard Initial definition.

Browser compatibility

Update compatibility data on GitHub

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
delete Chrome

Full support 49

Edge

Full support 17

Firefox

Full support 29

IE

No support No

Opera

Full support 36

Safari Partial support Partial

Notes'

Partial support Partial

Notes'

Notes' Removing a non-existent query parameter doesn't remove ? from the URL. See bug 193022.

WebView Android

Full support 49

Chrome Android

Full support 49

Firefox Android

Full support 29

Opera Android

Full support 36

Safari iOS Partial support Partial

Notes'

Partial support Partial

Notes'

Notes' Removing a non-existent query parameter doesn't remove ? from the URL. See bug 193022.

Samsung Internet Android

Full support 5.0

Legend

Full support  
Full support
Partial support  
Partial support
No support  
No support
See implementation notes.'
See implementation notes.