AEM - Possible to Add Meta Tags to Pages in Bulk | Adobe Higher Education
Skip to main content
Level 3
March 31, 2022
해결됨

AEM - Possible to Add Meta Tags to Pages in Bulk

  • March 31, 2022
  • 3 답변들
  • 3083 조회

Hello,

 

We have a need to add meta tags in bulk to many of our pages in AEM (normally adding through Page Properties -> Meta Tag). I was wondering if there is a way to automate this/do it in bulk, either through cURL or other means?

Thanks,

Kelly

이 주제는 답변이 닫혔습니다.

3 답변

Varun_Shakya
Community Advisor
Community Advisor
March 31, 2022

check  this groovy script point #2

 ref:- https://labs.tadigital.com/index.php/2018/12/18/groovy-script-in-aem/

 

 
 
 
 
 
Java
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
def path = "/content/we-retail/us/en/user/account/order-history";
def propName = "testPropName";
def propValue = "testPropValue";
 
getPage(path).recurse { page \->
    def jcrContentNode = page.node;
    if (jcrContentNode.hasProperty(propName)) {
        def oldPropValue = jcrContentNode.getProperty(propName).getString();
        if(!oldPropValue.equals(propValue)) {
            jcrContentNode.setProperty(propName, propValue);
        }
    } else {
        jcrContentNode.setProperty(propName, propValue);
    }
}
 
save();
KMarchewa작성자
Level 3
March 31, 2022

Thanks much for the quick response. Unfortunately, I cannot install the Groovy Console package in AEM. Is there a good alternative that does not require in new packages in AEM itself?

Thanks!

lukasz-m
Community Advisor
lukasz-mCommunity Advisor답변
Community Advisor
March 31, 2022
Anmol_Bhardwaj
Community Advisor
Community Advisor
March 31, 2022

You can write the same code @varun_shakya mentioned in a servlet and push it through the code.