2

You can get a site template in SharePoint Online by going to site settings and clicking save as template (it will be stored in the solution gallery).

I have seen articles on how to create custom web templates, but is there a way to generate them for a web that already exists?

Forgive me if this is a silly question. I am still reading up on web templates.

3
  • Users create web templates on the Save as Template page (or through code that uses the SaveAsTemplate method of the Microsoft.SharePoint.SPWeb class). Source. Let me know if it helps you. Commented Jul 8, 2020 at 4:32
  • Unfortunately, the SaveAsTemplate method is not available in SharePoint Online.
    – spDevAdmin
    Commented Jul 8, 2020 at 4:40
  • Yes. In SharePoint Online, you can use Get-PnPProvisioningTemplate using PnP PowerShell. Commented Jul 8, 2020 at 4:45

1 Answer 1

2

A web template is persisted in the SharePoint database as a Microsoft SharePoint Foundation Solution, which is a file that has a .wsp extension. The .wsp file is stored in the Solutions Gallery of the site collection. The solution can also be deployed as a sandboxed solution.

Users create web templates on the Save as Template page (or through code that uses the SaveAsTemplate method of the Microsoft.SharePoint.SPWeb class).

Source: Web Templates

Issue: Unfortunately, the SaveAsTemplate method is not available in SharePoint Online.

Solution:

In SharePoint Online, you can use Get-PnPProvisioningTemplate using PnP PowerShell to generate a provisioning site template from a web.

References:

  1. Get-PnPProvisioningTemplate
  2. Introducing the PnP provisioning engine
1

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.