Tags: Modules Optimizely/Episerver SQL

List number of pages per pagetype in Optimizely CMS

Using this SQL addon, or any other SQL client, you may list the number of pages per page type in your Optimizely CMS solution like this.

SELECT ct.Name AS ContentType, COUNT(c.pkID) AS ContentCount
FROM tblContentType ct
LEFT JOIN tblContent c ON ct.pkID = c.fkContentTypeID
WHERE ct.ContentType = 0
GROUP BY ct.Name
ORDER BY ContentCount DESC

And you'll get the result sorted from the page type with most instances to the page type with the least intances.

A list of page types

To query different content types, change the ContentType value in line 4 as follows:

Happy querying!