Finding all references where a master page, page layout, or other file is used in a MOSS 2007 Publishing (WCM) site

Seems to be quite a common question popping up recently... people are trying to delete their master page or page layout (or some other file) from the Master Page Gallery but keep getting an error.

Seems to be quite a common question popping up recently… people are trying to delete their master page or page layout (or some other file) from the Master Page Gallery but keep getting the following error:

SharePoint 2007 Error

SharePoint 2007 Error

Even though you think you cleaned up all the places where a file is being used, I’ve yet to see a bug in MOSS that says a file is being used yet it really isn’t. Chances are, you just missed one (or two). The easiest way to find where a file is being used is to go to the Site Content & Structure page via Site Actions ยป Manage Content and Structure. Then open up the Master Page Gallery. You’ll notice a option in the toolbar: Show Related Resources. Select that item to create a split view. Now each item in the Master Page Gallery (shown in the top pane) has a radio button next to it. Selecting one will show you all the places that file is being used throughout the site collection.

Here’s a screen shot of a particular page layout and where it is being used within my site collection:

SharePoint 2007 - Show All Related Resources

SharePoint 2007 - Show All Related Resources

Andrew Connell
Developer & Chief Course Artisan, Voitanos LLC. | Microsoft MVP
Written by Andrew Connell

Andrew Connell is a web & cloud developer with a focus on Microsoft Azure & Microsoft 365. He’s received Microsoft’s MVP award every year since 2005 and has helped thousands of developers through the various courses he’s authored & taught. Andrew’s the founder of Voitanos and is dedicated to helping you be the best Microsoft 365 web & cloud developer. He lives with his wife & two kids in Florida.

Share & Comment