GSC report shows 404 errors on urls containing 'undefined'

Hello!

I've got a long list of urls showing as 404 in GSC.

Almost all of them have 'undefined' in the url. i.e. - https://oursite.com/undefined/en-gb, https://oursite.com/en-ie/product/undefined/en-gb, or https://oursite.com/en-gb/blog/undefined/en-gb

It looks to me like there's something going on with the language/regional variants - but I'm stumped as to what exactly, or how to go head to fix this.

Does anyone have any ideas for me?

Thanks!

Alex

Hi Alex,

Are the undefined links appearing in your sitemap? And if you visit them in your browser, do they throw a 404?

Sam

Hi, thanks for replying. They are not showing on the sitemap, but are giving a 404 when visited.

Hey @alex.troy,

By "GSC", you mean "Google Search Console"?

If the links aren't in your sitemap, they must be appearing somewhere. Otherwise Google wouldn't find them. Can you track down where any of the links appear?

Sam

Hi! They're showing in Google Search Console in the 404 not found links list. The urls do exist on the site but the 'undefined' parameters in them are breaking the links and I can't tell why it's happening.

So:

https://oursite.com/en-ie/product/ is a real page, but the url showing in GSC looks like https://oursite.com/en-ie/product/undefined/en-gb

Hey Alex,

This might be a GSC question rather than a Prismic question.

In GSC, trying clicking on Inspect URL for one of the invalid URLs. Then open the Page indexing tab to see if there's any information about where Google found the link.

I suspect that somewhere on your website there are some invalid internal links getting rendered.

Sam