Error When Trying to Delete a Master Page: “Server error: This item cannot be deleted because it is still referenced by other pages.”

I’ve had this happen often and I’ve usually just left the unused master pages, since they aren’t really hurting anything.  Today I finally decided to try to see if I could get rid of a pile of old copies of master pages I had lying around, and I found this Microsoft article which explains a workaround.  Turns out it’s a “known issue”.  Once you’ve gone through these steps, you ought to be able to delete the master page.  However, I’ve found that this workaround doesn’t always work in Site Collections with variations enabled.

When you try to delete a master page file from the Master Page and Page Layout Gallery on the Site Settings page in Microsoft Office SharePoint Server 2007, you receive the following error message:

This item cannot be deleted because it is still referenced by other pages.

This error message occurs even when the master page file is not associated with a SharePoint Server 2007 site.To work around this problem, mark the master file as hidden so that the master file does not appear as a selection when you create a new site. To do this, follow these steps:

  1. Use an account that has administrative permissions to log on to the Web application that is hosted on the SharePoint Server 2007 server.
  2. Click Site Actions, click Site Settings, and then click Modify All Site Settings.
  3. Under Galleries, click Master Page and Page Layout Gallery.
  4. Click the list next to the master file that you want to hide, and then click Edit Properties.
  5. On the list next to Content Type, click Page Layout.
  6. Click to select the check box next to Hidden Page, and then click OK.
  7. Click the list next to the master file, and then click Check In.
  8. On the Check In page, select the options that you want, and then click OK.
  9. Click the list next to the master file, and then click Publish a Major Version.
  10. On the Publish a Major Version page, enter a comment, and then click OK.
  11. Click the list next to the master file, and then click Approve/reject.
  12. Next to Approval Status, click Approved, and then click OK to approve the changes.

3 Comments

  1. Its seems to be a weired step but I managed to delete master pages following the steps below
    1. Create a folder inside catalogs using sharepoint designer.
    2. Move all the unused m aster pages in the folder.
    3.Try and Delete if they still give an error. Rename them removing .master.
    4. Some name will change some will not it doesnt matter.
    5. Now try and delete they should delete.

    Reply
  2. Mark,

    I found another solution. In the browser, make sure creating folders in the Master Page Gallery is enabled and create a temp folder. Then, go back to SPD, refresh to site so you can see the temp folder, and copy the unwanted master page files into the new temp folder. Then, return to the browser, click the dropdown beside the folder and choose Delete.

    Problem solved.

    Reply

Have a thought or opinion?