Create and use site templates

It’s a long topic. Click here to find it faster! How To button Fix It button Background button

After you have customized your SharePoint site so that it contains the libraries, lists, views, workflows, logos, and other elements that you require for your business, you may want to create a template of that site for reuse. A site template is like a blueprint for site. Creating a site template allows you to capture your customizations, so that they can be quickly applied to other SharePoint environments and even use the template as the basis for a business solution. Users can create new sites based on the template or you can hand it off for additional development in Visual Studio.

Site templates process flow

In this article


Understanding a site template

Before you work with a site template, it’s helpful to understand what a site template is in more detail so you can use it more effectively. This section discusses the following:

Top of Page Top of Page

What is a site template?

You're probably familiar with the default site templates, such as Team Site, Project Site, and Communities Site. SharePoint site templates are prebuilt definitions designed around a particular business need. You can use these templates as they are to create your own SharePoint site, and then customize the site as much as you want. For more information, see What kinds of sites can I create in SharePoint and Office 365?

In addition to these default site templates, you can also create your own site template based on a site you've created and customized. A custom site template is a way to package site features and customizations that you can add to a solutions gallery. Custom site templates are often used to deploy solutions in other sites or to provide site consistency within your organization. For example, you may have a standard policy on project management, and so you require the use of a custom project site template for all new projects.

A custom site template is a powerful feature that allows you to create a solution and then share that solution with your peers, the broader organization, or outside organizations. 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. Turning your customized site or business solution into a template is an extremely useful and very powerful capability. Once you start to package your solution as a template, you begin to realize the potential of SharePoint as a platform for business applications. Site templates make all of this possible.

Top of Page Top of Page

What gets saved in a site template?

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. This could be useful to provide sample content for users to get started with. But consider that including content could also increase the size of your template beyond the 50 MB site template limit.

Most of the features in a site are included and supported by the template. However, there are several features that are not supported.

  • Supported    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.
  • Unsupported    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.

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. Problems can arise when moving site templates from SharePoint Server on premise to SharePoint online. Certain features and content types may not even be available depending on the SKU and configuration.

 Note    Moving site templates between different versions, such as SharePoint 2010 to SharePoint 2013, is not supported.

Top of Page Top of Page

What can you do with a site template?

Saving a site as a template is a powerful feature because it offers so many uses of custom sites. Here are the immediate benefits you get from saving a site as a template:

  • Deploy solutions immediately    Save and activate the template in the solutions gallery and let other employees create new sites from this template. They can select it, and then create a new site from it, which will inherit the components of the site, its structure, workflows, and more. In short, just save the site as a template, activate it, and off you go.
  • Portability    In addition to deploying a custom solution in your environment, you can download the .wsp file, take it on the road, and deploy it in another SharePoint environment. All of your site customization is conveniently stored in one file.
  • Extensibility    As a Web Solution Package, you can open your customized site in Visual Studio, perform additional development customization to the template, and then deploy it to SharePoint. As a result, site development can go through a solution life cycle (develop, stage, and put into production).

As you begin to create custom sites in SharePoint, you'll discover even more benefits to turning your site into a solution that can be made portable across the organization.

Top of Page Top of Page

Work with a site template

The basic steps to working with a site template are as follows:

Top of Page Top of Page

Save a site template to the Solutions Gallery

When you save a site template, you create a Web Solution Package file (.wsp) is that is stored in the Solutions Gallery for further use.

  1. Navigate to the top-level site of your site collection.
  2. Click Settings SharePoint Online Public Website Settings button and then click Site Settings.
  3. In the Site Actions section, click Save site as a template.
  4. Specify a name to use for the template file in the File name box.
  5. Specify a name and description for the template in the Template name and Template description boxes.
  6. To include the content of the site in the site template, select the Include Content check box. The limit is 50 MB and cannot be changed.

     Important    Before creating a site template that includes content, check the workflow history list for the site. If there are thousands of items in the list, it may take a long time to create the site template or you may exceed the limit of 50 MB. In this case, it’s a good idea to modify the workflow association to a use new workflow history list and then delete the original workflow history list before creating the site template.

  7. Click OK to save the template.

If all of the components on the site are valid, the template is created, and you see a message that states "Operation Completed Successfully."

  1. Do one of the following:
  • To return to your site, click OK.
  • To go directly to the site template, click Solutions Gallery.

Top of Page Top of Page

Download the site template from the Solutions Gallery

When you download your site template, you create a .wsp file that is portable and easy to use in other site collections.

  1. Navigate to the top-level site of your site collection.
  2. Click Settings SharePoint Online Public Website Settings button and then click Site Settings.
  3. In the Web Designer Galleries section, click Solutions.
  4. If it's necessary to activate the solution, select it, and in the Commands group, click Activate. Then, on the Activate Solution Confirmation screen, in the Commands group, click Activate.
  5. Click its name in the solutions gallery, and click Save.
  6. In the Save As dialog box, browse to the location where you want to save the solution, click Save, and then click Close.

Top of Page Top of Page

Upload the site template to a Solutions Gallery

You can upload a .wsp file to the same site collection or different site collections in the same or different SharePoint environments.

  1. Navigate to the top-level site of your site collection.
  2. Click Settings SharePoint Online Public Website Settings button and then click Site Settings.
  3. In the Web Designer Galleries section, click Solutions.
  4. In the Commands group, click Upload, and then in the Add a Document dialog box, click Browse.
  5. In the Choose File to Upload dialog box, locate the file, select it, click Open, and then click OK.
  6. To activate the solution, on the Activate Solution confirmation screen, in the Commands group, click Activate.

Top of Page Top of Page

Create a site from the site template

After you create a site template and confirm it is activated, you can create a site based on the template. The next time that you create a site or subsite, the template is available for selection in the Custom tab of the Template Selection section on the New SharePoint Site page.

  1. Click Site Actions and then New Site.
  2. Click Browse All. Alternately, click Site Actions, View All Site Content, and click Create. You can filter the dialog by Site.
  3. Scroll to the bottom of all listed templates.
  4. Find and select your template.
  5. Enter a Title and a URL name for the new site in the right-hand panel of the screen.

 Note    Click the More Options button to expand the options you see in the Create dialog box by default. Along with setting specific navigation options, you can specify if the site inherits its permissions Groups from the parent site (Use same permissions as parent site) or not (Use unique permissions). If you choose the former, you will inherit the permissions Groups of the site collection in the hierarchy above the site you’re about to create. If you choose the latter, you will have new Groups without users and can assign unique permissions.

Top of Page Top of Page

Manage the Solutions Gallery

You can control when a site template appears in the Create dialog box or its resource usage by activating and deactivating site templates in the Solution Gallery.

  1. Navigate to your Solution Gallery.
  2. Click Settings SharePoint Online Public Website Settings button , Site Settings, and, then under the Galleries section, click Solutions.
  3. Select a site template, and then do one of the following:
  • Activate    Makes the site template available for use when users create new sites through the Create dialog.
  • Deactivate    Removes the site template from the Create dialog box. A deactivated site template is unavailable for site creation and can be deleted.
  • Delete    Removes the site template from the Solution Gallery, but moves it into to the Recycle Bin for 90 days by default before the Recycle bin is emptied. This is helpful if you later decide to restore it. If you need to delete a site template, you must deactivate it first.


 Notes 

  • It is important to monitor the growth of the Solutions Gallery. Each entry has a resource usage number assigned to it. Solutions can consume resources, and for that reason they may be temporarily disabled if resource usage exceeds quota.
  • If you upload a site template to a Solutions Gallery, and the original site template is currently deactivated, you can potentially overwrite the original site template. To avoid this, make sure to uniquely name the site template you are uploading. However, you will not be able to activate both solutions at the same time, and will need to deactivate the original if you wish to use the newly uploaded site template for site creation.

Top of Page Top of Page

Troubleshoot a custom site template

The following sections can help you resolve problems when you are working with a custom site template.

Top of Page Top of Page

Resolving common problems

The following sections describe common problems you may encounter when working with site templates and their recommended solutions.

The site template is based on a site type that is not available in the current business plan

The availability of site templates depends on the features set up by your administrator, whether you work with sites or site collections, and what plan you have for Office 365 or SharePoint Server 2013. The following table summarizes the site type availability between different plans.

CATEGORY SITE TYPE SITE COLLECTION SITE OFFICE 365 FOR BUSINESS (SMALL) OFFICE 365 FOR BUSINESS (MEDIUM, AND ENTERPRISE) SHAREPOINT SERVER 2013 SHAREPOINT FOUNDATION 2013
Collaboration Team Yes Yes Yes Yes Yes Yes
Collaboration Blog Yes Yes Yes Yes Yes Yes
Collaboration Project Yes Yes Yes Yes Yes No
Collaboration Community Yes Yes No Yes Yes No
Enterprise Document Center Yes Yes No Yes Yes No
Enterprise Records Center Yes Yes No Yes Yes No
Enterprise Business Intelligence (BI) Center Yes Yes No Yes Yes No
Enterprise Search Center (Enterprise or Basic) Yes Yes No Yes Yes No
Publishing Publishing No Yes No No Yes No
Publishing Publishing Site with Workflow No Yes No No Yes No
Publishing Enterprise Wiki Yes Yes No Yes Yes No

The site template was created in a previous version of SharePoint or in a different language

Moving site templates between different versions, such as SharePoint 2010 to SharePoint 2013, or different languages is not supported.

Unavailable features prevent site creation

You get an error message stating that certain features are not installed, activated, or licensed.

Error message

When the site template was created, all site features were saved with the template, regardless of whether they were activated or not. However, one or more of these site features are not activated or available in the current site collection. This situation can arise when you are moving site templates between different Office 365 plans or between SharePoint Server on premise and SharePoint online.

To help you resolve the situation, the error message usually contains the Feature Description and GUID. If the feature is available in the current site collection, you can activate it. If the feature is not available in the current site collection, you cannot use the site template to create a site.

For a list of SharePoint features and GUIDs, see Sharepoint 2013: Existing Features GUID. For a list of service descriptions based on Office 365 plans, see SharePoint Online Service Descriptions.

The site template cannot be created or does not work correctly

One or more of the following issues may be the cause:

  • Check to see if any lists or libraries exceed the List View Limit Threshold of 5000 items as this can block creation of a site template.
  • The site may be using too many resources and therefore the site template exceeds the 50 MB limit. You can see how much resources are being used in the Solutions Gallery where the site template was created. You may be able to reduce the site resources, and then save the site template again.
  • If you are saving content with the site template, you may need to clear the Include Content check box. Although you can increase the site template limit in SharePoint Server on premise by using a PowerShell command, this command is not available in SharePoint online. Be careful increasing the site template size in SharePoint Server on premise and moving it to SharePoint online as it can prevent its use. For more information about using site templates on SharePoint Server, see Save, download, and upload a SharePoint 2013 site as a template.
  • There are problems displaying data from a list that uses a lookup column. For more information, see Template-generated list doesn’t display data from the correct lookup list in SharePoint Online.

The Save site template command is not available

By default the Save site as template command is available whether or not the SharePoint Server Publishing Infrastructure feature is enabled at the site collection level. However, if you have activated the SharePoint Server Publishing feature at the site level, the Save site as template command may not be available. Saving a site template when the SharePoint Server Publishing Infrastructure feature is enabled at the site level is not supported and can cause problems when you attempt to create a site with the site template.

To make the Save site as template command available, deactivate the SharePoint Server Publishing feature at the site level.

If you still have problems making the Save site as template command available, the site option, SaveSiteAsTemplateEnabled, may have inadvertently been set to false. Do the following:

  1. Open the site in SharePoint Designer 2013.
  2. On the Site tab, in the Manage group, click Site Options.
  3. Click the Parameters tab, double-click SaveSiteAsTemplateEnabled, and in the Value box, enter True.
  4. Click OK twice.
  5. Go back to the browser, and then deactivate the SharePoint Server Publishing feature at the site level.

For more information, see Enable publishing features and About publishing-enabled site templates.

There are problems with site templates after upgrading from SharePoint Online 2010

If you have custom site templates that you want to continue to use after your subscription has been upgraded to SharePoint Online 2013, then you must recreate them before upgrading your site collection. Otherwise, all new site templates will not work after you upgrade. To recreate the site template, create a new subsite based on the 2013 experience, customize it again to match the template that you had, and then save the customized subsite as a template.

For the steps to recreate your custom site templates in SharePoint Online 2013, see Upgrade site templates. For more information on the upgrade process, see Upgrade a site collection to SharePoint Online 2013.

Top of Page Top of Page

Inspecting a Web Solution Package

Occasionally, you may need to dig deeper to unearth a problem with a site template. For example, you may have inherited the site template and do not know how it was created or what it contains.

Under the covers, a .wsp file is a cabinet file (CAB), which is a file that contains other files. This cab file contains a manifest file that defines elements in your site. If you are curious about the content, do the following:

  1. Copy the .wsp file.
  2. Rename the file extension from .wsp to .cab.
  3. Double-click the file, select all the files displayed, right-click the selection, click Extract, locate a folder in the Select a Destination dialog box, and then click Extract.

You can now see the Manifest.xml , the folders referenced in the Manifest.xml, and all required elements, schemas, resources and feature files used to recreate the site. If you chose to include the contents of the site when you created the site template, you can also see the content, such as document library files.

Wsps unzipped on the client desktop.

 Important    Do not unzip the original .cab, and alter the manifest, or the contents, of a .wsp. Creating sites from packages edited at this level can lead to instability in sites created from the template. However, .wsp files can be safely opened and edited in Microsoft Visual Studio in order to further customize the template.

 Note    The Web Solution Package you create in a site template is a partial trust user solution that has the same declarative format as a full trust SharePoint solution. However, it does not support the full extent of feature element types that are supported by full trust solutions.

Top of Page Top of Page

 
 
Applies to:
SharePoint Online Enterprise (E1), SharePoint Online Enterprise (E3 & E4), SharePoint Online Midsized Business, SharePoint Online Small Business