Disable google search on 404 page


(Admir Hodzic) #1

My Discourse is on private network and no search engine can reach it.
If some how users hit 404 page at bottom there is Google Search Tex Box
Is there an easy way to hide that search box ?


(Michael Downey) #2

Probably the easiest thing would be use some CSS customizations in the admin area to hide the visibility of the h2.page-not-found-search and form#google-search elements. Haven’t tried it myself though. :slight_smile:


(Jeff Atwood) #3

Why does it need to be disabled? Oh wait I missed the first part, sorry:

My Discourse is on private network and no search engine can reach it.


(Admir Hodzic) #4

It won’t work in my case.
Because my forum resident in private network.
If my users try to search with google it will show nothing.
I do not want my users to roam in Google and thinks that there is nothing.
I’ll prefer to show users Discourse search box so it can seek for missed topic or posts.


(Jeff Atwood) #5

OK, I shifted some CSS classes around so updating to latest and adding this to your site’s local CSS should work:

.page-not-found-search { display: none; }


(Arpit Jalan) #6

Sent a PR to automatically disable Google search on private instance:

https://github.com/discourse/discourse/pull/2761


(Michael Downey) #7

FWIW, this is great IMHO, but still wouldn’t activate in a case of something running on a private network or intranet. :slight_smile: