Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#5726 closed defect (bug) (fixed)

Fix blog commenter JS link transformation

Reported by: jonoaldersonwp's profile jonoaldersonwp Owned by: dd32's profile dd32
Milestone: Priority: high
Component: Make (Get Involved) / P2 Keywords: seo accessibility

Description (last modified by jonoaldersonwp)

Links to comment authors on o2 blog posts behave in ways that are harmful to our SEO and to accessibility. There's a heavy reliance on JavaScript, which alters the markup and properties of links to author profiles/sites.

I'm unsure how much of this is normal o2 behaviour, and how much of it is our own customization (or editable from a theme context). Regardless, these issues need to be resolved.

On archive templates

E.g., the core blog front page

See that:

  • Markup for comments are injected via JS after page load.
  • The comment author name is linked, with a rel attribute having external and nofollow attributes.
    E.g., <a href="" rel="external nofollow" class="comment-author url ">Alain Schlesser</a>.

We need to:

  • Remove the rel property from the JS templating system.

On single post templates

E.g., this recent core blog post

See that:

  • Comment author URLs link to the user's domain, with a rel attribute having external, nofollow and ugc attributes.
    E.g., <a href='' rel='external nofollow ugc' class='url'>Alain Schlesser</a>.
  • This is overwritten with JS, which alters the href attribute to reference the user profile URL (and alters the rel attribute, removing the ugc value).
    E.g., <a href="" rel="external nofollow" class="comment-author url ">Alain Schlesser</a>.

We need to:

  • Correct the underlying server-side logic, so that commenter links reference their profile URL, and omit the rel property.
  • Remove the JS replacement logic (or, alter it so that it's consistent with / doesn't alter the commenter link)


  • The JS template/compontent replacement in both templates looks to be powered by the o2 HTML fragment with ID tmpl-o2-comment.

Change History (5)

#1 @jonoaldersonwp
3 years ago

  • Summary changed from Unpick profile link handling to Fix blog commenter JS link transformation

#2 @jonoaldersonwp
3 years ago

  • Description modified (diff)

#3 @AndyBeard
3 years ago

This was an issue I initially pointed out to Jono

It seems from a brief analysis that there is a desire for profiles to be indexed by Google.
Links from there seem to be followed to plugins authored, plugin pages link back in various ways etc.
This is also normal/expected for internal linking to user profiles and why profiles on Twitter frequently rank highly.

Best case for a search engine's interpretation of the current author links is that it is confusing.
Worst case is it is a form of cloaking because the crawler might see something different to a human.

But it is also suboptimal to help boost discovery, crawl, indexing & ranking anyway.

The quick solution to the confusing/cloaking issue would be to just change the external domain URL to # and remove the rel attributes completely.

That would be a high priority minimal fix

Google can see the rendered javascript

However that doesn't mean relying on javascript for the link is desired. Google has crawling and rendering budgets. The more work they have to do the less they see.

It would be far better to have the profile link rendered in the HTML server-side and remove the need for the javascript.

#4 @dd32
3 years ago

  • Owner set to dd32
  • Resolution set to fixed
  • Status changed from new to closed

In 10950:

Make Blogs: Remove the rel="nofollow external" link from logged in comment author links.

All logged in comment links are to their profile, and any anonymous comments (legacy) are not linked by default by o2.

Fixes #5726.

#5 @jonoaldersonwp
3 years ago


Note: See TracTickets for help on using tickets.