3

Why do Stack Exchange sites add a hyperlink inside the H1 tag, linking to the same page?

For example, on Super User:

<h1 itemprop="name">
    <a class="question-hyperlink"
        href="/questions/760926/error-in-eclipse-on-run-android-project"></a>
</h1>

What's the benefit of hyperlinks to the same page?

  • 1
    I guess it would be so you can easily deeplink from another page. Technical about Stack Exchange sites should be posted on Meta Stack Exchange. – mtak May 31 '14 at 6:57
2

Links to SE questions often include unnecessary clutter in the URL. For instance, if someone linked to a specific answer inside a question, or had some tracking/referral code in the URL. Adding a link to the canonical URL for the question as part of the question header is a convenient way to either refresh the current page without the ancillary URL stuff, or copy the canonical URL directly.

This is very common practice in all content sits I know. Most, if not all WordPress themes do it to blog post headers, and I'm sure other CMSs do too.

| improve this answer | |
  • True, but note that referrals are already taken out when short URLs are rewritten when following such links. Any other tracking you might see are the usage URL parameters such as ?rq=1. – Arjan May 31 '14 at 7:51
  • 1
    @Arjan: Aye, but in situations where you followed a link to a particular answer using the H1 A is a convenient way to get a link to the question. – Matt May 31 '14 at 9:07
  • 2
    Yes, @Matt, no doubt about that; I was just referring to the referral codes mentioned in the answer. (I wish there was an easy way to get full URLs for answers too!) – Arjan May 31 '14 at 9:32

You must log in to answer this question.