Expand my Community achievements bar.

SOLVED

How to add meta robots tags for dynamically generated pages or filter driven webpages on AEM

Avatar

Level 2

Hey just need help on the process to add meta robots "noindex" tag in the <head> section for webpages that are dynamically generated on selecting filters. So this should allow me to block them from showing up insearch results

I could not use robots.txt method as these pages are used as inlinks

Iam also looking out for suggestions to place canonical pointing to master page on these dynamic pages.

Please do let me know with relevant steps to solve this issue

Thanks

Raghavarao

3 Accepted Solutions

Avatar

Correct answer by
Level 2

Hey Avinash,

Thanks for help ,

but had a concern,

can you please let me know if will be able to access this setup for dynamically generated pages.

since we canot predict the url of dynamic pages which are driven through filters,i think we need to automate this functionality to trigger this noindex or canonical on dynamically generated pages case by case

i hope the above process can help me in implementing noindex or canonical for static pages

View solution in original post

Avatar

Correct answer by
Community Advisor

@Raghavaraoseo 

 

Are you creating the dynamic pages through code? If yes, in that case you would have to apply additional logic in your code. Adding these properties, generates the following properties in the page jcr:content as mentioned in the below screen shot. You would have to add these properties through code while generating these pages.

 

cq:robotsTags 

cq:canonicalUrl

 

AvinashGupta01_0-1669906233215.png

 

 

View solution in original post

Avatar

Correct answer by
Community Advisor

Another option to explore is adding the no index tag as a response header from Dispatcher(Apache) if you have a common URL pattern for those dynamic pages(if you want to add it to the page source, enable the header through your page rendering component based on the content path or follow the suggestion from @Avinash_Gupta_ )

<If "%{REQUEST_URI} =~ m#^/category1#">
    Header set X-Robots-Tag "noindex, nofollow"
</If>

Regards

Albin

www.albinsblog.com

View solution in original post

6 Replies

Avatar

Community Advisor

Hi @Raghavaraoseo 

 

AEM OOB page properties provides you the option to add no-index tag and set cannonical URL

 

1. Go to the page and open its page properties.

2. Navigate to the Advanced section and scroll down.

3. Apply the no-index and cannonical url as mentioned in the below screenshot

 

AvinashGupta01_0-1669905216007.png

 

AvinashGupta01_1-1669905264254.png

 

Hope this helps.

Avatar

Correct answer by
Level 2

Hey Avinash,

Thanks for help ,

but had a concern,

can you please let me know if will be able to access this setup for dynamically generated pages.

since we canot predict the url of dynamic pages which are driven through filters,i think we need to automate this functionality to trigger this noindex or canonical on dynamically generated pages case by case

i hope the above process can help me in implementing noindex or canonical for static pages

Avatar

Correct answer by
Community Advisor

@Raghavaraoseo 

 

Are you creating the dynamic pages through code? If yes, in that case you would have to apply additional logic in your code. Adding these properties, generates the following properties in the page jcr:content as mentioned in the below screen shot. You would have to add these properties through code while generating these pages.

 

cq:robotsTags 

cq:canonicalUrl

 

AvinashGupta01_0-1669906233215.png

 

 

Avatar

Level 2

Hi @Avinash_Gupta_ ,

The method really help me solving the issue .Thanks for taking some time in and letting me know this method.

Regards

Raghavarao

Avatar

Correct answer by
Community Advisor

Another option to explore is adding the no index tag as a response header from Dispatcher(Apache) if you have a common URL pattern for those dynamic pages(if you want to add it to the page source, enable the header through your page rendering component based on the content path or follow the suggestion from @Avinash_Gupta_ )

<If "%{REQUEST_URI} =~ m#^/category1#">
    Header set X-Robots-Tag "noindex, nofollow"
</If>

Regards

Albin

www.albinsblog.com

Avatar

Level 2

Hey @Albin_Issac

I haven't used this method, but possibly will use this in future if applicable,

But ,thanks for taking some time in and letting me know this method.

Regards

Raghavarao