useSearchParams not parsing URL params containing escaped ampersands (&) #66989
-
I have a dashboard page using searchParams to filter different data views. I would like to submit the different filter combinations as different pages to Google search console using sitemap.ts. The problem is that google does not accept url's in the sitemap containing an unesescaped ampersand character (&). Thus, url's like the following wont be submittet: The obvious solution to this is to encode the ampersands as |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Does it work to use it as an HTML entity instead? The problem is that your sitemap is XML right? |
Beta Was this translation helpful? Give feedback.
Well, yes that's my stance. I can "prove" it like this:
Say you have:
Then I can do:
And that'll give me back the proper query params. So, anyone who parses your XML, properly, will get the correct query params into their data structure, and be able to make the right calls
And that'd log