# How to regenerate FAQ and TOS pages?

**URL:** https://meta.discourse.org/t/how-to-regenerate-faq-and-tos-pages/110625
**Category:** Support
**Created:** [4 maart 2019 om 14:43 UTC](https://meta.discourse.org/t/how-to-regenerate-faq-and-tos-pages/110625 "2019-03-04T14:43:15Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![SMx](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/smx/32/83713_2.png) [@SMx](https://meta.discourse.org/u/SMx)
#### Post date: [4 maart 2019 om 14:43 UTC](https://meta.discourse.org/t/how-to-regenerate-faq-and-tos-pages/110625/1 "2019-03-04T14:43:15Z")

</div>

Hi everyone,

I may have deleted FAQ and TOS pages by mistake and I now have a spinning wheel when I click on the FAQ link on the hamburger menu, and “topic not found” for the TOS.

Should I just create these topics? Will they have the same link?  
Is there a command to re-build these core files?

Thank you.

---

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [4 maart 2019 om 15:11 UTC](https://meta.discourse.org/t/how-to-regenerate-faq-and-tos-pages/110625/2 "2019-03-04T15:11:46Z")

</div>

Interesting. How did you manage to delete those topics? You shouldn’t be allowed to delete them in the UI.

First, let’s see if the topics are really gone.

```plaintext
./launcher enter app
rails c

```

```ruby
Topic.with_deleted.exists?(SiteSetting.guidelines_topic_id)
Topic.with_deleted.exists?(SiteSetting.tos_topic_id)

```

If the topics are really gone, create two new topics in the Staff category and assign the topic ids in the rails console to the site settings.

```ruby
SiteSetting.guidelines_topic_id = 4711 # replace with topic id
SiteSetting.tos_topic_id = 4712 # replace with topic id

SiteSetting.default_locale

```

And then replace the content of those topics by using the “Manual Update” described in [Update seeded categories and topics](https://meta.discourse.org/t/update-seeded-categories-and-topics/111963)

---

<div class="post-metadata">

### Author: ![SMx](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/smx/32/83713_2.png) [@SMx](https://meta.discourse.org/u/SMx)
#### Post date: [4 maart 2019 om 15:42 UTC](https://meta.discourse.org/t/how-to-regenerate-faq-and-tos-pages/110625/3 "2019-03-04T15:42:50Z")

</div>

Thank you so much @gerhard. Very helpful as always.  
As soon as I get at a computer I’ll check this out.

We had a failed migration and wanted to keep discourse settings while deleting the migrated topics/categories. And because we had a “trash” folder with about 70k topics of trash, all written by “system”, we had to forcefully clear from the DB all topics created.

Is this the command for the “/privacy” page?

`SiteSetting.privacy_topic_id = 4712 # replace with topic id`

Thank you.

---

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [4 maart 2019 om 15:46 UTC](https://meta.discourse.org/t/how-to-regenerate-faq-and-tos-pages/110625/4 "2019-03-04T15:46:00Z")

</div>

Yes, that’s the correct site setting.

---

<div class="post-metadata">

### Author: ![SMx](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/smx/32/83713_2.png) [@SMx](https://meta.discourse.org/u/SMx)
#### Post date: [7 maart 2019 om 15:21 UTC](https://meta.discourse.org/t/how-to-regenerate-faq-and-tos-pages/110625/5 "2019-03-07T15:21:04Z")

</div>

> [@gerhard](#):
>
> Topic.with\_deleted.exists?(SiteSetting.tos\_topic\_id)

```
[1] pry(main)&gt; **Topic**.with_deleted.exists?( **SiteSetting**.guidelines_topic_id)
=&gt; **false**
[2] pry(main)&gt; **Topic**.with_deleted.exists?( **SiteSetting**.tos_topic_id)
=&gt; **false**
[3] pry(main)&gt;

```

They were indeed missing as suspected.

Thank you so much. It worked like a charm.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [6 april 2019 om 15:21 UTC](https://meta.discourse.org/t/how-to-regenerate-faq-and-tos-pages/110625/6 "2019-04-06T15:21:12Z")

</div>

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