3

So I'm probably overthinking this, as I do with everything. But I'm just curious to what others think.

In general, naming a HTML anchor link should be short and related, but if you have a table of content, what would then be best practice (from both seo as technical point of view):

  1. matching the exact heading
  2. leave out words with little meaning (such as 'in', 'and')

For example: if your table of content looks like this

  1. an example about the anchor links
  2. creating anchor links on your page

So you would make an anchor link for '1. an example about the anchor links'. Should it be #example-anchor-links or the exact phrase #an-example-about-the-achor-links

On one hand, keeping it short as possible seems like good practise, but on the other hand it might be better to make it an exact match.

Just curious how other people think about this, because I sometimes see the first example and sometimes the second. It might not make huge differences, but since I'm just starting implementing it, I'd rather have the best way right now and be consistent with that for the future.

2
  • Why not just #example and #creating? The context of the page is already all about anchor links, is there a need to repeat that information in the URL? Jan 18 at 14:04
  • It's really not about the content in the example. It's about the best way to link to the headings when making a table content: Using the exact phrases or leaving out the words without meaning. Maybe the example wasn't the best one. But you'd use the headings to link to, so you can't make seperate ones (hopefully I explain it a bit clearly)
    – noddie
    Jan 18 at 17:51

1 Answer 1

1

we keep all of the anchors in our tables short and related to the sections they're linking to. This could avoid accidental typos and saves a fraction of a second when creating these anchors. Additionally, using exact match anchors won't really have an impact on your SEO performance.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.