# Script in /head broke site

**URL:** https://meta.discourse.org/t/script-in-head-broke-site/36161
**Category:** Support
**Created:** [Novembre 30, 2015, 5:03 UTC](https://meta.discourse.org/t/script-in-head-broke-site/36161 "2015-11-30T17:03:36Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![Grex315](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/grex315/32/115868_2.png) [@Grex315](https://meta.discourse.org/u/Grex315)
#### Post date: [Novembre 30, 2015, 5:03 UTC](https://meta.discourse.org/t/script-in-head-broke-site/36161/1 "2015-11-30T17:03:36Z")

</div>

I was copying over a script i created on my test site and ended up missing a close tag. Bad copy/paste job. This broke my site and i can no longer get to the customization screen to change it. Is there a way I can get to this from another way.

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [Novembre 30, 2015, 5:06 UTC](https://meta.discourse.org/t/script-in-head-broke-site/36161/2 "2015-11-30T17:06:27Z")

</div>

> [@Grex315](#):
>
> Is there a way I can get to this from another way.

Is it still broken if you access directly any of the `/admin` URLs?

---

<div class="post-metadata">

### Author: ![Grex315](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/grex315/32/115868_2.png) [@Grex315](https://meta.discourse.org/u/Grex315)
#### Post date: [Novembre 30, 2015, 5:13 UTC](https://meta.discourse.org/t/script-in-head-broke-site/36161/3 "2015-11-30T17:13:29Z")

</div>

yes. Its a script that is loading in the header.

---

<div class="post-metadata">

### Author: ![Grex315](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/grex315/32/115868_2.png) [@Grex315](https://meta.discourse.org/u/Grex315)
#### Post date: [Novembre 30, 2015, 6:10 UTC](https://meta.discourse.org/t/script-in-head-broke-site/36161/4 "2015-11-30T18:10:53Z")

</div>

Does it save this info into a file in the container or is all kept in the DB?

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [Novembre 30, 2015, 6:11 UTC](https://meta.discourse.org/t/script-in-head-broke-site/36161/5 "2015-11-30T18:11:39Z")

</div>

It’s in the DB. You should be able to recover by disabling the customization via the rails console.

---

<div class="post-metadata">

### Author: ![DeanMarkTaylor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/deanmarktaylor/32/102462_2.png) [@DeanMarkTaylor](https://meta.discourse.org/u/DeanMarkTaylor)
#### Post date: [Novembre 30, 2015, 6:11 UTC](https://meta.discourse.org/t/script-in-head-broke-site/36161/6 "2015-11-30T18:11:56Z")

</div>

Check this post out it should so what you need…

> [@Local customizations broke site on upgrade, how to disable?](https://meta.discourse.org/t/local-customizations-broke-site-on-upgrade-how-to-disable/28724/17):
>
> ```bash
> cd /var/discourse
> ./launcher enter app 
> rails c
> > SiteCustomization.update_all(enabled: false)
> exit
> exit
> 
> ```
> 
> After this restart the container
> 
> ```plaintext
> ./launcher restart app
> 
> ```

---

<div class="post-metadata">

### Author: ![Grex315](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/grex315/32/115868_2.png) [@Grex315](https://meta.discourse.org/u/Grex315)
#### Post date: [Novembre 30, 2015, 6:21 UTC](https://meta.discourse.org/t/script-in-head-broke-site/36161/7 "2015-11-30T18:21:05Z")

</div>

thank you. That worked.

---

<div class="post-metadata">

### Author: ![DeanMarkTaylor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/deanmarktaylor/32/102462_2.png) [@DeanMarkTaylor](https://meta.discourse.org/u/DeanMarkTaylor)
#### Post date: [Novembre 30, 2015, 6:24 UTC](https://meta.discourse.org/t/script-in-head-broke-site/36161/8 "2015-11-30T18:24:30Z")

</div>

For future reference for anybody in the crazy situation where they are an admin but don’t have access to the Discourse instance’s shell…

…but are an admin and still authenticated - you can use the API:

API Key can be found here (`THE_API_KEY_OBTAINED_BEFORE_GOES_HERE`):  
[http://www.example.com/admin/api.json](http://www.example.com/admin/api.json)

List of customisations to find ID here (`THE_CUSTOMIZATION_ID_HERE`):  
[http://www.example.com/admin/customize/css\_html.json](http://www.example.com/admin/customize/css_html.json)

Then replacing the domain, customisation ID and API key:

```bash
curl -vs 'http://www.example.com/admin/site_customizations/THE_CUSTOMIZATION_ID_HERE?api_key=THE_API_KEY_OBTAINED_BEFORE_GOES_HERE&api_username=system' -X PUT -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' --data $'site_customization%5Benabled%5D=false' 2>&1

```

---

<div class="post-metadata">

### Author: ![Grex315](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/grex315/32/115868_2.png) [@Grex315](https://meta.discourse.org/u/Grex315)
#### Post date: [Novembre 30, 2015, 6:29 UTC](https://meta.discourse.org/t/script-in-head-broke-site/36161/9 "2015-11-30T18:29:04Z")

</div>

Nice. This thread and referenced thread bookmarked.

Just found my Oh S#!&! button.

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [Novembre 30, 2015, 6:56 UTC](https://meta.discourse.org/t/script-in-head-broke-site/36161/10 "2015-11-30T18:56:23Z")

</div>

This topic was automatically closed after 30 minutes. New replies are no longer allowed.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [Novembre 30, 2015, 8:24 UTC](https://meta.discourse.org/t/script-in-head-broke-site/36161/11 "2015-11-30T20:24:34Z")

</div>

Note, should not break on latest cause we now normalise html
