In this article http://blog.falchionconsulting.com/index.php/2007/08/fix-publishing-pages-page-layout-url/ Gary talks about fixing publishing page when sub-site is restored to a site collection.

Can anyone please tell me how to use that code? Do I need to create a console app with that code and then use it that way?

1 Answer 1


You need to install the right version of his addons for your environment. Once there, it is literally as simple as opening the SharePoint console / command line and running fixpublishingpagespagelayouturl command that he details on the page you linked.

I've used his addons on several farms to resolve a few of the more obscure quirks that SharePoint seems to have and they have always worked well.

Of course, you could also just take his code and create your own command-line utility to do basically the same thing. Which path you choose depends more on the restrictions on your environment as some places get nervous when you start asking them to install Third-Party tools.

  • Thanks Dave. I gotta go to a long meeting so marking resolved. Will test it out later. Can you tell me how to fix the similar error when i go to /_Layouts/AreaTemplateSettings.aspx. I have no idea which page layout it's using. Commented Aug 27, 2013 at 16:28
  • That is a system page and does not use a page layout. It does use a master page so your issue might be in whatever master page is configured to be used by system pages. You can check this in Settings - Look and Feel - Master Page. I have seen situations where the master page becomes 'stuck' and in order to fix it, you have to change it to something else, push it down, then change it back and push it down again.
    – Dave Wise
    Commented Aug 27, 2013 at 17:05
  • I just installed Gary's WSP and ran stsadm -o gl-repairsitecollectionimportedfromsubsite -sourceurl "sourceurl" -targeturl "newsitecoll" and it did the magic. Thanks Dave for all the info. Commented Aug 27, 2013 at 17:18

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.