How do you tell if a page is customized/ghosted in SharePoint 2007? Can I use SharePoint designer? I know that customized pages have an "i" icon next to them. However, what about page layouts in the masterpage gallery? I don't see an "i" next to the page layout, even after I customized it.

Is there a sql query I can run to determine this for sure?

3 Answers 3


I don't know about a SQL query, however you can use the following code block to test if a page is customized.

SPFile spFile = web.GetFile("_catalogs/masterpage/filename.aspx");
if (spFile != null && spFile.CustomizedPageStatus == SPCustomizedPageStatus.Customized)
  • i've seen RevertContentStream() throw exceptions, for example for publishing pages, so you might want to consider trapping that or your code will break. Oh and thats only if you uncomment the line ;-) Dec 14, 2010 at 22:11
  • Indeed. this block is part of a larger tast that does have relevant exception management. Dec 15, 2010 at 0:54

Doing a select against the content DB is a grey area in terms of supportability of your environment I think - some say that merely querying the content DB for information is ok provided you don't modify anything, other's (rightly*) say that circumventing all the security in place renders your environment completely unsupportable.


  • = my own opinion :)

For page layouts for SP2007 i can recommend using Gary Lapointe's reghost stsadm extensions. That is if your employer accepts reflection code on production environments.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.