var url = new URL(location.href); url.searchParams.delete('LG'); url.searchParams.set('LG', 'YES'); location.href = url.href;