AEM Sites: Page move fails due to template policy restrictions

This article explains how to resolve issues where moving a page in Adobe Experience Manager (AEM) Sites fails due to template policy restrictions, resulting in the page URL not being updated.

Description description

When attempting to move a page in AEM Sites to change its URL or location, the operation fails if the source page’s template isn’t allowed under the destination path according to template policies. In this scenario, the page title can update, but the URL remains unchanged because the move operation doesn’t complete successfully. The AEM error logs show a message indicating that the template isn’t allowed below the destination path. This typically occurs due to the cq:allowedTemplates property set on the destination or its parent, which restricts which templates can be used under that path.

Environment

Adobe Experience Manager (AEM) Sites (all versions)

Symptoms

  • Attempting to move a page results in the URL not being updated.
  • The page title can change, but the page remains at its original URL.
  • Error logs contain messages about the template not being allowed under the destination path.

Cause

The move operation fails because the source page’s template isn’t permitted under the destination path due to cq:allowedTemplates restrictions. The validation fails before the page path can be changed, so the URL remains unchanged. The page title and URL name are separate properties; the URL only changes if the move or rename completes successfully.

Resolution resolution

Follow the steps below to resolve the issue:

  1. Review the template policies applied to the destination path.

  2. Check the cq:allowedTemplates property to confirm whether the source page’s template is included in the allowed templates for the destination location.

  3. If the template isn’t allowed:

    a. Update the template policy to include the required template path.

    b. Test any policy changes in a lower environment before deploying to Production to ensure there are no unintended impacts.

    c. Deploy the updated policy through your standard code or configuration deployment process.

  4. If the destination page already exists and is correct, migrate or merge content from the source page, as needed. Don’t retry the move to the same destination without addressing the template policy or the existing page.

  5. If the source page must become the canonical page, handle the existing destination page according to your content management process before retrying the move.

  6. If updating the template policy isn’t possible, recreate the page using an approved template for the destination path.

  7. After making the necessary changes, retry the move operation, and verify that the page URL updates as expected.

recommendation-more-help
experience-cloud-kcs-help-kbarticles