Set Custom Master Pages For SharePoint Server 2016

SharePoint 2016, by default, sets seattle.master as the site and system master page. However, we can apply custom master pages as site and system master pages. In order to apply custom master pages, we have to ensure that the SharePoint Publishing feature is activated.

Once activated, we can create custom master pages and approve them. Once approved in the master page gallery, they will come up in the site and system master pages settings drop down.


Let’s see how to set the custom master pages, using PowerShell. Spin up SharePoint 2016 Management Shell as administrator.


Run the below command to set the custom site and system master page. 

  1. $oWeb = Get-SPWeb "http://sharepoint2016"  
  2.   
  3. #Change the Site Master Page  
  4. $oWeb.CustomMasterUrl = "/_catalogs/masterpage/SP2016CustomSiteMaster.master"  
  5.   
  6. #Change the System Master Page  
  7. $oWeb.MasterUrl = "/_catalogs/masterpage/SP2016CustomSystemMaster.master"  
  8.   
  9. $oWeb.Update()  

 

Now, if we go back to the "Master Page Settings" page, we can see the updated custom site and system master pages.


Summary

Thus, we saw how to set the site and system master pages with custom master pages in SharePoint 2016