Skip to main content

SharePoint 2013/Project Server 2013 - Remove or hide ribbon button

SharePoint/Project Server - Remove or hide ribbon button

SharePoint and Project Server has a lot of functionality in the ribbon. Sometimes it can be beneficial to hide some of the buttons for the users so they do not get too confused.

The correct way to hide ribbon buttons is to create a SharePoint feature in Visual Studio and create some XML to override the ribbon. However, if you are not that familiar with developing or Visual Studio it can be a prohibitive task to do.
If you would like to go with the feature solution here is a link for a nice guide on how to do it:

In this post I will go through how to remove ribbon buttons only through the standard Script Editor webpart and Javascript. However you don’t have to know Javascript to complete the task.
The downside of this approach is that your have to add the webpart on all pages where you want to remove the ribbon.

Remove Ribbon Buttons

In Project Server on a PDP page lets say you have a ribbon which looks like this:

(click on image for better quality)

Now in this PWA instance we do not have any Project Sites and they are also disabled in PWA Settings. Therefore, we want to remove the Project Sites button from the ribbon and the Quick Launch. We would also like to remove the Documents, Issues and Risks links.
To do this go to the PDP site and add a new Script Editor webpart.
(click on image for better quality)

In the script editor webpart click EDIT SNIPPET and add the following javascript code:

    function removeLinks() {
        try {
            var elements = null;
            try {
                elements = document.getElementsByClassName('static menu-item ms-core-listMenu-item ms-displayInline ms-navedit-linkNode')
            } catch (ex) {
                //IE8 and lower
                elements = document.querySelectorAll('');
            for (i = 0; i < elements.length; i++) {
                var elm = elements[i];
                if (elm.innerHTML.indexOf('Project Site') >= 0) {
           = 'none';
            var ribbonBtn = document.getElementById("Ribbon.Tabs.PDP.Home.GoTo-Large-2-1");
   = 'none';
            ribbonBtn = document.getElementById("Ribbon.Tabs.PDP.Home.GoTo.GoToDocuments-Medium");
   = 'none';
            ribbonBtn = document.getElementById("Ribbon.Tabs.PDP.Home.GoTo-Large-2-2");
   = 'none';
            ribbonBtn = document.getElementById("Ribbon.Tabs.PDP.Home.GoTo.GoToWorkspace-Large");
   = 'none';
        } catch (ex) { }
        setTimeout(removeLinks, 500);


Script Editor webpart:
(click on image for better quality)

Click Insert and click Stop Editing.
Now the buttons for the project site will be hidden.
(click on image for better quality)

Remember you have to do this for all pages or PDP’s where the buttons should be removed.

Hiding other buttons

If you want to remove other buttons simply replace the button id in the Javascript with the button you want to remove.

    function removeLinks() {
        try {
            var ribbonBtn = document.getElementById("Ribbon.Tabs.PDP.Home.GoTo-Large-2-1");
   = 'none';         
        } catch (ex) { }
        setTimeout(removeLinks, 500);


There are many ways of finding the button id, but I find the easiest way is to use Firefox and Firebug.
(click on image for better quality)

Below i have listed the most common ID's used in the PWA. 
The ID's are listed in the same order as the buttons are placed in the ribbon (starting from the left). 

(click on image for better quality)
-        Ribbon.ContextualTabs.ProjectCenter.Home.Editing.NewProject-Large
-        Ribbon.ContextualTabs.ProjectCenter.Home.Editing.OpenProject-Large
-        Ribbon.ContextualTabs.ProjectCenter.Home.Editing.Import-Large
-        Ribbon.ContextualTabs.ProjectCenter.Home.GoTo-LargeLarge-0
o   Ribbon.ContextualTabs.ProjectCenter.Home.GoTo.GoToTeamBuilder-Large
o   Ribbon.ContextualTabs.ProjectCenter.Home.GoTo.GoToResourcePlan-Large
o   Ribbon.ContextualTabs.ProjectCenter.Home.GoTo.GoToProjectPermissions-Large
-        Ribbon.ContextualTabs.ProjectCenter.Home.GoTo-LargeLarge-1
o   Ribbon.ContextualTabs.ProjectCenter.Home.GoTo.GoToCheckin-Large
-        Ribbon.ContextualTabs.ProjectCenter.Home.Navigate.ZoomIn-Large
-        Ribbon.ContextualTabs.ProjectCenter.Home.Navigate.ZoomOut-Large
-        Ribbon.ContextualTabs.ProjectCenter.Home.Navigate.ScrollTask-Large
-        Ribbon.ContextualTabs.ProjectCenter.Home.Data-Large-0
-        Ribbon.ContextualTabs.ProjectCenter.Home.Data-Large-1 (icons)
o   Ribbon.ContextualTabs.ProjectCenter.Home.Data-Large-1-0
o   Ribbon.ContextualTabs.ProjectCenter.Home.Data-Large-1-1
o   Ribbon.ContextualTabs.ProjectCenter.Home.Data-Large-1-2
-        Ribbon.ContextualTabs.ProjectCenter.Home.Data-Large-2 (dropdowns)
o   Ribbon.ContextualTabs.ProjectCenter.Home.Data-Large-2-0
o   Ribbon.ContextualTabs.ProjectCenter.Home.Data-Large-2-1
o   Ribbon.ContextualTabs.ProjectCenter.Home.Data-Large-2-2
-        Ribbon.ContextualTabs.ProjectCenter.Home.Timeline.AddProject-Large
-        Ribbon.ContextualTabs.ProjectCenter.Home.Timeline.AddTasks-Large
-        Ribbon.ContextualTabs.ProjectCenter.Home.Share.ExportExcel-Large
-        Ribbon.ContextualTabs.ProjectCenter.Home.Share.Print-Large
-        Ribbon.ContextualTabs.ProjectCenter.Home.ShowHide-Large-0-0
-        Ribbon.ContextualTabs.ProjectCenter.Home.ShowHide-Large-0-1

(click on image for better quality)
-        Ribbon.Tabs.PDP.Home.Project.Edit-Large
-        Ribbon.Tabs.PDP.Home.Project.Save-Large
-        Ribbon.Tabs.PDP.Home.Project.Close-Large
-        Ribbon.Tabs.PDP.Home.GoTo-Large-0
-        Ribbon.Tabs.PDP.Home.GoTo-Large-1
-        Ribbon.Tabs.PDP.Home.GoTo-Large-2
o   Ribbon.Tabs.PDP.Home.GoTo-Large-2-0
o   Ribbon.Tabs.PDP.Home.GoTo-Large-2-1
o   Ribbon.Tabs.PDP.Home.GoTo-Large-2-2
-        Ribbon.Tabs.PDP.Home.GoTo-Large-3
o   Ribbon.Tabs.PDP.Home.GoTo-Large-3-0
o   Ribbon.Tabs.PDP.Home.GoTo-Large-3-1
o   Ribbon.Tabs.PDP.Home.GoTo-Large-3-2
-        Ribbon.Tabs.PDP.Home.Page.Previous-Large
-        Ribbon.Tabs.PDP.Home.Page.Next-Large

(click on image for better quality)

-        Ribbon.ContextualTabs.ProjectDrilldown.Tasks.Clipboard-LargeMedium-0
-        Ribbon.ContextualTabs.ProjectDrilldown.Tasks.Clipboard-LargeMedium-1
o   Ribbon.ContextualTabs.ProjectDrilldown.Tasks.Clipboard-LargeMedium-1-0
o   Ribbon.ContextualTabs.ProjectDrilldown.Tasks.Clipboard-LargeMedium-1-1
o   Ribbon.ContextualTabs.ProjectDrilldown.Tasks.Clipboard-LargeMedium-1-2
-        Ribbon.ContextualTabs.ProjectDrilldown.Tasks.Update.EditPWAProject-Large
-        Ribbon.ContextualTabs.ProjectDrilldown.Tasks.Update.SaveProject-Large
-        Ribbon.ContextualTabs.ProjectDrilldown.Tasks.Update.Close-Large
-        Ribbon.ContextualTabs.ProjectDrilldown.Tasks.Update.PublishProject-Large
-        Ribbon.ContextualTabs.ProjectDrilldown.Tasks.Editing-Large-0
o   Ribbon.ContextualTabs.ProjectDrilldown.Tasks.Editing-Large-0-0
o   Ribbon.ContextualTabs.ProjectDrilldown.Tasks.Editing-Large-0-1
-        Ribbon.ContextualTabs.ProjectDrilldown.Tasks.Editing-Large-1
-        Ribbon.ContextualTabs.ProjectDrilldown.Tasks.Editing-Large-2
-        Ribbon.ContextualTabs.ProjectDrilldown.Tasks.Editing-Large-3
-        Ribbon.ContextualTabs.ProjectDrilldown.Tasks.Task.NewTask-Large
-        Ribbon.ContextualTabs.ProjectDrilldown.Tasks.Task.DeleteTask-Large
-        Ribbon.ContextualTabs.ProjectDrilldown.Tasks.Task.DeleteTask-Large (Duplicate ID in Project Server 2013)
-        Ribbon.ContextualTabs.ProjectDrilldown.Tasks.Data-Large-0
-        Ribbon.ContextualTabs.ProjectDrilldown.Tasks.Data-Large-1 (icons)
o   Ribbon.ContextualTabs.ProjectDrilldown.Tasks.Data-Large-1-0
o   Ribbon.ContextualTabs.ProjectDrilldown.Tasks.Data-Large-1-1
o   Ribbon.ContextualTabs.ProjectDrilldown.Tasks.Data-Large-1-2
-        Ribbon.ContextualTabs.ProjectDrilldown.Tasks.Data-Large-2 (dropdowns)
o   Ribbon.ContextualTabs.ProjectDrilldown.Tasks.Data-Large-2-0
o   Ribbon.ContextualTabs.ProjectDrilldown.Tasks.Data-Large-2-1
o   Ribbon.ContextualTabs.ProjectDrilldown.Tasks.Data-Large-2-2
-        Ribbon.ContextualTabs.ProjectDrilldown.Tasks.Navigate.ZoomIn-Large
-        Ribbon.ContextualTabs.ProjectDrilldown.Tasks.Navigate.ZoomOut-Large
-        Ribbon.ContextualTabs.ProjectDrilldown.Tasks.Navigate.ScrollTask-Large


Popular posts from this blog

Sharepoint 2013 - Fullscreen mode/hide quick launch

If you want to hide the quick launch on a SharePoint page or web part page in 2013 you could of cause use CSS scripts as in 2010.
But as a new thing in 2013 the user have the possibility to click on full screen mode. so why not load your page in this mode and then the user can choose to exit the mode if he prefers.

Add a content editor webpart to your page and click on Edit HTML from the ribbon.
Add the following code:

<script type="text/javascript">
window.onload = function()

Reporting on Microsoft Planner or Microsoft Staffhub!

Reporting on Planner or StaffHub!

For a long time I have been waiting for the reporting API for Planner and Staffhub. Today I got tired of waiting and found another way to do it.

I manage to create a PowerBI report based on all the planner plans I have access to and the same method will work for Staffhub and properly many other services such as Microsoft Tasks, Microsoft Forms, etc. 

How?Easy, but requires some Azure, Flow and PowerBI knowledge. These are the steps to I used: 1.Create an Azure Blob to hold the data 2.Create a Flow to save Planner data in the Blob 3.Access the Blob from PowerBI Azure – Blob!So first, lets create a Blob. No, not that kind of Blob. Access the Azure portal - Select New and search for “storage account” Fill out the form and click create. I kept all settings to their default Access the new storage and locate/copy the Storage Account Name and Access Key – you will need this for connections to Flow and PowerBI. Next let’s create a Blob Container an…

SharePoint/Project Server - Firewall port open list

Firewall port open list Every time I have to install a new instance of Project Server I forget which ports have to be open.
The ports are divided into 3 lists, one list for the web front end servers, one list for the application server and one list for the SQL server.
These ports are based on a 2013 installation of SharePoint/Project Server. the 2010 installation defer a little bit.

Web Frontend ServerWhen a range is specified all ports between the range must be opened.
-80 TCPInhttp
-443 TCPInhttps/ssl
-25 TCPInSMTP for e-mail integration
-16500-16519TCPInPorts used by the search index component
-22233-22236TCPIn/OutPorts required for the AppFabric Caching Service
-32843-32845TCPInCommunication between Web servers and service applications
-32846TCPIn/OutSharePoint User Code Service
-808-809TCPInOffice Web Apps