Thursday, 11 September 2014

Get Usage report of EPiServer Page Types & Block Types

Are you are working with a large project build in Episerver? Over the years developers create new page & block types in the system. Editors then create content using new content types and stopped using the old ones. That resulted in piling up a long list of page types, and some of them were not in use.

It is always nice to clean up the mess once in a while that has been created over the years in Episerver project. So if you are feeling that there are a lot of page types in your EpiServer project and some of them might not be in use remember that there is the solution.

Run the following query in SQL Server and result will be Page types names, filenames, and page count against it.

SELECT 
  pt.Name, 
  pt.Filename, 
  COUNT(p.pkID) AS PageCount
FROM 
  tblPage AS p RIGHT OUTER JOIN
  tblPageType AS pt ON p.fkPageTypeID = pt.pkID
GROUP BY 
  pt.Name, pt.Filename
ORDER BY 
 PageCount desc

Before you run this query, remember to empty your recycle bin.

0 comments :

Post a comment