The Difference Between Default & Custom Master Pages

If you have ever right clicked a master page in SharePoint Designer, you probably noticed that you can set a master page as the default master page as well as the custom master page. When you create a new SharePoint 2010 site, by default, you will notice that the v4.master master page, found in the /_catalogs/masterpage directory, has already been set as your default and custom master page. But what is the difference?
There are two primary differences.
First, the kicker in my opinion, the custom master page is the master page that pages that inherit from the PublishingLayoutPage class use. You can read more about this in an article I wrote a little while ago (Difference Between PublishingLayoutPage and WebPartPage Classes).  This is rather important in Publishing sites, or Foundation sites with Publishing enabled. Let me repeat this because it spins many developers for a loop every time it seems. If you have a publishing site and you create a new publishing page, (a page that goes into the /pages/ directory), any layout page that this page uses will always use the master page that is set as the custom master page. Even if you attempt to change the page declaration of the layout page, the page will still end up using the custom master page. The best way around this is to create your own class that inherits from PublishingLayoutPage that your layout page can then use. This is not a trivial task though and is beyond the scope of this post.
Second, which is more obvious, a default and custom master page allows you to easily create and use two master pages throughout your SharePoint site collection and/or each sub site. You could create your default master page that some pages will use and then create a second, custom master page that other pages will use. Obvious enough.
As an example, related to our first discussion of custom master pages and Foundation sites with Publishing features enabled. You could create a site with pages in the sitepages directory that utilize the default master page, while at the same time having pages in the Pages directory (that utilize layout pages) that will use the custom master page. This provides you the ability to easily have two different styles in one site. Now the changes might be extreme or just slight, but would be best handled in the master page.
A second example would be where you want to simply have two different types of branded pages in your SharePoint site that be easily switched to a different master page as needed. What I mean is that if you have Branding A and Branding B, A being for top level pages and B being for lower level pages, and each needs say a slightly different header and quick launch bar layout, you could set A pages with the default master page and B pages with the custom master page. Now if you ever had to change Branding A pages to use a new default master page, you could just set your new master page as your default master page and all Branding A pages would automatically begin using the new default master page. This would be a lot quicker than if you had hard coded the master page file in each of Branding A pages Page declaration.
Finally as a quick reference, to set a page to use the default master page, your page declaration would look similar to

<%@ Page Language="C#" Inherits="Microsoft.SharePoint.WebPartPages.WikiEditPage" MasterPageFile="~masterurl/default.master" meta:webpartpageexpansion="full" meta:progid="SharePoint.WebPartPage.Document"   %>

While if you wanted to set a page to use your custom masterpage, your page declaration would look similar to

<%@ Page Language="C#" Inherits="Microsoft.SharePoint.WebPartPages.WikiEditPage" MasterPageFile="~masterurl/custom.master" meta:webpartpageexpansion="full" meta:progid="SharePoint.WebPartPage.Document"   %>

I hope this has been a help. Have you found other reasons to have a default and custom master page? Please tell us.

3 thoughts on “The Difference Between Default & Custom Master Pages

  1. June 7, 2012

    Being a SharePoint noob this helped me tremendously. Just yesterday I was struggling with what to do about my master page displaying incorrectly for pages not created as a publishing page. Problem solved.

  2. Shiva October 16, 2012

    Nice article, helpful to all branding pros

  3. Andrew February 17, 2016

    Clear article which helped me, but you should fix the markup that you are quoting.
    <%@ Page Language="C#" Inherits="Microsoft.SharePoint.WebPartPages.WikiEditPage" is truncated for me, I am using Chrome.

Leave a Comment

Your email address will not be published. Required fields are marked *

Enter Code *

Filed Under


Anyone who has 'attended' a physical meeting by 'conferencing in' in knows the frustrations & limitations that come from not being in the room. You're the voice in the ceiling & not equally represented in the conversation.

This is no longer acceptable.

Today, we find ourselves facing the “hybrid work paradox.”

Employees are keen to retain flexibility. At the same time, human-to-human collaboration remains important.

To marry the best of both, hone your strategy, spaces, & tech to suit employee needs.

It's the day of the show, y'all!

Join the #PixelMillWebinars this morning at 11am PST for a live panel discussion about what the #digitalworkspace looks like for a #hybrid team, & how #Microsoft365 can empower your users no matter where they're working.


Join the #PixelMillWebinars this Thursday as we welcome key players from @OrchestrySoft, @KieferConsult, and @AP_Mortgage to discuss the hybrid work paradox and how #Microsoft365 can empower your users no matter where they're working.

We've all been itching to get "back to normal," but what does that mean? Are we missing out on valuable lessons learned by trying to return to something that perhaps wasn't working before?

Join us next week for a live panel discussion on the new normal.

Subscribe to PixelMill's

* indicates required

Let's Talk Digital
Workspaces Today

Get In Touch