Determine which Site template was used to create a site collection

Received this question today from one of my colleagues and I knew that you could find out this information by accessing the dbo.Webs table in the Content Database of the site collection, but I was sure that there would be a better way to find this out. So I dug a little around the net and found a comment on a blog having a good solution:

This wa a comment posted by Rafelo (

You can determine the site definition / template used to create the site, via the WebTemplate and WebTemplateID properties of the SPWeb object (via the API). If you dont feel comfortable coding something or simply dont know how there is a fantastic tool from Carsten Keutman called SharePoint Manager which exposes most of the SharePoint API for you (download also here). It’s a desktop application that you run on one of the SharePoint servers on the farm. Alternatively you could save the following code as an aspx page to your layouts folder (\program files\common files\microsoft shared\web server extensions\12\template\layouts):


Code Snippet

<%@ Assembly Name=”Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c”%>
<%@ Page Language=”C#” MasterPageFile=”~/_layouts/application.master” Inherits=”Microsoft.SharePoint.WebControls.LayoutsPageBase” %>
<%@ Import Namespace=”Microsoft.SharePoint” %>

<script runat=”server”>
    protected override void OnLoad(EventArgs e){
                using (SPWeb thisWeb = this.Web)
                    lblWebTemplate.Text = thisWeb.WebTemplate;
                    lblWebTemplateID.Text = thisWeb.WebTemplateId.ToString();
<asp:Content ID=”Main” runat=”server” contentplaceholderid=”PlaceHolderMain” >
    Web Template: <asp:Label ID=”lblWebTemplate” runat=”server” />
    Web Template ID: <asp:Label ID=”lblWebTemplateID” runat=”server” />

<asp:Content ID=”PageTitle” runat=”server” contentplaceholderid=”PlaceHolderPageTitle” >
  Site Template Information

<asp:Content ID=”PageTitleInTitleArea” runat=”server” contentplaceholderid=”PlaceHolderPageTitleInTitleArea” >
  Site Template Information



Once you have saved the page, you can access it via http://yourwebaddress/yoursite/_layouts/pagename.aspx

The page should look something like this:

You can find a reference to these identifiers in one of my previous posts:

My advise to all of you now is to create this aspx page using notepad and save it to all your frontends. This way even your site collection admins can find out the template name. Another advise would be to include a table on this page with the reference to the identifiers as well.


Leave a Reply

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