HTML/CSS customization not saving on iPad; can't access Discourse on desktop


As explained below, I inserted customized HTML code in the CSS customization setting and was unable to access the Discourse content on my desktop. All I see is a yellow bar which I have added in. However, I was able to see the Discourse content on my iPad and iPhone; the only problem is that I can’t make any changes to the HTML/CSS setting because it simply wouldn’t save when I access it through my mobile devices. Please help!

I just did something really stupid: I added some CSS code that seems to have completely covered up the content of my Discourse. Is there a way to get my normal Discourse page back without completely destroying my Discourse instance and setting it up again?

This link is supposed to show my Discourse but now it only shows my customized CSS:

Thank you very much!

This is the code that I inserted in </head>:

<meta charset="utf-8"><title>leasehackr forum</title><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="generator" content="Webflow"><link rel="stylesheet" type="text/css" href=""><script src=""></script><script>WebFont.load({

google: {
    families: ["Pacifico:regular","Raleway:300,regular,500,600,700,800"]
});</script><script type="text/javascript" src=""></script><link rel="shortcut icon" type="image/x-icon" href=""><link rel="apple-touch-icon" href="">

This is what I put in the <header> section:

<div class="w-nav navbar" data-collapse="medium" data-animation="default" data-duration="400" data-contain="1"><a class="w-nav-brand w-clearfix brand-linkbox" href="#"><div class="w-hidden-tiny logo-txt">leasehackr</div><img class="logo-img" src=""></a><nav class="w-nav-menu navmenu-div" role="navigation"><a class="w-nav-link navitem-linkbox" href="" target="_blank">Latest Deals</a><a class="w-nav-link navitem-linkbox" href="#">LeaseCompare</a><a class="w-nav-link navitem-linkbox" href="#">Leasing 101</a><a class="w-nav-link navitem-linkbox" href="#">Lease Hacks</a><a class="w-nav-link navitem-linkbox" href="#">About Us</a></nav><div class="w-nav-button navicon-button"><div class="w-icon-nav-menu"></div></div></div>

And this in </body>:

<script type="text/javascript" src="//"></script>
<script type="text/javascript" src=""></script>

I didn’t expect that the code will override my page. :frowning:

Customization not saving
(Régis Hanol) #2

If you’re still logged in as an administrator, then you can go to and you will be able to fix your CSS :wink:


@zogstrip Thanks for the response. I couldn’t access the admin page anymore because the yellow bar is all I see.


I can no longer log into my Discourse instance. Would rebuilding the container fix the problem?

(Kane York) #5

No, because customizations are stored in the database and they’ll still be there after you rebuild.

However, I have to question some of your insertions. Why are you re-adding jQuery and modernizr? These are both already included in Discourse.


@riking Thanks for the response. It was a complete mistake. Do I have other recourse other than completely wiping my Discourse and reinstalling it?

(Kane York) #7

Yes, you can do this:


@riking I tried your code but it didn’t seem to disable the customization as my site is still broken:

root@forum:~# cd /var/discourse
root@forum:/var/discourse# ./launcher enter app
root@forum:/# rails c
[1] pry(main)> SiteCustomization.update_all(enabled: false)
=> 1
[2] pry(main)>

Did I enter something wrong?


I also tried this, but still no luck :/:

root@forum:~# cd /var/discourse/
root@forum:/var/discourse# ./launcher enter app
root@forum:/# update site_texts SET value = '' where text_type = 'head';
bash: update: command not found
root@forum:/# sudo -u postgres psql postgres
psql (9.3.6)
Type "help" for help.

postgres=# \c discourse
You are now connected to database "discourse" as user "postgres".
discourse=# update site_texts SET value = '' where text_type = 'head';
discourse=# update site_texts SET value = concat('<!-- ', value, ' -->') where text_type = 'head';
discourse=# update site_customizations SET header = concat('<!-- ', header, ' -->') ;
discourse=# update site_customizations SET head_tag = concat('<!-- ', head_tag, ' -->') ;
discourse=# update site_customizations SET body_tag = concat('<!-- ', body_tag, ' -->') ;

(Sam Saffron) #10

you must restart your site after this.

./launcher restart app


@sam Fantastic! Thank you very much!