So, by default here's how CQ generates the description meta tag:
<meta name="description" content="<%= xssAPI.encodeForHTMLAttr(properties.get("jcr:description", "")) %>"<%=xs%>>
This in turn converts all spaces to  
Apparently search engines don't like this. Interestingly on Adobe's home page, the description content is not escaped so aggressively:
<meta name="description" content="Adobe is changing the world through digital experiences. We help our customers create, deliver, and optimize content and applications.">
Has anybody else here had SEO issues with the out of the box meta description generation?
As far as I can tell, xssAPI.encodeForHTMLAttr is buggy, because there's no need to escape white space in an HTML attribute.
Views
Replies
Total Likes
Did you manage to find a solution to this ? I have come across exact same issue in my code. And same issue with "keywords" field.
I am thinking using the encodeForHTML method instead , so the statement would change to :
<meta name="description" content="<%= xssAPI.encodeForHTML(properties.get("jcr:description", "")) %>"<%=xs%>>
Does anyone else know if there is an issue with using encodeForHTML instead of encodeForHTMLAttr.
Reference - Line # 34, 35 of /libs/foundation/components/page/head.jsp
/Regards
Kanwal
Views
Replies
Total Likes
Which AEM you are using?
Can you use sightly with @ context='html'
Views
Replies
Total Likes
Should have mentioned....
This is a CQ5.6 code written in jsp
Views
Replies
Total Likes
XSS-escaping is responsible for this.
Your statement: "Apparently search engines don't like this"
Do you have some more info on this?
Views
Replies
Total Likes
In my case, SEO code is not getting right meta tags
Any suggestion on how to fix this... Should I use encodeForHTML method instead ?
Views
Replies
Total Likes