Jump to content

Recommended Posts

I agree - only use JavaScript when it makes sense to use it; there's no need to invent a reason. If you're using a SPA framework (Vue, React, whatever is hot this week in JS land) then you've got a reason to use JS to redirect the browser. At the same point, those frameworks have the foundation in place that will handle redirects in the background.

I would agree unless there is some objective you have in mind that javascript would facilitate that a plain html link would not.

However, since you are on the topic, one often neglected aspect of links is the rel attribute.

Of particular interest are "nofollow", "ugc" and "canonical".

There's some solid information about these on this page

Let me just say that they are very important to search engines and SEO.

I'll start with "canonical".

You might want to refer to this google page on the issue, and possible solutions.

Let's say that you have a site where you have a shoe product, and the main way to get to that product page is to use the direct product url:

<a href="/product/75">Rockport Men's Wingtip shoe</a> 

Let's also assume that you have categories and search in your site.  You might have a category page for "shoes" like

/category/shoes

And when you can get to the same detail shoe page with a direct product link as in

<a href="/category/shoes/75">Rockport Men's Wingtip shoe</a> 

The search engine crawls your site and unless you took steps to stop it, will crawl the categories pages and find your wingtips shoe page, and finding it in the /product catalog page using  /product/75 page which is exactly the same content.  Search engines can thus downgrade your resulting score, on the basis of the duplicate content.

One way to fix this is to make sure that the product page link uses the rel="canonical" attribute.

<a href="/product/75" rel="canonical">Rockport Men's Wingtip shoe</a> 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.