Ejegg has submitted this change and it was merged.

Change subject: Prevent Google indexing of the SiteNotice div
......................................................................


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
---
M includes/skins/Skin.php
1 file changed, 5 insertions(+), 0 deletions(-)

Approvals:
  Ejegg: Looks good to me, approved



diff --git a/includes/skins/Skin.php b/includes/skins/Skin.php
index 5604bc2..40318c0 100644
--- a/includes/skins/Skin.php
+++ b/includes/skins/Skin.php
@@ -1559,6 +1559,11 @@
                }
 
                wfRunHooks( 'SiteNoticeAfter', array( &$siteNotice, $this ) );
+
+               // Prevent Google from indexing announcements, cos this dilutes
+               // content results.
+               $siteNotice = "<!--googleoff: all-->{$siteNotice}<!--googleon: 
all-->";
+
                wfProfileOut( __METHOD__ );
                return $siteNotice;
        }

-- 
To view, visit https://gerrit.wikimedia.org/r/177589
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I95473e22de83e585044a4f917bbd1b00db7db71b
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Awight <awi...@wikimedia.org>
Gerrit-Reviewer: Aaron Schulz <asch...@wikimedia.org>
Gerrit-Reviewer: AndyRussG <andrew.green...@gmail.com>
Gerrit-Reviewer: Awight <awi...@wikimedia.org>
Gerrit-Reviewer: Bartosz DziewoƄski <matma....@gmail.com>
Gerrit-Reviewer: Daniel Friesen <dan...@nadir-seen-fire.com>
Gerrit-Reviewer: Ejegg <eeggles...@wikimedia.org>
Gerrit-Reviewer: Jack Phoenix <j...@countervandalism.net>
Gerrit-Reviewer: Katie Horn <kh...@wikimedia.org>
Gerrit-Reviewer: Nemo bis <federicol...@tiscali.it>
Gerrit-Reviewer: Reedy <re...@wikimedia.org>
Gerrit-Reviewer: Ssmith <ssm...@wikimedia.org>
Gerrit-Reviewer: Tim Starling <tstarl...@wikimedia.org>
Gerrit-Reviewer: Umherirrender <umherirrender_de...@web.de>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to