Cómo eliminar un parámetro con JS
// Delete a Parameter by Name
search_params.delete('id');
Anthony Smith
// Delete a Parameter by Name
search_params.delete('id');
// Remove all Parameters
var url = new URL('http://demourl.com/path?topic=main');
// set search property to blank
url.search = '';
var new_url = url.toString();
// output : http://demourl.com/path
console.log(new_url);