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.

About the Author

Adnan Zameer, Lead Developer at Optimizley UK, is a certified Microsoft professional, specializing in web app architecture. His expertise includes Optimizley CMS and Azure, showcasing proficiency in crafting robust and efficient solutions.

0 comments :

Post a Comment