SharePoint Usability Tip: Hide the My Site link in Portal

Quickly hide the “My Site” link in Portal by adding this style rule to your custom style sheet:

#hlMySite  {display: none}

This changes the display to none, so you aren’t actually removing the link from the code.

11 thoughts on “SharePoint Usability Tip: Hide the My Site link in Portal”

  1. Well there isn’t My Site in WSS, but if you mean another link, not really. WSS gets finicky and changes out the IDs assigned to href tags, so the CSS trickery doesn’t work the same. You can however edit the links in the ONET.XML file.

  2. Nic,maybe heather will email this to you.The links you’re referring to in the Top Navigation bar on a WSS site are very easy to find in the DOM. (even if you don’t know their IDs) They’re all located inside of a TD element with an ID of HBN100 and have the following URLs.http://sharepoint/sites/<SITENAME>/default.aspxhttp://sharepoint/sites/<SITENAME>/_layouts/1033/viewlsts.aspxhttp://sharepoint/sites/<SITENAME>/_layouts/1033/create.aspxhttp://sharepoint/sites/<SITENAME>/_layouts/1033/settings.aspxjavascript:HelpWindowKey(“NavBarHelpHome”)I’m of course referring to Home, Documents and Lists, Create, Site Settings and Help. Place a content editor part on your page, hide the title bar, give it a good name, like “RemoveNavBarLinks”, and then open the View Source.You should end up with the following code more or less.<script type=”text/javascript”>badurlregExps = { /url1pattern/, /url2pattern/ }navbar = document.getelementbyid(‘HBN100’);links = navbar.getelementsbytag(“A”);for(i=0; i<links.length-1; i++){for(j=0; j<badurlregexps.length-1;j++){if(badurlregexps[j].test(links[i].href){ // a match toggleelement(links[i]);}else{ // no match – log something?}}}</script>

  3. I am not having any lucK with this. Our portal site is using the “Classic” theme. I have set the Master Page to use my Custom style sheet (which only has this one entry). I am not a programmer – I lost my coder to another project – so all this is new to me. Should I copy the contents of the Classic CSS to my custom CSS and get rid of theme? Any help would be greatly appreciated.Thanks.

  4. I don’t know if anyone has another work around but the original css rule didn’t work for me. I discovered that the id was ctl00_PlaceHolderGlobalNavigation_ctl08_hlMySite in my site. when I put #ctl00_PlaceHolderGlobalNavigation_ctl08_hlMySite{dispay:none} it worked!! Another designer in my company had a similiar problem with referencing controls that sit in master pages and used classes in his css instead of referencing by id. Is there any way around this?I guess there won’t be as the browser renders the control id as ctl00_PlaceHolderGlobalNavigation_ctl08_hlMySite and it needs to be referenced as this. The most obvious problem is when PlaceHolderGlobalNavigation changes name then all references are broken

  5. As ever you are the “font” of knowledge on sharepoint..Thanks this gets me round allowing users to add alerts without the confusion of explainnig My Site to 800 users

  6. Removing this line from the HTML works too. <SharePoint:DelegateControl ControlId=”GlobalSiteLink2″ Scope=”Farm” runat=”server”/>

  7. You can also control who has the ability to create a MySite (and see the link) using security settings. This setting is in the “Personalization and Services Permissions” link on the SSP home page. I am too lazy to go in to all the details here but it is well documented in the “office sharepoint server 2007 administrator’s companion”, page 255. This also allows you to turn the link on and off for specific groups of people.

Comments are closed.