I was trying to edit my master page and attempted to upload a new file. It seems that it was unsuccessful but when I try to go back to any page of my site, I get the following error:

An error occurred during translation of your HTML master page. For more information, please navigate to the master page by clicking the preview button in the Master Page Gallery or directly typing its URL.

How do I fix this?

The only thing I can think of is deleting my entire site collection (which at this point is an option since it's an experiment/new) but what would I do if this were a fully developed site where starting over is unacceptable?

  • which sharepoint version you are using? which site template used? did you edit the default master page or you make the copy of it?
    – Waqas Sarwar MVP
    Commented Jul 30, 2014 at 15:01
  • Office 365 - SP2013. It's a custom template converted from html/css. It was the default master page. Commented Jul 30, 2014 at 15:02
  • i mean is it team site or public site>
    – Waqas Sarwar MVP
    Commented Jul 30, 2014 at 15:06
  • it's a team site Commented Jul 30, 2014 at 15:07

3 Answers 3


For On-Prem installations:

You can always change the master page from PowerShell using the below script:

Connect-SPOService -Url "tenant admin url" -credential "username"
$web = Get-SPOSite http://sharepoint
$web.CustomMasterUrl = "/_catalogs/masterpage/nightandday.master"
$web.MasterUrl = "/_catalogs/masterpage/nightandday.master"

Source: http://www.toddklindt.com/blog/Lists/Posts/Post.aspx?ID=226

For SharePoint Online:

Option 1 (if master page is corrupted and can't be recovered)

  1. Open SharePoint Designer
  2. Open your SharePoint Online site using the URL.
  3. Go to "Master Pages".
  4. Select the new master page.
  5. Click "Set as Default" or "Set as Custom" depending on which master page you want to change.

Option 2 (to undo edits in OOB master pages)

  1. Repeat steps 1 through 3 of the Option 1.
  2. Select the master page you are using.
  3. Click "Reset to Site Definition"

You can open the site in SharePoint Designer and set the master page from there

-Hope it helps

  • will powershell work for the cloud version of sp? - I thought this was only for on-prem Commented Jul 30, 2014 at 15:10
  • this is for on-prem version not for O365. Also he change the default master page.
    – Waqas Sarwar MVP
    Commented Jul 30, 2014 at 15:13
  • 1
    Sorry, didn't see it was for SPO. Edited my answer. There is also a third option that you can research here sharing-the-experience.blogspot.com.ar/2013/10/… Commented Jul 30, 2014 at 16:08

According to your Information, For now you can delete the site and recreate it. Reason is, because you change the default master page.

For Recommended way, Please make a copy of the Master Page and customize it. In case of the Di aster / corruption, simply change the change the master page back to default and your all data will be remain only customization will lose.

Another way is ask the O365 support team for restore of you site collection the day before corruption occurred.

  • Why the down vote? This is the only answer that addresses the problem that he edited the default master, instead of creating a copy to edit.
    – wjervis
    Commented Jul 30, 2014 at 18:35
  • may be somebody dont like me :)
    – Waqas Sarwar MVP
    Commented Jul 30, 2014 at 18:39

In my experience you can always get back to the Site Settings page even if you break your Master Page ({your site url}/_layouts/settings.aspx). Then if you have a publishing site, you should be able to click on the Master Page link under Look and Feel and then switch the master page to a different one that you haven't edited.

If you have a team site, this is a little harder, but you can also change the default Master Page using SharePoint Designer if you have access to that.

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.