From: Adam Roses Wight Date: Thu, 4 Dec 2014 18:50:34 +0000 (-0800) Subject: Prevent Google indexing of the SiteNotice div X-Git-Tag: 1.31.0-rc.0~13086^2 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=d79e175a69769e19d90105414de9b2a283abb50b;p=lhc%2Fweb%2Fwiklou.git Prevent Google indexing of the SiteNotice div Site notice and CentralNotice should be omitted from search snippets. We're diluting page content. The awkward thing about this patch is that we can only confirm the googleoff tag is supported for the search appliance, not the public web crawler. See here for those docs, though: http://static.googleusercontent.com/media/www.google.com/en/us/support/enterprise/static/gsa/docs/admin/70/gsa_doc_set/admin_crawl/admin_crawl.pdf Change-Id: I95473e22de83e585044a4f917bbd1b00db7db71b --- diff --git a/includes/skins/Skin.php b/includes/skins/Skin.php index 5604bc23cc..40318c0698 100644 --- a/includes/skins/Skin.php +++ b/includes/skins/Skin.php @@ -1559,6 +1559,11 @@ abstract class Skin extends ContextSource { } wfRunHooks( 'SiteNoticeAfter', array( &$siteNotice, $this ) ); + + // Prevent Google from indexing announcements, cos this dilutes + // content results. + $siteNotice = "{$siteNotice}"; + wfProfileOut( __METHOD__ ); return $siteNotice; }