When developing a public facing website using the publishing features of MOSS it might be required to emit a ROBOTS meta tag that prevents internet search engines from indexing specific pages.
The standard RobotsMetaTag control included in WSS generates the following tag:
<META NAME="ROBOTS" CONTENT="NOHTMLINDEX">
Unfortunatelly most search engines do not understand the NOHTMLINDEX content value but a value of NOINDEX. To resolve this it is required to replace the RobotsMetaTag control in the master page with a custom control that emits the correct value.
The following code will do this:
Here are the required steps to implement this:
Is there a way to avoid Sharepoint Designer warning us that we are missing the original <SharePoint:RobotsMetaTag runat="server"/> tag?
HotFix Security Hotfix MS07-059 Artikel zum Lesen Why SharePoint Server is Terrible Dazu der Kommentar
Why do you not use a control adapter instead of custom control? Is it for performance improvment?
nice idea! You are right: this would be the better solution.
I will post it in a minute as a new blog entry.
When developing a public facing website using the publishing features of MOSS it might be required to
I don't understand.
If I put this in the Master Page then it means that the WHOLE site isn't indexed, no?
I need just a few pages to be excluded.
then change the logic in the control and look for a page specific property rather than the site property to decide which robot tags to render.
how do I check a page property?
you would need to open the list item for the current URL and then read the property. Similar to the code above.