After upgrading my SharePoint 2010 site collection to SharePoint 2013, I was working on updating my Master pages and Page Layouts. Part of that involved some cleanup of some old master pages and page layouts. However, when I attempted to delete one of my old SharePoint 2010 master pages, I received the following error: Server error: This item cannot be deleted because it is still referenced by other pages.

My first question was, “What pages?” It turns out, there is an easy way to find out.

  1. Go to your site collection.
  2. Choose Site Settings -> Manage Content and Structure
  3. Navigate to your Master Page Gallery
  4. Check the master page or page layout you want to reference
  5. On the toolbar, choose Show Related Resources

SharePoint will display all of the items the Master Page or Page Layout uses.

And also all of the items which use the Master Page or Page Layout.

If it turns out your Master Page or Page Layout is not being Used By something but you still can’t delete it, you are probably experiencing a well-known bug. The details can be found here:

I also came across a nice blog with a fix that creates a temporary folder called “DeleteMe” in the Master Page Gallery, turns versioning off in that folder, uses SharePoint Designer to drag the Master Page into the “DeleteMe” folder, and then deletes the entire “DeleteMe” folder from the Master Page Gallery: