{"id":71,"date":"2023-04-13T16:31:27","date_gmt":"2023-04-13T09:31:27","guid":{"rendered":"https:\/\/dev.artru.eu.org\/?p=71"},"modified":"2023-10-27T14:37:51","modified_gmt":"2023-10-27T07:37:51","slug":"loi-links-do-not-have-a-discernible-name","status":"publish","type":"post","link":"https:\/\/artru.net\/en\/loi-links-do-not-have-a-discernible-name\/","title":{"rendered":"Error \u201cLinks do not have a discernible name\u201d in Lighthouse"},"content":{"rendered":"<p class=\"wp-block-paragraph\">While checking your website with tools like Lighthouse or PageSpeed Insights, you may receive a \u201cLinks do not have a discernible name\u201d warning. In this article, we will learn about these errors and how to fix them to enhance user experience and improve website scores on performance measurement tools.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What is the error &quot;Links do not have a discernible name&quot;?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The \u201cLinks do not have a discernible name\u201d error is one of the most common errors reported in performance measurement tools like Lighthouse and PageSpeed Insights. It usually appears when a link has no text content or only contains insignificant characters like \u201cclick here\u201d.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">An error related to <strong>Accessibility<\/strong> (user experience, accessibility) in Lighthouse \/ PageSpeed \u200b\u200bInsights.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"671\" height=\"302\" src=\"https:\/\/cdn.artru.eu.org\/wp-content\/uploads\/2023\/04\/Loi-Links-do-not-have-a-discernible-name.jpg\" alt=\"Link error without description text in lighthouse\" class=\"wp-image-345\"\/><figcaption class=\"wp-element-caption\"><em>Error \u201cLinks do not have a discernible name\u201d<\/em><\/figcaption><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">In this case the error is caused by the absence of the image <strong>alt<\/strong> (alternative text). The purpose is that when the image, button, icon fails to load, the alternative text will be displayed.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to fix<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To fix the \u201cLinks do not have a discernible name\u201d error, you need to ensure that each link on your site has clear text content and accurately describes the content of that link. Here are some ways to fix this error:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Name the link according to its content: Use words or phrases that accurately describe the link&#039;s content to create a name for the link. For example: \u201cRead more about product X\u201d instead of \u201cClick here to read more\u201d.<\/li>\n\n\n\n<li>Use the \u201ctitle\u201d and \u201caria-label\u201d attributes: Use these attributes to provide more information about the link&#039;s content to users when they hover over the link without clicking.<br>For example: <code data-no-translation=\"\" data-no-auto-translation=\"\">&lt;a href=\"#\" title=\"\u0110\u1ecdc th\u00eam v\u1ec1 s\u1ea3n ph\u1ea9m X\"&gt;\u0110\u1ecdc th\u00eam&lt;\/a&gt;<\/code>.<\/li>\n\n\n\n<li>If you use images or icons to create links, make sure they have \u201calt\u201d and \u201caria-label\u201d attributes to provide information to users about the content of the link.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">I use Wordpress so just go to &quot;<strong>media<\/strong>\u201d -&gt; <strong>\u201cedit\u201d<\/strong> -&gt; fill \u201c<strong>Alternative Text<\/strong>&quot; is to be.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"141\" height=\"227\" src=\"https:\/\/cdn.artru.eu.org\/wp-content\/uploads\/2023\/04\/Them-the-alt-vao-hinh-anh.jpg\" alt=\"Add alt tag to images in wordpress\" class=\"wp-image-346\"\/><figcaption class=\"wp-element-caption\"><em>Add alt tag to images in wordpress<\/em><\/figcaption><\/figure>\n<\/div>\n\n\n<pre class=\"wp-block-code\" data-no-translation=\"\" data-no-auto-translation=\"\"><code data-no-translation=\"\" data-no-auto-translation=\"\">&lt;img alt='alt image'&gt;\n&lt;a aria-label='aria label icon'&gt;&lt;\/a&gt;\n&lt;button aria-label=\"aria label button\"&gt;&lt;\/button&gt;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">See more at: <a href=\"https:\/\/web.dev\/labels-and-text-alternatives\/#label-buttons-and-links\" target=\"_blank\" data-schema-attribute=\"about\" rel=\"noreferrer noopener\">Labels and text alternatives<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclude<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The error \u201cLinks do not have a discernible name\u201d can affect user experience and cause a website&#039;s score to decrease on performance measurement tools. However, it can easily be fixed by naming the links according to their content or using the \u201ctitle\u201d and \u201caria-label\u201d attributes to provide more information to the user. Through this article, we hope you have a clear understanding of the error &quot;Links do not have a discernible name&quot; and how to fix them.<\/p>","protected":false},"excerpt":{"rendered":"<p>Trong qu\u00e1 tr\u00ecnh ki\u1ec3m tra website c\u1ee7a b\u1ea1n v\u1edbi c\u00e1c c\u00f4ng c\u1ee5 nh\u01b0 Lighthouse ho\u1eb7c PageSpeed Insights, b\u1ea1n c\u00f3 th\u1ec3 nh\u1eadn \u0111\u01b0\u1ee3c c\u1ea3nh b\u00e1o &#8220;Links do not have a discernible name&#8221;. Trong b\u00e0i vi\u1ebft n\u00e0y, ch\u00fang ta s\u1ebd t\u00ecm hi\u1ec3u v\u1ec1 l\u1ed7i n\u00e0y v\u00e0 c\u00e1ch s\u1eeda ch\u00fang \u0111\u1ec3 t\u0103ng c\u01b0\u1eddng tr\u1ea3i nghi\u1ec7m ng\u01b0\u1eddi d\u00f9ng v\u00e0 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":409,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-71","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-seo"],"_links":{"self":[{"href":"https:\/\/artru.net\/en\/wp-json\/wp\/v2\/posts\/71","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/artru.net\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/artru.net\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/artru.net\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/artru.net\/en\/wp-json\/wp\/v2\/comments?post=71"}],"version-history":[{"count":0,"href":"https:\/\/artru.net\/en\/wp-json\/wp\/v2\/posts\/71\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/artru.net\/en\/wp-json\/wp\/v2\/media\/409"}],"wp:attachment":[{"href":"https:\/\/artru.net\/en\/wp-json\/wp\/v2\/media?parent=71"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/artru.net\/en\/wp-json\/wp\/v2\/categories?post=71"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/artru.net\/en\/wp-json\/wp\/v2\/tags?post=71"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}