# Elm SPA caused all our pages to be removed from Google Search

**URL:** <https://discourse.elm-lang.org/t/elm-spa-caused-all-our-pages-to-be-removed-from-google-search/7817>\
**Category:** Learn\
**Created:** [October 12, 2021, 7:00pm UTC](https://discourse.elm-lang.org/t/elm-spa-caused-all-our-pages-to-be-removed-from-google-search/7817 "2021-10-12T19:00:04Z")\
**Posts on this page:** 11\
**Page:** 2

<div class="post-metadata">

**Author:** ![berend](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/berend/32/2250_2.png) [@berend](https://discourse.elm-lang.org/u/berend)\
**Post date:** [October 24, 2021, 8:44pm UTC](https://discourse.elm-lang.org/t/elm-spa-caused-all-our-pages-to-be-removed-from-google-search/7817/21 "2021-10-24T20:44:31Z")

</div>

Thanks @jmpavlick. We had already done these things upfront. Despite all that, it didn’t appear to help.

We have lots of fresh content crawled, but simply JavaScript is not being run.

---

<div class="post-metadata">

**Author:** ![jmpavlick](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/jmpavlick/32/4814_2.png) [@jmpavlick](https://discourse.elm-lang.org/u/jmpavlick)\
**Post date:** [October 24, 2021, 10:12pm UTC](https://discourse.elm-lang.org/t/elm-spa-caused-all-our-pages-to-be-removed-from-google-search/7817/22 "2021-10-24T22:12:51Z")

</div>

@berend ah that’s frustrating!

Just a shot in the dark, do you have anything wild going on during site initialization? Any wild structures coming in to flags, anything like that? How is your call to the Elm application referenced from your `index.html` page?

If I suspected that my JS wasn’t being run, I would set up an API endpoint that I could call with the browser’s user agent and the “source” as a query parameter. Call it once directly from the `script` section that _should_ be loading your Elm app with a “source” of `"fromScript"`, and pass it in as a flag value and call it from `init` with a “source” of `"fromElm"`. Log datestamps, the user agent, and the “source” on the other end of your API endpoint, and you’ll be able to see if Googlebot is:

- not running JS at all, anywhere, ever
- only running JS directly from the `script` tag and not loading the Elm executable
- doing both but somehow still not indexing anything

Again, just a shot in the dark; but might be worth it as a last-ditch effort.

---

<div class="post-metadata">

**Author:** ![Sidney](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/sidney/32/3290_2.png) [@Sidney](https://discourse.elm-lang.org/u/Sidney)\
**Post date:** [October 25, 2021, 1:30am UTC](https://discourse.elm-lang.org/t/elm-spa-caused-all-our-pages-to-be-removed-from-google-search/7817/23 "2021-10-25T01:30:05Z")

</div>

One potential issue I noticed is the HTML tag:

```auto
<html lang="en">

```

It might be possible to update this value in Elm (using ports), but I suspect removing it is your best bet. (`package.elm-lang.org` does not set a `lang`).

Google seems to believe the attribute too, even when the content isn’t English:

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/elm_lang/original/2X/3/3d33034ed5f71ea2406dce29477b77fc5fe1ca62.png)

---

<div class="post-metadata">

**Author:** ![rupert](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/rupert/32/1775_2.png) [@rupert](https://discourse.elm-lang.org/u/rupert)\
**Post date:** [October 25, 2021, 8:03am UTC](https://discourse.elm-lang.org/t/elm-spa-caused-all-our-pages-to-be-removed-from-google-search/7817/24 "2021-10-25T08:03:21Z")

</div>

This thread is gold dust, love it!

---

<div class="post-metadata">

**Author:** ![berend](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/berend/32/2250_2.png) [@berend](https://discourse.elm-lang.org/u/berend)\
**Post date:** [October 30, 2021, 6:48am UTC](https://discourse.elm-lang.org/t/elm-spa-caused-all-our-pages-to-be-removed-from-google-search/7817/25 "2021-10-30T06:48:32Z")

</div>

We have now put the site behind [prerender.io](https://prerender.io/). I’ll report back what that did to the indexing.

---

<div class="post-metadata">

**Author:** ![lucamug](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/lucamug/32/1764_2.png) [@lucamug](https://discourse.elm-lang.org/u/lucamug)\
**Post date:** [October 30, 2021, 7:21am UTC](https://discourse.elm-lang.org/t/elm-spa-caused-all-our-pages-to-be-removed-from-google-search/7817/26 "2021-10-30T07:21:02Z")

</div>

It seems that the site is indexed now. Already the effect of [prerender.io](http://prerender.io)?

---

<div class="post-metadata">

**Author:** ![berend](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/berend/32/2250_2.png) [@berend](https://discourse.elm-lang.org/u/berend)\
**Post date:** [October 30, 2021, 7:22am UTC](https://discourse.elm-lang.org/t/elm-spa-caused-all-our-pages-to-be-removed-from-google-search/7817/27 "2021-10-30T07:22:26Z")

</div>

Nah, these are just remainders of the site that was replaced.

---

<div class="post-metadata">

**Author:** ![berend](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/berend/32/2250_2.png) [@berend](https://discourse.elm-lang.org/u/berend)\
**Post date:** [November 4, 2021, 6:24am UTC](https://discourse.elm-lang.org/t/elm-spa-caused-all-our-pages-to-be-removed-from-google-search/7817/28 "2021-11-04T06:24:37Z")

</div>

And an update: Google likes us again. We’re back in the index, hits are up to almost pre-change levels.

---

<div class="post-metadata">

**Author:** ![hans-helmut](https://avatars.discourse-cdn.com/v4/letter/h/d9b06d/32.png) [@hans-helmut](https://discourse.elm-lang.org/u/hans-helmut)\
**Post date:** [November 11, 2021, 4:40pm UTC](https://discourse.elm-lang.org/t/elm-spa-caused-all-our-pages-to-be-removed-from-google-search/7817/29 "2021-11-11T16:40:37Z")

</div>

Do you have any ideas about the root-cause?

---

<div class="post-metadata">

**Author:** ![berend](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/berend/32/2250_2.png) [@berend](https://discourse.elm-lang.org/u/berend)\
**Post date:** [November 11, 2021, 9:17pm UTC](https://discourse.elm-lang.org/t/elm-spa-caused-all-our-pages-to-be-removed-from-google-search/7817/30 "2021-11-11T21:17:49Z")

</div>

Google didn’t fire up the browser for us, that’s what it seemed to have been, but the root cause? We must have done something wrong, but it was a really simple `index.html`. No idea yet.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/elm_lang/original/1X/50a05e53677a2c3b47776d7abd0f113eb50193a1.png) [@system](https://discourse.elm-lang.org/u/system)\
**Post date:** [November 21, 2021, 9:18pm UTC](https://discourse.elm-lang.org/t/elm-spa-caused-all-our-pages-to-be-removed-from-google-search/7817/31 "2021-11-21T21:18:46Z")

</div>

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.

[Previous page](https://discourse.elm-lang.org/t/elm-spa-caused-all-our-pages-to-be-removed-from-google-search/7817.md?page=1)
