Save site as template in SharePoint 2013/2016/Online

In this SharePoint customization tutorial, we will discuss Save site as template in SharePoint 2013/2016/Online. What are site templates in SharePoint? What are the things supported and not supported in site template in SharePoint 2013/2016? How we can save site as a template in SharePoint 2013? And how we can create a new SharePoint site by using the SharePoint site template?

This will be a very detailed step by step tutorial on how to work with save site as template in SharePoint 2013/2016/Online.

SharePoint Tutorial Contents

What are SharePoint Site Templates?

A SharePoint site template is like a blueprint for the site. SharePoint site templates are prebuilt definitions designed around a particular business need. There are default site templates like Team Site, Project Site, and Communities Site, publishing site, etc. but you can also create your own site template based on a site you’ve created and customized.

You can customize a SharePoint site, add libraries, lists, views, workflows, logos, and other elements that you require for your business, then Save the Site as a template and reuse the site template to create different sites.

Custom SharePoint site templates are often used to deploy solutions in other sites or to provide site consistency within your organization. You can also package the site into a Web Solution Package file (.wsp) and open it in another environment or application such as Visual Studio and further customize it there.

When you save a SharePoint site as a template, you’re saving the overall framework of the site, its lists and libraries, views and forms, and workflows. In addition to these components, you can also include the contents of the site in the template; for example, the documents stored in the document libraries or data in the lists in SharePoint.

What is Supported in SharePoint 2013 save site as template?

Below are the things which are supported when you Save SharePoint 2013/Online site as a template.

Lists, libraries, external lists, data source connections, list views and data views, custom forms, workflows, content types, custom actions, navigation, site pages, master pages, modules, and web templates.

What is Unsupported in SharePoint 2013 save site as template?

Below are the things which are unsupported when you Save SharePoint site as a template. These things will not come along with the template.

Customized permissions, running workflow instances, list item version history, workflow tasks associated with running workflows, people or group field values, taxonomy field values, publishing sites and pages, and stapled features.

Site definition vs Site template in SharePoint

Let us discuss on, site definition vs site template in SharePoint 2013/2010.  We will see major differences between site definition and site template in SharePoint 2013/2010.

To know about the difference between site definition and site template, we need to understand what is site definition and what is site template in SharePoint 2013/2010.

Site definition vs site template in SharePoint 2013/2010

A site definition defines a unique SharePoint site. Site definition is a combination of multiple files like .xml, .aspx, .ascx, and .master page, .gif , .doc etc and are stored in C:\ProgramFiles\Common Files\Microsoft Shared\web server extensions\14\TEMPLATE\SiteTemplates directory.

But Site Templates are created from an existing site and are stored in the Content database in the Sandboxed Solution gallery.

According to MSDN, Here are some advantages and disadvantages of Site Definition and Site template.

Advantages of Site Definitions in SharePoint

Below are few advantages of site definitions in SharePoint 2013/2010.

  • Data is stored directly on the Web servers, so performance is typically better.
  • A higher level of list customization is possible through direct editing of a SCHEMA.XML file.
  • Certain kinds of customization to sites or lists require the use of site definitions, such as introducing new file types, defining view styles, or modifying the drop-down Edit menu.

Disadvantages of Site Definitions in SharePoint

Below are a few disadvantages of site definitions in SharePoint 2013/2010.

  • Customization of site definition requires more effort than creating custom templates.
  • It is difficult to edit a site definition after it has been deployed.
  • Doing anything other than adding code can break existing sites.
  • Users cannot apply a SharePoint theme through a site definition.
  • Users cannot create two lists of the same type with different default content.
  • Customizing site definitions requires access to the file system of the front-end Web server.

Advantages of Site Templates in SharePoint

Below are few advantages of site templates in SharePoint 2013/2010.

  • Custom templates are easy to create.
  • Almost anything that can be done in the user interface can be preserved in the template.
  • Custom templates can be modified without affecting existing sites that have been created from the templates.
  • Custom templates are easy to deploy.

Disadvantages of Site Template in SharePoint

Below are few disadvantages of site templates in SharePoint 2013/2010.

  • Custom templates are not created in a development environment.
  • They are less efficient in large-scale environments.
  • If the site definition on which the custom template is based does not exist on the front-end server or servers, the custom template will not work.

Another difference is Feature Stapling is supported by Site Definitions but it is not supported by Site Template.

How save site as template works in SharePoint online/2013/2016?

When you create a site template, information about site features and content types is also saved. When you use the site template in a different site collection, those features must be available and activated for the site template to work.

The size of the template should not beyond 50 MB site template limit.

When you Save a list as a template it will save as a .wsp file will store it in the site collection’s Solution Gallery. After it saved it can be used to create subsites within that same site collection. If you want to use the site template to create sites in a different site collection, you can browse to the Solution Gallery and download the solution. You can then upload the solution to a different site to make the site template available there.

The Save Site As Template functionality uses the web template technique behind the scenes. It generates an ONET.xml file and an elements.xml file containing a WebTemplateelement. When a site is saved as a template, SharePoint has to make sure that everything that was available in the original site is also available in a new site that is created by using the site template. To ensure this, SharePoint packages all the features, site columns, content types, property bag values, and much more from the original site into the site template.

They can only be used on sites that don’t have the publishing features enabled. Activating the publishing features on a site will make the Save Site As Template link disappears from the site settings page. But you can access it from URL which is not recommended form Microsoft. This can sometimes cause major issues.

Save site as template in SharePoint 2013/2016/Online

There is no difference between creating a Site template in SharePoint 2013, SharePoint 2016, and SharePoint Online. To create a site template, open your SharePoint 2016/2013 site, click on the gear icon, and then click on Site settings like below:

sharepoint 2013 save site as template
SharePoint 2013/2016 save site as template

In the Site Settings page click on “Save site as template” which is under the Site Actions section.

Save Site As Template SharePoint 2013
Save Site As Template SharePoint 2013

Then it will open the Save as Template page, Give a file name, template name, description as well as if you want to include the content, check the checkbox “include content” as shown in the fig below:

Save site as template in SharePoint 2013
Save site as template in SharePoint 2013

Once the operation completed successfully, it will display a successful message. The template will be saved in the solution gallery of the site collection.

save site as template sharepoint online
save site as template SharePoint online

Now if you will visit the solution gallery you can see the template must be saved and activated there. It will display like below: (To visit the solution gallery from the site settings page click on Solutions which is under Web Designer Galleries)

how to Save Site As Template in SharePoint 2013/2016
how to Save Site As Template in SharePoint 2013/2016

Create Sub Site using SharePoint Custom Site Template

Once we save the SharePoint site as a template, we can create a site or subsite using the custom SharePoint template.

Now if you will go to the Site Contents page of SharePoint 2013/2016/Online site and try to create a new subsite you can see the template appears under the Custom tab.

steps to Save Site As Template in SharePoint 2016
steps to Save Site As Template in SharePoint 2016

Once you create the site using the template, the new site will be created based on the same template. As you can see in the example, the new site has the logo which was there in the template as well as one Employee list is also there which was there in the existing template. The new site looks like below:

save site as template sharepoint 2016
save site as template SharePoint 2016

Upload Site Template to Other Site Collection in SharePoint 2013/2016/Online

As we have discussed the site template will be available to that SharePoint site collection only. If you will check in any other site collection then the template will not available. Here it is how looks in another site collection.

Save Site As Template in SharePoint 2016
Save Site As Template in SharePoint 2016

So first go to the source site collection and then from site settings page click on Solutions to open the Solution Gallery. There click on the solution file which will ask you to Save the file in local drive. Save the file.

Now come back to the SharePoint site collection where you want to upload the solution, your destination site collection. Click on the gear icon and then the Site Settings link. In the Site Settings page click on Solutions which is under “Web Designer Galleries“.

In the Solution Gallery, click on the Upload Solution button to upload the solution which we have saved in our local drive.

Save site as template in SharePoint 2013
Save site as template in SharePoint 2013
save site as template sharepoint online
save site as template SharePoint online

Then browse the file and click on OK. It will add the solution and it will ask you to activate the solution. Click on the Activate button to activate the solution like below:

sharepoint 2013 save site as template
sharepoint 2013 save site as template

Once it is activated in the Solution Gallery like below the template will be available in the site collection to use.

save site as template sharepoint online
save site as template sharepoint online

Now go to Site Contents page and try to create a new subsite, in the templates you can see the site template will appear like below:

Save Site As Template in SharePoint 2013/2016/Online
Save Site As Template in SharePoint 2013/2016/Online

SharePoint 2013 save site as template url

We can also directly access the SharePoint 2013 save site template url. Suppose you are trying to save site as a template in SharePoint 2013/2016/Online, then you will not see the “Save site as template” option in SharePoint site settings page. But you can directly access SharePoint 2013 save site as template url:

<You SharePoint Site URL>/_layouts/savetmpl.aspx
or
<You SharePoint Site URL>/_layouts/15/savetmpl.aspx

[Fixed] Save site as template SharePoint online missing

Let us see how to fix the error save site as a template or save the list as template missing issue in SharePoint Online Office 365. Sometimes if you will go to the Site Settings page, you do not see the Save Site as template option, similarly, if you will go to any list or library you also will not find the Save list as a template also in your SharePoint Online site.

We will discuss how to enable Save site as template option in SharePoint Online Office 365.

In those case, you can check out a few things:

  • If it is a publishing site or publishing feature has been activated in a site, then you will not get those opens in the settings pages. If SharePoint Server Publishing feature is enabled, it disables the ability to save the site as a template.
  • In the other case if it is a team site in your SharePoint online then you can follow the below step which will solve the issue (in my case it did).

Go to your SharePoint Online Admin center and then click on settings link like below:

save site as template sharepoint online missing solution
save site as template sharepoint online missing solution

Then navigate to Custom Script section, and there enable below things:

  • Allow users to run a custom script on personal sites
  • Allow users to run a custom script on self-service created sites
save site as template sharepoint online missing solution
save site as template SharePoint online missing solution

Then wait for 24 hours, this is really really important. After that, you can see Save site as template option.

save site as template sharepoint online missing solution
save site as template SharePoint online missing solution

SharePoint online enable save site as template using PowerShell

This SharePoint Online tutorial explains how to enable Save site as template option in a publishing site in SharePoint Online Office 365 using PowerShell.

We have observed save site as template option doesn’t show in publishing sites in SharePoint Online or SharePoint 2013/2016. If you try to navigate to save the site template page it will further show you below error message.

The “Save site as template” action is not supported on this site.

Enable Save Site as Template option in Publishing Site in SharePoint

Enable Save Site as Template using PowerShell in Publishing Site in SharePoint Online

Let’s talk about the solution. We can write CSOM with PowerShell script to enable the site settings. If you are new to PowerShell SharePoint.

Please find below the script and execute it against the site.

cls
$0 = $MyInvocation.MyCommand.Definition
$dp0 = [System.IO.Path]::GetDirectoryName($0)
$username = "[email protected]***.com"
$password = "*****"
#$url = $xmldata.WebSite.Url
$url =’https://****.sharepoint.com/sites/test/’
$securePassword = ConvertTo-SecureString $password -AsPlainText -Force
# connect/authenticate to SharePoint Online and get ClientContext object..
$clientContext = New-Object Microsoft.SharePoint.Client.ClientContext($url)
$credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $securePassword)
$clientContext.Credentials = $credentials

Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll"
Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Publishing.dll"
Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Taxonomy.dll"
if (!$clientContext.ServerObjectIsNull.Value)
{
Write-Host "Connected to SharePoint Online site: ‘$Url'" -ForegroundColor Green
$web = $clientContext.Web
$clientContext.Load($web)
$web.AllProperties["SaveSiteAsTemplateEnabled"] = "true"
$web.Update()
$clientContext.ExecuteQuery()
}

In this way we can enable save site as template in SharePoint online using PowerShell.

Enable blank site template SharePoint 2013

Now. let us see how to bring back the Blank site template in SharePoint 2013/2016/2019. Then we will see how to create a site using a blank site template in SharePoint 2013.

Microsoft has hidden the blank site template from the template list while creating SharePoint site collection.

If you open SharePoint 2013 central administration and click on “Create site collection” under Application Management, by default you will not be able to see the “Blank Site” template under the Collaboration category.

sharepoint 2013 blank site template missing
SharePoint 2013 blank site template missing

Bring Back Blank Site Template in SharePoint 2013/2016/2019

– First, go to the below folder:
F:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\TEMPLATE\1033\XML

Here I am choosing F drive because I have installed SharePoint in my F drive.

Then in this folder open WEBTEMP.xml file. And look for the below tag:

<Configuration ID="1" Title="Blank Site" Hidden="TRUE" ImageUrl="/_layouts/15/images/stbs.png?rev=23" Description="A blank site for you to customize based on your requirements." DisplayCategory="Collaboration" AllowGlobalFeatureAssociations="False" > </Configuration>

Here you can see attribute Hidden=”TRUE”, make this to false Hidden=”FALSE” and the whole tag look like below:

<Configuration ID="1" Title="Blank Site" Hidden="FALSE" ImageUrl="/_layouts/15/images/stbs.png?rev=23" Description="A blank site for you to customize based on your requirements." DisplayCategory="Collaboration" AllowGlobalFeatureAssociations="False" > </Configuration>

Save the file and do an IISRESET.

Now if you will check you will be able to see the template.

blank site template sharepoint online
blank site template SharePoint online

Create Site Collection using Blank site template using PowerShell in SharePoint 2013/2016

Maybe sometimes we will not have access to change in the web template file, in that case, we can use the PowerShell command to create the site collection using a blank site template.

Below is the PowerShell command which you can run in Windows PowerShell ISE.

You can also read: Working with PowerShell in SharePoint Online/2016/2013.

Add-PSSnapin "Microsoft.SharePoint.PowerShell"
Get-SPWebTemplate
$template = Get-SPWebTemplate "STS#1"
New-SPSite -Url "http://win-pfcp2dgt8di/sites/MySiteFromPowerShell" -OwnerAlias "EnjoySharePoint\Administrator" -Template $template

After this now if you will open the site collection it will be opened like below:

blank site template id sharepoint 2013
blank site template id SharePoint 2013

Hopefully, this will be helpful to enable blank site template in SharePoint 2013/2016/2019. Also, we saw how we can create a site collection using the blank site template in SharePoint 2013/2016/2019 using PowerShell.

SharePoint 2013 Missing Blank Site Template

In SharePoint 2013, Blank site template is missing, and we can not create a blank site in SharePoint 2013. But there are different ways we can enable blank site template in SharePoint 2013/2016/2019. We can enable blank site template using PowerShell as well by modifying in the WEBTEMP.XML file.

In SharePoint 2010 when we want to create a blank Site/subsite it is possible to choose blank site templates. But in SharePoint 2013 blank site template is not displayed in the selection the blank site template is not visible in SharePoint, because its “Hidden” property is set to true, there is two ways configuration to be made to make blank site template to be available for selection.

Below are the two ways we can enable blank site template in SharePoint 2013:

  • PowerShell
  • Modifying Server Files

Enable Blank Site Template in SharePoint 2013/2016/2019

Here we will see how can we enable blank site template in SharePoint 2013 by modifying in the WEBTEMP.XML file.

Browse to: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\TEMPLATE\1033\XML* Edit file: WEBTEMP.XML

  • Locate this line of code: <Configuration ID=”1″ Title=”Blank Site” Hidden=”TRUE”
  • Change Hidden=”TRUE” to Hidden=”FALSE”

If you open SharePoint 2013 central administration and click on “Create site collection” under Application Management, by default you will not be able to see “Blank Site” template under the Collaboration category.

blank site template sharepoint 2010
blank site template missing in SharePoint 2013

Enable Blank Site Template in SharePoint using PowerShell

There are two ways we can enable blank site template in SharePoint 2013/2016/2019.

1. Run the command Get-SPWebTemplate to get the full list of the available templates. You can see, the Blank Site template is still there, and it’s ID is STS#1:

blank site template sharepoint 2013
blank site template SharePoint 2013

The complete script would be:

$s = Get-SPSite "<URL of your Site Collection>"

$template = Get-SPWebTemplate "STS#1"

New-SPSite -Url $s -OwnerAlias "<domain\user>" -Template $template

Enable Blank Site Template in SharePoint 2013 Modifying WEBTEMP.XML File

The easiest way to permanently add blank site template is through the server files.
“C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\TEMPLATE\1033\XML\WEBTEMP.XML”

<Configuration ID="1" Title="Blank Site" Hidden="TRUE" ImageUrl="/_layouts/15/images/stbs.png?rev=23" Description="A blank site for you to customize based on your requirements." DisplayCategory="Collaboration" AllowGlobalFeatureAssociations="False" > </Configuration>

Change the highlighted tag the Hidden=true to false and you’re good to go.

blank site template sharepoint 2016
blank site template sharepoint 2016

Now you can see “Blank Site” template option under Collaboration tab like above.

This is how to enable blank site template in SharePoint.

Activate Group Work Site Template in SharePoint 2013

Now. let us see what is a group work site template in SharePoint? How to activate the Group Work Site Template in SharePoint 2013?

Microsoft has removed group work site template in SharePoint 2013 version.

What is Group Work Site Template in SharePoint?

This Group Work site template provides a groupware solution that teams can use to create, organize, and share information. The Group Work site template includes the Group Calendar, Circulation, Phone-Call Memo, document library, and other basic lists.

Overall this is a very useful template in SharePoint 2010.

But the bad news is Microsoft removed the Group Work Site template in SharePoint 2013.

The reason behind this is The Group Work site template was not a widely used site template. The Group Work site template was removed from SharePoint 2013 to simplify the list of templates that are available when a user creates a new site collection.

But it will support the migration, Existing sites that were created by using the Group Work site template will continue to operate in SharePoint 2013.

Activate Group Work Site Template in SharePoint 2013

But If you want to include that template in SharePoint 2013, then Go to C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\TEMPLATE\1033\XML, open WEBTEMP.XML file, find an element with ‘Group Work Site’ title attribute and change its Hidden attribute from FALSE to TRUE.

Sorry this site can not be saved as a template. It contains apps that do not work in templates

Now. let us see how to fix the error, Sorry this site can not be saved as a template. It contains apps that do not work in templates. The error comes while trying to Save Site as Template in SharePoint 2016. Recently when I was trying to save the site a template I got the below error:

Sorry, something went wrong.

Sorry, this site can’t be saved as a template. It contains apps that don’t work in templates: <App name>

Sorry this site can not be saved as a template
Sorry this site can not be saved as a template

The error was coming while trying to Save site as a template in SharePoint 2013/2016, because there were two SharePoint hosted add-ins or apps are deployed to the SharePoint site. This issue actually comes when you have apps, that can not be saved as a part of the site template.

For a workaround, you can remove the apps or add-in from the site collection and then save the site as a template.

Once you have Saved the template, after that you can re-add the apps to the site in SharePoint 2013/2016.

Sorry this site hasn’t been shared with you while save list as a template in SharePoint

Let us see how to fix the error, “Sorry this site hasn’t been shared with you” which appears while Saving a list as a template in SharePoint 2013/2016.

Recently when I am trying to save the list as a template in one of the site by going to List Settings -> under Permissions and Management when I click on Save list as a template, I got the error as “Sorry this site hasn’t been shared with you”. You can follow this article to create a list template in SharePoint 2013.

Just to let you know I have full control permission in that site, but still, I am getting the error as: Sorry this site hasn’t been shared with you while save list as a template in SharePoint.

The reason is that when you save the list as a template, the template (.stp) will be saved in the list template gallery of the top-level site, not in the child site. So you should have Design permission for the top level site.

If your site administrator does not want to give you full design permission then, they should create a different permission level and assign that to the list template gallery, then you should not get the issue while saving the list as a template.

You may like following SharePoint customization tutorials:

Conclusion

In this SharePoint tutorial, I have explained how to work with SharePoint 2013 save site as a template? How can we save site as template in SharePoint 2013/2016/Online?

Also, I have explained how we can create a site or subsite using SharePoint 2013 custom site template? How we can use the SharePoint site template in another SharePoint site collection?

What are the things which are supported in site template and not supported in SharePoint 2013/2016/Online site template?

We also saw SharePoint 2013 save site as template URL. The URL is same for SharePoint 2016 or SharePoint Online.

We discussed about the below topics:

  • What are SharePoint Site Templates?
  • What is Supported in SharePoint 2013 save site as template?
  • What is Unsupported in SharePoint 2013 save site as template?
  • Site definition vs Site template in SharePoint
  • How save site as template works in SharePoint online/2013/2016?
  • Save site as template in SharePoint 2013/2016/Online
  • Create Sub Site using SharePoint Custom Site Template
  • Upload Site Template to Other Site Collection in SharePoint 2013/2016/Online
  • SharePoint 2013 save site as template url
  • [Fixed] Save site as template SharePoint online missing
  • SharePoint online enable save site as template using PowerShell
  • Enable blank site template SharePoint 2013
  • Create Site Collection using Blank site template using PowerShell in SharePoint 2013/2016
  • SharePoint 2013 Missing Blank Site Template
  • Enable Blank Site Template in SharePoint 2013/2016/2019
  • Activate Group Work Site Template in SharePoint 2013
  • Sorry this site can not be saved as a template. It contains apps that do not work in templates
  • Sorry this site hasn’t been shared with you while save list as a template in SharePoint
Donwload Hub site pdf

Download SharePoint Online Tutorial PDF FREE!

Get update on Webinars, video tutorials, training courses etc.

  • >