Is there any method to get the URL without query string? September 27, 2022 by Tarik Try this: let path = window.location.href.split('?')[0] console.log({path})