Wednesday, February 18, 2015

How to Hide Share, Follow and Sync Buttons in Sharepoint 2013

We got a requirement to remove Share, Follow and Sync buttons in SharePoint 2013. Let me summarize various ways to disable these buttons.
sharepoint 2013 disable share, follow, sync buttons
How to disable "Share" button in SharePoint 2013?
Share button is relying on "Access requests" configuration of the site. To disable "Share button" in SharePoint 2013, simply disable access requests.

  • Go to Site settings page of your SharePoint site.
  • Click on "Site Permissions" link under "Users and Permissions" group
  • Click on "Access Request Settings" in the ribbon.
  • Uncheck "Allow access request" and click on "Ok" to save your changes. This should hide Share button in SharePoint 2013.sharepoint 2013 disable share button
Remember, You will have to do this change for each site! However, Share button will still be visible for Site owners and administrators!

How to Disable Sync buttons in SharePoint 2013
To disable sync, Navigate to  Site settings >> Click on "Search and offline availability" >> set offline client availability to "No". There are few more ways discussed in my another article: Hide Sync Button in SharePoint 2013

How to disable "Follow" button in SharePoint 2013?
To disable "Follow" button in SharePoint 2013, You'll have to disable a feature called "Following Content". Navigate to:
  • Site Settings >> Click on "Manage Site Features"
  • Click on "Deactivate" on " Following Content" feature
This removes following button in SharePoint 2013. If you want to disable "Following" feature at Farm level, disable "ContentFollowingStapling" hidden feature at Farm Level:
Disable-SPFeature -identity "ContentFollowingStapling"

Disable Access Request, Deactivate Features using PowerShell:

  • Share: To disable access requests on all sites using PowerShell, refer: Disable access request in SharePoint 2013
  • Following: To deactivate "Following content" feature using PowerShell as:
    Disable-SPFeature -identity "FollowingContent" -URL "http://your-sp-site.com/" 
  • Sync: To exclude from offline client, run:
    Get-SPSite -limit all | get-SPWeb -limit all | Foreach { $_.ExcludeFromOfflineClient=1; $_.Update()} 

Remove Share, Follow, Sync buttons at Master page level:

These promoted action buttons are in master page as follows:
Share Button:
Follow Button:
<SharePoint:DelegateControl ID="DelegateControl2" runat="server" ControlId="PromotedActions" AllowMultipleControls="true" />
Sync Button:
<SharePoint:SPSyncPromotedActionButton ID="SPSyncPromotedActionButton1" runat="server" />
To hide these controls, simply move them inside Comment block. <!--  -->. Do not delete this controls from the Master page! You'll end-up in crash!!

CSS to hide Share, Follow and Sync Buttons:

Lets hide them based on their IDs. You can place this CSS code with "Script Editor" web part or you can place it in Master page.
  • Sync button's id: ctl00_SyncPromotedAction
  • Follow button id: site_follow_button
  • Share button's id:  ctl00_site_share_button
<style type="text/css">

a[id$=site_share_button], a[id$=SyncPromotedAction], a#site_follow_button
{
    display: none !important;
} 

</style>
Tips: This hides Share button from promoted actions section. But share button is present in ECB/Callout menu and in list view quick control also. To hide them all as well, use selectors:  a[id$="site_share_button"], a.ms-calloutLink[title="Share"], button.js-listview-qcbShareButton.



You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Check out these SharePoint products:

3 comments :

  1. We did it a bit differently. For us we wanted to block sharing on the MySites to prevent internal data leaks.

    If a user tries to share from their personal page they will get the following error - "Sorry, something went wrong. Only a limited set of people are allowed to share this content."

    CSS hacks were not required for this as there is a feature that can be disabled in the central admin page.

    Central Admin > Manage Web Applications > Highlight your SharePoint - Mysites site > User Permissions

    **Uncheck** *Manage Permissions - Create and change permission levels on the Web site and assign permissions to users and groups.*

    This will prevent the users from being able to adjust the permissions themselves for files/folders on their MySite.

    ReplyDelete
  2. I've tried to hide the Share buttons around the page by using your CSS tip. But notting gets hidden. Tried putting css in the page, in the master-page and linking a css-file from the masterpage.Any clue on what's wrong?

    ReplyDelete
  3. How to UNHIDE EDIT tab in this ribbon, i am an administrator having full control but cannot see this EDIT tab ( I am not an IT expert )

    ReplyDelete

Please Login and comment to get your questions answered!

You might also like:

Related Posts Plugin for WordPress, Blogger...