Problem Statement:
How can we effectively assess whether the components and templates within our project structure are actively used on web pages? This knowledge is crucial for making informed decisions regarding component and template maintenance.
Introduction:
When organizations undertake AEM upgrades or migrations, they often introduce new components and templates following revised project structures or archetypes. The entire team usually dedicates itself to developing these components and templates according to Adobe’s recommendations and delivers the project. However, what about the essential cleanup task of removing unused or unreferenced components and templates?
To address this challenge, I have developed a new tool known as the “Component and Template Auditor,” which is available for download or cloning from a Git repository.
After cloning the repository and installing the package into your local environment, you can access the tool.
Within the tool section, navigate to “AEM Operations”
Select the “Component and Template Auditor” tool.

Once the tool is open, you can input the project path and search path as illustrated below:

If you have multiple search paths, you can enter them on separate lines, eliminating the need for comma separation.
Click on “Start Auditing” to generate the results, and you can search for component names or count to identify components with zero references (indicating that they are unused), as shown below:


This information enables you to make informed decisions about whether to retain or remove the component or template.
Note:
- In order to enhance search functionality, the query builder limit has been configured to 5. Consequently, you might observe a maximum of 5 results; however, the actual results might be more than what is displayed.
- Please specify search paths as comprehensively as possible to optimize performance.
- Run the tool in the most minimal environment available or during off-business hours.
