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.

  • 3
    Do you have items in the recycle bin still referencing the page? If so, you have to delete them first – Robert Lindgren Dec 6 '13 at 13:25
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();
  • I have done all this, but I still can't delete the master page. What are the Powershell options? Thanks! – Ryan George May 8 '14 at 23:24
  • @RyanGeorge Please see my update. – user2536 May 9 '14 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
  • 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 Aug 28 '15 at 5:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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