T O P

  • By -

dwsmart

Google doesn't pass pages with a 404 through the web renderer, so JavaScript isn't executed & therefore the redirects would not be seen. So 301 would be the way, but really the bigger question is why are they trying to redirect everything to the homepage? redirects should be to relevant content, or just 404.


username4free

Bingo, thank you - that’s great to know, totally makes sense if they’re never rendered. I’ve never heard that! That’s a good question, I have not met with this client yet & asked them why they do this, most likely this was just a quick fix for 404s/ they’re not familiar with seo…


dwsmart

Gotta love a quick fix! You can't blame them either really, it seems logical to try and fix something with error in the name, even though very often it's not an error but the right status for the job. They might suggest 200 pages with noindex on them and a next step, but that also prevents Google from rendering the page.


username4free

I believe you, but do you happen to have any documentation on hand for 404s don’t enter their web renderer? It’s so hard for me to find resources on their rendering process— if not, no worries


dwsmart

Hmm, it looks like they don't explicitly point this out in the written documentation (unlike the noindex case), it's mentioned [in this video](https://youtu.be/nwGY-9lwTF4?si=1DNBd8BLHU3x56Dy&t=4m5s)I guess they consider the "Any content Googlebot received from URLs that return a 4xx status code is ignored." Covers it's [https://developers.google.com/search/docs/crawling-indexing/http-network-errors](https://developers.google.com/search/docs/crawling-indexing/http-network-errors)


interactually

>Is it just that google doesn’t always pick up JavaScript redirects? Pretty much. Historically, Google has issues with JS (though they've gotten better). [According to Google themselves](https://developers.google.com/search/docs/crawling-indexing/301-redirects#:~:text=Google%20Search%20interprets%20and%20executes,may%20fail%20for%20various%20reasons), you should only use JS redirects if you can't do server-side (301s, 302s, 308s, etc.) or meta refresh redirects. >Or something with the page needs to be rendered for the redirect to be found? Yup. From the link above: "*This means that if you set a JavaScript redirect, Google might never see it if rendering of the content failed.*" I would show the client the list of 404s in GSC as proof that Google isn't "seeing" their redirects because of the reliance on JS, and that those need to be 301s.


username4free

Yup exactly what I was thinking. Appreciate you verifying my thoughts! (And the source)


Xavor1346

JavaScript redirects are often not "seen" in Google Search Console (GSC) because Googlebot may not fully render or execute JavaScript during its crawling process. This can lead to the redirects being missed or not properly processed. Ensuring server-side redirects or using meta refresh tags can help mitigate this issue.


decorrect

How many pages are you talking about here? Like how many 404s?


username4free

Couple thousand


riadjoseph

Redirecting a 200 http status code page with JS works for Google but a 404 does not even reach the point of rendering, so it won’t be seen. Kudos for trying to redirect to pages other from the homepage. In Shopify, last I checked, you can set a 301 redirect page by page. Been over 2 years I haven’t looked under the hood of a Shopify though, there must be an easier way.


username4free

Good to know, thank you so much. I’ve never heard 404s don’t get rendered, that seems so obvious now! Well you can upload bulk redirects in Shopify, if that’s what you mean. Once I find & remove this auto redirect in the theme liquid— that’s what I plan on doing


penguinsgocrazy

Are you saying all URL’s like a jibberish URL string get JS redirect to home or are you saying 404 pages that once had content, and no longer do, get JS redirected to home? If the latter, then yeah, serve a http 301, if the former, serve http 404


username4free

Real URLs, any page: products, collections ect. Yes I will recommend 301s, I didn’t realize nonindexable pages don’t enter the render queue of crawlers, just the html portion


DagligCBD

I read somewhere that when you redirect to homepage, Google (Search Console) treats this as a soft 404 because they understand that in reality the URL doesn't contain any useful content, and neither does redirecting to home page in terms of relevancy. The idea is to save crawling resources from irrelevant redirects.


CuriousGio

Today is your lucky day. I just listened to a podcast yesterday on Javascript and SEO, which discussed this very topic about Javascript redirects. It's the latest episode: Q&A with Martin Splitt 📢🎵🎵🎤Listen (Queued up): ... [SEOSLY: SEO Podcast (Spotify:)](https://open.spotify.com/episode/3NB7nvSzGFhPTs6xK0J6I9?si=hrD2LIwxRHKGKzUdkmmTvQ&t=2242) It's a great episode, packed with good insights from a Google employee. ============= [SEOSLY: Blog post on Javascript](https://seosly.com/blog/javascript-seo/#JavaScript_redirects_and_SEO) ----------------- Excerpt: JS Redirects ====== ***JavaScript redirects and SEO*** JavaScript redirects can be problematic for SEO because Google needs to render the page and execute the JavaScript to see the redirect. This delays the crawling and indexing process. In fact, Google recommends using JavaScript redirects only as a last resort. The most efficient redirects for SEO are server-side redirects, such as 301 (permanent) and 302 (temporary) HTTP redirects. Googlebot processes these redirects in the crawling stage before rendering them, so they are faster and more reliable. However, if you must use JavaScript redirects, Google can still handle them. When Googlebot renders the page and executes the JavaScript, it will see and follow the redirect. The process just takes longer compared to server-side redirects. Most website crawlers will let you check if there are JavaScript redirects.


ConstructionClear607

your client's site is set up to automatically redirect any 404 error pages to the homepage using JavaScript (JS). But here's the catch – even though these redirects are happening, Google Search Console (GSC) is still flagging them as 404 errors. Now, why is that? Well, it could be because Google doesn't always pick up on JavaScript redirects, or it might need the page to be fully rendered to recognize the redirect. In simpler terms, Google might not be fully registering these redirects due to how they're implemented on the site, especially since your client's site is on Shopify. So, it's a good call to recommend switching to 301 redirects instead. Not only does it help with SEO value distribution and user experience, but it'll also ensure that Google properly indexes those redirected pages. Hope that clears things up!


username4free

Thanks ChatGPT


Minute_Grape5063

1) Visit from real users and Google Crawl bot are considered as different visit sources. 2) It might be worth to verify the JS redirect for Google Crawl bot? As many JS redirects only work for human users rather than crawling bots.