How to find SharePoint 2013 Site Template ID

So you have a custom site template and you want to be able to programmatically create a subsite? I’m sure there is already somewhere someplace that has already blogged about how you can source this site template ID but I couldn’t find it so here I am passing on my findings.

Saving your site as a Site Template.

First of all Navigate to the Site you would like to reuse as a template, go to ‘Site Settings’ and click save site as template.

Fill out your details for the new site template & you have the option to include all the content of the site (example: all documents in a document library)

Click ‘OK’ & your site has been saved as a template, now we need to find the unique ID that belongs to the site collection.

Finding the ID for the Site Template to reuse

For this step I prefer to use Google Chrome as you can find the Template ID quite easily –

Navigate to create a single sub site with your template the url should be something like /_layouts/15/newsbweb.aspx

On prem) http://yourspserver/_layouts15/newsbweb.aspx

SPO) https://tenantname.sharepoint.com/_layouts/15/newsbweb.aspx

When you navigate to this url you will see the section to select a template:

Now as this is open in google chrome right click on your template and click ‘Inspect Element’

You will need to expand the following code which will be highlighted as we are inspecting it’s element.

Once you have expanded the code you will receive the ID associated to the template.

So in my case ‘TestTemplate’ ID is “{6E9A9064-9174-4BEC-9A95-FEF99F7D1CFC}#TestTemplate

Keep in mind you must use the entire id including the name of the template itself.

Walla you now have the template ID! You can now start deploying sites with the template programmatically.

In my next blog post I’ll be demonstrating how to use deploy subsites with a site template using Client Object Model & SharePoint Online

Advertisements

3 thoughts on “SharePoint 2013 find site template ID

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s