# Can you block json feedback from being public? (e.g /site/statistics.json /site/basic-info.json)

**URL:** https://meta.discourse.org/t/can-you-block-json-feedback-from-being-public-e-g-site-statistics-json-site-basic-info-json/73374
**Category:** Support
**Created:** [November 3, 2017, 5:30pm UTC](https://meta.discourse.org/t/can-you-block-json-feedback-from-being-public-e-g-site-statistics-json-site-basic-info-json/73374 "2017-11-03T17:30:23Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![David\_Foster](https://avatars.discourse-cdn.com/v4/letter/d/fbc32d/32.png) [@David\_Foster](https://meta.discourse.org/u/David_Foster)
#### Post date: [November 3, 2017, 5:30pm UTC](https://meta.discourse.org/t/can-you-block-json-feedback-from-being-public-e-g-site-statistics-json-site-basic-info-json/73374/1 "2017-11-03T17:30:24Z")

</div>

Just wondering if there is an option I’m not seeing for this..  
its made public that any user can visit your discourse instance and goto site/basic-info.json, site/statistics.json  
and gather information..  
I know its not terribly sensitive information, but still would like the option to avoid any data being freely observed.  
I see in the rails site\_controller.rb  
skip\_before\_action :redirect\_to\_login\_if\_required, only: [‘basic\_info’, ‘statistics’]

I know I can just comment that out to resolve the issue, but it would be better if there was an option in the admin portal that would do this. Is there a setting I’m not seeing in the admin portal?

---

<div class="post-metadata">

### Author: ![nsuchy](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nsuchy/32/166530_2.png) [@nsuchy](https://meta.discourse.org/u/nsuchy)
#### Post date: [November 3, 2017, 8:40pm UTC](https://meta.discourse.org/t/can-you-block-json-feedback-from-being-public-e-g-site-statistics-json-site-basic-info-json/73374/2 "2017-11-03T20:40:31Z")

</div>

The json output is needed for the script to work, HOWEVER if you are worried about scrapers you could put your site behind Cloudflare and enable their “checking your browser” screen which would prevent bots from scraping/abusing the information. If you have privacy concerns with Cloudflare send me a private message and I can refer you to other providers (with extremely strict privacy policies) with a browser check (I don’t want to spam a list here).

---

<div class="post-metadata">

### Author: ![David\_Foster](https://avatars.discourse-cdn.com/v4/letter/d/fbc32d/32.png) [@David\_Foster](https://meta.discourse.org/u/David_Foster)
#### Post date: [November 6, 2017, 3:52pm UTC](https://meta.discourse.org/t/can-you-block-json-feedback-from-being-public-e-g-site-statistics-json-site-basic-info-json/73374/3 "2017-11-06T15:52:18Z")

</div>

Thanks for the response, what script is needing these actions to work?

---

<div class="post-metadata">

### Author: ![fefrei](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fefrei/32/119538_2.png) [@fefrei](https://meta.discourse.org/u/fefrei)
#### Post date: [November 6, 2017, 4:14pm UTC](https://meta.discourse.org/t/can-you-block-json-feedback-from-being-public-e-g-site-statistics-json-site-basic-info-json/73374/4 "2017-11-06T16:14:41Z")

</div>

Discourse (the web application) needs this information, e.g. to render the header and the `/about` page.

---

<div class="post-metadata">

### Author: ![nsuchy](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nsuchy/32/166530_2.png) [@nsuchy](https://meta.discourse.org/u/nsuchy)
#### Post date: [November 6, 2017, 8:32pm UTC](https://meta.discourse.org/t/can-you-block-json-feedback-from-being-public-e-g-site-statistics-json-site-basic-info-json/73374/5 "2017-11-06T20:32:19Z")

</div>

Discourse needs the info to work, there’s no way to block it entirely, you could use a browser check to block bots but many bots can run javascript so that solution might not last long either.

---

<div class="post-metadata">

### Author: ![naomi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/naomi/32/120507_2.png) [@naomi](https://meta.discourse.org/u/naomi)
#### Post date: [November 7, 2017, 7:24pm UTC](https://meta.discourse.org/t/can-you-block-json-feedback-from-being-public-e-g-site-statistics-json-site-basic-info-json/73374/6 "2017-11-07T19:24:17Z")

</div>

@David_Foster To prevent statistics.json from being publicly visible, turn off `share anonymized statistics` (Admin-\>Settings-\>Other)

Note that the information is also on the About page so you may want to [override the about.hbs template](https://meta.discourse.org/t/how-to-customize-discourse-templates/34813).

---

<div class="post-metadata">

### Author: ![nsuchy](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nsuchy/32/166530_2.png) [@nsuchy](https://meta.discourse.org/u/nsuchy)
#### Post date: [November 11, 2017, 3:04am UTC](https://meta.discourse.org/t/can-you-block-json-feedback-from-being-public-e-g-site-statistics-json-site-basic-info-json/73374/7 "2017-11-11T03:04:06Z")

</div>

Would that also block basic-info.json?

---

<div class="post-metadata">

### Author: ![David\_Foster](https://avatars.discourse-cdn.com/v4/letter/d/fbc32d/32.png) [@David\_Foster](https://meta.discourse.org/u/David_Foster)
#### Post date: [November 27, 2017, 9:22pm UTC](https://meta.discourse.org/t/can-you-block-json-feedback-from-being-public-e-g-site-statistics-json-site-basic-info-json/73374/8 "2017-11-27T21:22:39Z")

</div>

thanks for that! all good now!  
no more json data available to the public.  
yay!

---

<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: [December 10, 2023, 5:46pm UTC](https://meta.discourse.org/t/can-you-block-json-feedback-from-being-public-e-g-site-statistics-json-site-basic-info-json/73374/10 "2023-12-10T17:46:57Z")

</div>



---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [December 10, 2023, 6:56pm UTC](https://meta.discourse.org/t/can-you-block-json-feedback-from-being-public-e-g-site-statistics-json-site-basic-info-json/73374/11 "2023-12-10T18:56:37Z")

</div>


