SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 3 down vote accepted

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)
share|improve this answer
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 ;-) – Anders Rask Dec 14 '10 at 22:11
Indeed. this block is part of a larger tast that does have relevant exception management. – Clayton Firth Dec 15 '10 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 :)
share|improve this answer

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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