Noindex can be used to prevent indexing of a page by search engines. Sample code would be:
$wgOut->setRobotPolicy('noindex,nofollow');
Or, if one wished to be more selective:
$wgOut->setIndexPolicy('noindex');
There are also __INDEX__
and __NOINDEX__
magic words. To make these work for a given namespace, one may need to adjust $wgExemptFromUserRobotsControl. One can test whether they function for a given page using Title::canUseNoindex()
.
See also
- w:Noindex
- Nofollow
- Manual:$wgDefaultRobotPolicy
- Manual:$wgExemptFromUserRobotsControl
- Manual:$wgNamespaceRobotPolicies
- Help:Controlling search engine indexing
This article is issued from Mediawiki. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.