2

I'm unable to remove a master page from my portal. I have tried to delete but, its saying that its is been referenced still by some pages. Its not using in any pages anymore. How can I remove the same ?

This is the error message. 0x81020089This item cannot be deleted because it is still referenced by other pages.

1
  • 3
    Do you have items in the recycle bin still referencing the page? If so, you have to delete them first Commented Dec 6, 2013 at 13:25

6 Answers 6

6

Empty your SharePoint site's recycle bin (_layouts/recyclebin.aspx) and the Admin recycle bin (/_layouts/AdminRecycleBin.aspx)

Next, check that the masterpage you are trying to delete is not selected in either Masterpage for website or System Master Page at /_layouts/ChangeSiteMasterPage.aspx.

Try to delete the masterpage now. If it is still unable to delete it, go back to /_layouts/ChangeSiteMasterPage.aspx and select "Reset all subsites, so they inherit the setting for the site master page" for both Masterpage for website and System Master Page with the new masterpage you want to use selected and click OK.

If this does not solve it and the error persists, try using to find which subsites that are not affected by the above changes.


Update

One way of deleting a master page from the master page gallery is by doing the following:

if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null)
{
    Add-PSSnapin "Microsoft.SharePoint.PowerShell"
}

$spWeb = Get-SPWeb "http://sharepoint.site.com/"
$masterpageGallery = $spWeb.GetFolder("_catalogs/masterpage")
$masterpage = $masterpageGallery.Files["MyMasterPage.master"]
$masterpage.Delete();
$spWeb.Dispose();
2
  • I have done all this, but I still can't delete the master page. What are the Powershell options? Thanks! Commented May 8, 2014 at 23:24
  • @RyanGeorge Please see my update.
    – user2536
    Commented May 9, 2014 at 9:12
0

Rather than "hiding" the page chose to create a Folder called "DeleteMe" in the MasterPage Gallery, then turn Version Control off completely and Content Approval off too. Then open the gallery using SPD and drag the master pages into the DeleteMe Folder, then go back to the Master Gallery web page and deleted the Folder

link to source

0

Rather than removing as a whole go to each element in the masterpage (test.master, css, js, fonts, images etc) right click them and click unpublish this version and later try to delete each element. The tricky part here is first remove all other files and then finally the font files (if any).

0

This solution didn't work for me but this one did http://www.sharemuch.com/2014/03/24/how-to-resolve-server-error-this-file-may-not-be-moved-deleted-when-working-with-sharepoint-master-page

Steps from the above blog:

  • Copy the existing *.html file in the gallery
  • Rename the copied *.html file to the name you wish to give (or have already given) to your custom master page
  • To delete the masterpage, delete respective *.html file instead, etc
1
  • Can you please include some of the content from the provided link and describe on how to solve the problem. External links have high chance to break and its good to have some content here for future visitors.
    – Asad Refai
    Commented Aug 28, 2015 at 5:24
0

SharePoint 2016 on-Premise -- Resolution for me was to delete the HTML file first. Wait for a few seconds and then delete the Master page file.

Of course ensuring that no sites were using the master page also helped.

0

This is a very old post, however I had a similar problem and none of above was useful.

In my case, I had copied and pasted a default master page using sharepoint designer to create a custom master page, never published: then, I was unable to delete this.

The only way I found was to use the SharePoint Manager tool, from here I was able to delete the custom master page.

Hope this help someone...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.