Alexander's Blog

Sharing knowledge with the global IT community since November 1, 2004

Missing Save Site as Template Option in SharePoint 2013

/
/
ad-mania

If you are trying to save a site in SharePoint Server 2013 and you don’t see the option for “Save site as template” it is likely because the site has the publishing feature turned on. Back in November 2010 I wrote this article Missing Save Site as Template Option in SharePoint 2010. In that article I discussed two options to save a publishing site as a template. Well, I have some bad news, some good news, some bad news and finally some good news.

The Bad, the Good, the Bad, and the Good News

Bad News

Unfortunately, the trick (add _layouts/_savetmpl.aspx at the end of the site URL) worked in SharePoint 2010 but it doesn’t work in SharePoint 2013. That’s the bad news.

Good News

The good news is that there is a solution available in SharePoint 2013 which will enable the SharePoint 2010 trick to work in SharePoint 2013.

Bad News

The bad news is that Microsoft doesn’t support saving a publishing site as a template (see KB article 2492356). According to Microsoft “SharePoint does not support Save Site as Template option with the Publishing features turned on. The supported method to create templates for publishing sites is to use a site definition template and using a feature XML.” By the way the KB article 2492356 applies to MOSS 2007, SharePoint 2010 and SharePoint 2013.

Good News

The good news is that Microsoft has a supported workaround in another KB article 925189. Why didn’t they put the supported workaround in the KB article 2492356? That’s a good question and I don’t know the answer.

Here’s the problem and all the workarounds. Notice that I am not calling it a solution because all of these are workarounds for a known problem.

Problem

You are unable to save a publishing site as a template in SharePoint 2013.

WARNING! Do not deactivate publishing feature just to save the site as a template because you will be asking for trouble. The template that you create this way is likely to have lots of problems because the publishing sites have certain properties, and a special Pages library, all of which is likely to mess up the new site that you create with the template. This is true for all versions of SharePoint: MOSS 2007, SharePoint 2010, SharePoint 2013 and SharePoint Online.

Workarounds

There are at least three options that you can use to save a publishing site as a template. The first two workarounds are not officially supported by Microsoft, even though the first one is documented by a Microsoft employee in a Microsoft MSDN blog.

Option 1 (Not supported by Microsoft)

Use PowerShell to update the property called SaveSiteAsTemplateEnabled. Here’s the PowerShell script that will set the value of the property to true and allow you to use the _layouts/15/savetmpl.aspx at the end of the sit URL. Replace http:/www.contoso.com with your site’s URL in the following script.

  1. Run the following PowerShell script. I prefer to use PowerShell ISE (64-bit).
    $web = Get-SPWeb http://www.contoso.com/training
    $web.AllProperties[“SaveSiteAsTemplateEnabled”] = “true”
    $web.Update()
  2. Go to your site and use the following syntax to save the publishing site as a template.
    http://site/subsite/_layouts/15/savetmpl.aspx
    For example, http://www.contoso.com/training/_layouts/15/savetmpl.aspx, where training is a subsite of contoso.com.
  3. Keep in mind the option to save the site as a template will not be available in the GUI in the Site Settings -> Site Actions. You must use the above step #2 to save the site as a template.

Option 2 (Not supported by Microsoft)

If you are not familiar with PowerShell or prefer to use a different method then use SharePoint Designer 2013 to make the same change the property SaveSiteAsTemplateEnabled.

  1. Open the publishing site in SharePoint Designer 2013.
  2. Click the Site Settings icon on the ribbon.
    SiteOptions_in_SPD
  3. Modify the parameter SaveSiteAsTemplateEnabled from the default value of false to true.
    Set SaveSiteAsTemplateEnabled to true
  4. Click OK and close SharePoint Designer 2013.
  5. Go to the publishing site and in the URL add _layouts/15/savetmpl.aspx at the end of the site URL, as described in Option 1, Step #2 above.
  6. Keep in mind the option to save the site as a template will not be available in the GUI in the Site Settings -> Site Actions. You must use the above step #5 to save the site as a template.

Option 3 (Supported by Microsoft)

The following workaround is supported by Microsoft and is documented in the KB article 925189.

  1. Open the Feature.xml file of the Publishing feature in a text editor like Notepad. The file is located under C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\TEMPLATE\FEATURES\Publishing.
    For SharePoint 2010 the path is C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\FEATURES\Publishing
    For MOSS 2007 the path is C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\FEATURES\Publishing
  2. Add the following line to the Feature.xml file:
    <ElementManifest Location=”MyHideAction.xml”/>
    MyHideAction entry
  3. Use Notepad to create a new file in the same directory called MyHideAction.xml. Make sure that the file extension is XML and not TXT. Add the following content to the
    MyHideAction.xml file.
    <Elements xmlns=”http://schemas.microsoft.com/sharepoint/”>
     <HideCustomAction Id=”HideSaveAsTemplate” HideActionId=”SaveAsTemplate”
     GroupId=”Customization” Location=”Microsoft.SharePoint.SiteSettings” />”
    </Elements>MyHideAction XML file
  4. Save the file.

Copyright © 2015 SeattlePro Enterprises, LLC. All rights reserved.

  • Facebook
  • Twitter
  • Linkedin

2 Comments

  1. Thanks for this article. Is there any solution for SharePoint Online ?

Leave a Comment

Your email address will not be published. Required fields are marked *

This div height required for enabling the sticky sidebar