{"id":13261,"date":"2025-06-12T13:53:57","date_gmt":"2025-06-12T13:53:57","guid":{"rendered":"https:\/\/craighordlow.com\/index.php\/2025\/06\/12\/html-link-code-how-to-create-hyperlinks-on-your-site\/"},"modified":"2025-06-12T13:53:57","modified_gmt":"2025-06-12T13:53:57","slug":"html-link-code-how-to-create-hyperlinks-on-your-site","status":"publish","type":"post","link":"https:\/\/craighordlow.com\/index.php\/2025\/06\/12\/html-link-code-how-to-create-hyperlinks-on-your-site\/","title":{"rendered":"HTML Link Code: How to Create Hyperlinks on Your Site"},"content":{"rendered":"<p>HTML links (also called hyperlinks) are some of the most important functions of the internet. Google literally relies on them to find, crawl, index, and rank pages.<\/p>\n<p>Links have a lot of power, both in terms of user experience and your site\u2019s SEO.<\/p>\n<p>So, understanding how to code HTML links properly is key if you want to create links that help (not hinder) your website\u2019s performance.<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_81 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/06\/12\/html-link-code-how-to-create-hyperlinks-on-your-site\/#The_Components_of_an_HTML_Link\" >The Components of an HTML Link<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/06\/12\/html-link-code-how-to-create-hyperlinks-on-your-site\/#How_to_Add_Links_with_HTML_Code\" >How to Add Links with HTML Code<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/06\/12\/html-link-code-how-to-create-hyperlinks-on-your-site\/#Text_Links\" >Text Links<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/06\/12\/html-link-code-how-to-create-hyperlinks-on-your-site\/#Image_Links_to_Make_Images_Clickable\" >Image Links to Make Images Clickable<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/06\/12\/html-link-code-how-to-create-hyperlinks-on-your-site\/#Email_Links\" >Email Links<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/06\/12\/html-link-code-how-to-create-hyperlinks-on-your-site\/#Phone_Links\" >Phone Links<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/06\/12\/html-link-code-how-to-create-hyperlinks-on-your-site\/#Jump_Links_Anchor_Links_for_Internal_Page_Navigation\" >Jump Links (Anchor Links) for Internal Page Navigation<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/06\/12\/html-link-code-how-to-create-hyperlinks-on-your-site\/#Button_Links_for_Calls_to_Action\" >Button Links for Calls to Action<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/06\/12\/html-link-code-how-to-create-hyperlinks-on-your-site\/#Download_Links\" >Download Links<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/06\/12\/html-link-code-how-to-create-hyperlinks-on-your-site\/#Other_Important_HTML_Link_Code_for_SEO\" >Other Important HTML Link Code for SEO<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/06\/12\/html-link-code-how-to-create-hyperlinks-on-your-site\/#Canonical_Tags\" >Canonical Tags<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/06\/12\/html-link-code-how-to-create-hyperlinks-on-your-site\/#Hreflang\" >Hreflang<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/06\/12\/html-link-code-how-to-create-hyperlinks-on-your-site\/#HTML_Link_Code_Best_Practices\" >HTML Link Code Best Practices<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/06\/12\/html-link-code-how-to-create-hyperlinks-on-your-site\/#Syntax\" >Syntax<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/06\/12\/html-link-code-how-to-create-hyperlinks-on-your-site\/#Anchor_Text\" >Anchor Text<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/06\/12\/html-link-code-how-to-create-hyperlinks-on-your-site\/#Title_Attributes\" >Title Attributes<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/06\/12\/html-link-code-how-to-create-hyperlinks-on-your-site\/#Aria_Labels\" >Aria Labels<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-18\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/06\/12\/html-link-code-how-to-create-hyperlinks-on-your-site\/#Target\" >Target<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-19\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/06\/12\/html-link-code-how-to-create-hyperlinks-on-your-site\/#Relationships_rel\" >Relationships (rel=)<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-20\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/06\/12\/html-link-code-how-to-create-hyperlinks-on-your-site\/#Sponsored_Links\" >Sponsored Links<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-21\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/06\/12\/html-link-code-how-to-create-hyperlinks-on-your-site\/#UGC_Links\" >UGC Links<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-22\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/06\/12\/html-link-code-how-to-create-hyperlinks-on-your-site\/#Nofollow_Links\" >Nofollow Links<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-23\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/06\/12\/html-link-code-how-to-create-hyperlinks-on-your-site\/#What_About_%E2%80%9Cnoopener%E2%80%9D_and_%E2%80%9Cnoreferrer%E2%80%9D\" >What About \u201cnoopener\u201d and \u201cnoreferrer\u201d?<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-24\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/06\/12\/html-link-code-how-to-create-hyperlinks-on-your-site\/#Absolute_vs_Relative_URLs\" >Absolute vs. Relative URLs<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-25\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/06\/12\/html-link-code-how-to-create-hyperlinks-on-your-site\/#How_to_Check_Your_Sites_HTML_Links\" >How to Check Your Site\u2019s HTML Links<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"The_Components_of_an_HTML_Link\"><\/span>The Components of an HTML Link<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>You create an HTML link using the anchor element: <a>.<\/a><\/p>\n<p>You then use attributes and values to change how the link functions.<\/p>\n<p>Here\u2019s what the complete HTML code for a clickable link looks like:<\/p>\n<pre>&lt;a href=\"https:\/\/example.com\" target=\"_blank\" rel=\"noopener\"&gt;Visit Example.com for more info.&lt;\/a&gt;<\/pre>\n<p>Let\u2019s break that down:<\/p>\n<ul>\n<li><strong>The anchor tag (&lt;a&gt;)<\/strong> is the foundation of every link. It tells browsers \u201cthis is a clickable link.\u201d<\/li>\n<li><strong>The href attribute<\/strong> defines where your link goes. This can be a web address, a file path, or even a specific section on the current page.<\/li>\n<li><strong>The target attribute<\/strong> controls how the link opens. The default is to open in the same window, but _blank makes it open in a new tab.<\/li>\n<li><strong>The rel attribute<\/strong> defines the relationship between the linking page and the linked page. It\u2019s particularly important for SEO (more on that in the <a title=\"HTML Link Code Best Practices\" href=\"https:\/\/backlinko.com\/html-code-for-a-link#best-practices-section\" target=\"_blank\" rel=\"noopener\">best practices section<\/a>).<\/li>\n<li><strong>The anchor text<\/strong> is what users see and click. In the example above, it\u2019s \u201cVisit Example.com for more info.\u201d<\/li>\n<li><strong>The closing tag (&lt;a&gt;)<\/strong> indicates where the link ends.<\/li>\n<\/ul>\n<p>I\u2019ll talk more about the role these elements play later in this guide. For now, let\u2019s look at some of the most common ways to add HTML links.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"How_to_Add_Links_with_HTML_Code\"><\/span>How to Add Links with HTML Code<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The basic method of adding links with HTML code involves placing the URL you want to link to within a link anchor tag. Just like the example above.<\/p>\n<p>But here are a few of the most common use cases for adding links in HTML:<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Text_Links\"><\/span>Text Links<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Text links are the most common type of hyperlink you\u2019ll create. You can use them to link to other pages on your site (<a title=\"Internal Linking for SEO: The Complete Guide\" href=\"https:\/\/backlinko.com\/hub\/seo\/internal-links\" target=\"_blank\" rel=\"noopener\">internal links<\/a>) or on other sites (external links).<\/p>\n<figure class=\"backlinko-image__screenshot backlinko-image backlinko-has-border\">\n<div class=\"backlinko-img-placeholder\"><\/div>\n<p><img decoding=\"async\" title=\"Backlinko \u2013 SEO Strategy \u2013 Internal &amp; External Link\" alt=\"Backlinko \u2013 SEO Strategy \u2013 Internal &amp; External Link\" data-aspect-ratio=\"0.87428571428571\" src=\"https:\/\/backlinko.com\/app\/uploads\/2025\/05\/backlinko-seo-strategy-internal-and-external-link.png\" loading=\"lazy\" \/><\/p><\/figure>\n<p>Here\u2019s the standard implementation:<\/p>\n<pre>&lt;a href=\"https:\/\/example.com\"&gt;Visit our website&lt;\/a&gt;<\/pre>\n<p>This creates a basic text link that users can click to navigate to the specified URL.<\/p>\n<p>You can enhance text links with additional attributes for specific use cases. For example, here\u2019s how you would set a link to open in a new tab:<\/p>\n<pre>&lt;a href=\"https:\/\/example.com\" target=\"_blank\" rel=\"noopener noreferrer\"&gt;Visit Example.com&lt;\/a&gt;<\/pre>\n<p>If it\u2019s an affiliate link, you might use something like this:<\/p>\n<pre>&lt;a href=\"https:\/\/example.com\" target=\"_blank\" rel=\"noopener noreferrer sponsored\"&gt;Visit Example.com&lt;\/a&gt;<\/pre>\n<p>(More on these attributes later.)<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Image_Links_to_Make_Images_Clickable\"><\/span>Image Links to Make Images Clickable<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Images can serve as powerful, eye-catching links that often attract more attention than plain text.<\/p>\n<p>The basic structure for an HTML image link wraps an &lt;img&gt; tag inside an anchor tag:<\/p>\n<pre>&lt;a href=\"https:\/\/example.com\"&gt;\r\n\u00a0\u00a0&lt;img src=\"logo.png\" alt=\"Company Logo\"&gt;\r\n&lt;\/a&gt;<\/pre>\n<p>This transforms the entire image into a clickable link that navigates to the specified URL.<\/p>\n<p>The \u201c<strong>img src<\/strong>\u201d attribute specifies the location of the image file. While the \u201c<strong>alt<\/strong>\u201d attribute specifies alternative text for the image.<\/p>\n<figure class=\"backlinko-image__screenshot backlinko-image backlinko-has-border\">\n<div class=\"backlinko-img-placeholder\"><\/div>\n<p><img decoding=\"async\" title=\"Img src &amp; alt attributes\" alt=\"Img src &amp; alt attributes\" data-aspect-ratio=\"0.70142857142857\" src=\"https:\/\/backlinko.com\/app\/uploads\/2025\/05\/img-src-and-alt-attributes.png\" loading=\"lazy\" \/><\/p><\/figure>\n<p>For image links to be accessible and SEO-friendly, you should include descriptive alt text. Like this:<\/p>\n<pre>&lt;a href=\"\/product\/camera\"&gt; \r\n  &lt;img src=\"camera.jpg\" alt=\"Canon EOS R6 Mark II Camera\"&gt;\r\n&lt;\/a&gt;<\/pre>\n<p>The alt text serves two critical purposes:<\/p>\n<ul>\n<li>Screen readers will read it aloud for visually impaired users to understand the image\u2019s content<\/li>\n<li>It helps search engines understand the content of your image (which may help you rank in image search results)<\/li>\n<\/ul>\n<p>You should only make your images clickable if they actually take the user somewhere useful. Like to the image\u2019s source website.<\/p>\n<p>It\u2019s worth noting that for image links and a few of the other types below, you might implement them in different ways.<\/p>\n<p>For example, here\u2019s how we implement some image links here on Backlinko (using CSS classes):<\/p>\n<figure class=\"backlinko-image__screenshot backlinko-image backlinko-has-border\">\n<div class=\"backlinko-img-placeholder\"><\/div>\n<p><img decoding=\"async\" title=\"Implemented image links using CSS classes\" alt=\"Implemented image links using CSS classes\" data-aspect-ratio=\"0.82714285714286\" src=\"https:\/\/backlinko.com\/app\/uploads\/2025\/05\/implemented-image-inks-using-css-classes.png\" loading=\"lazy\" \/><\/p><\/figure>\n<p>But here\u2019s an image link on The Spruce:<\/p>\n<figure class=\"backlinko-image__screenshot backlinko-image backlinko-has-border\">\n<div class=\"backlinko-img-placeholder\"><\/div>\n<p><img decoding=\"async\" title=\"The Spruce \u2013 Clickable image on the homepage\" alt=\"The Spruce \u2013 Clickable image on the homepage\" data-aspect-ratio=\"1.4014285714286\" src=\"https:\/\/backlinko.com\/app\/uploads\/2025\/05\/thespruce-clickable-image-on-the-homepage.png\" loading=\"lazy\" \/><\/p><\/figure>\n<p>In this case, the image link is still contained within an &lt;a&gt; tag. But there are other elements (like &lt;div&gt;) and classes (like img-placeholder) as well.<\/p>\n<p>How exactly you implement image links largely depends on your website setup. If you use WordPress, your theme and plugins will likely dictate how you code your image links.<\/p>\n<div class=\"sc-quote alert blue-box font-georgia type-normal transparent-img-bg\">\n<div class=\"media\">\n<figure class=\"sc-picture media-left hidden-sm-down\">\n            <img decoding=\"async\" src=\"https:\/\/backlinko.com\/app\/uploads\/2024\/06\/icon-further-reading.png\" alt=\"| Craig Hordlow\" loading=\"lazy\" title=\"| Craig Hordlow\">        <\/figure>\n<div class=\"media-body\">\n<blockquote class=\"sc-quote\">\n<p><strong>Further reading:<\/strong> <a title=\"15 Image SEO Tips for Better Image Optimization\" href=\"https:\/\/backlinko.com\/image-seo\" target=\"_blank\" rel=\"noopener\">Image SEO: 15 Essential Optimization Tips<\/a><\/p>\n<\/blockquote>\n<div class=\"media\">\n<figure class=\"sc-picture media-left hidden-md-up\">\n                    <img decoding=\"async\" src=\"https:\/\/backlinko.com\/app\/uploads\/2024\/06\/icon-further-reading.png\" alt=\"| Craig Hordlow\" loading=\"lazy\" title=\"| Craig Hordlow\">                <\/figure>\n<p>                                <cite class=\"sc-name media-body media-middle\"><br \/>\n                                    <\/cite>\n            <\/p><\/div>\n<\/div>\n<\/div>\n<\/div>\n<h3><span class=\"ez-toc-section\" id=\"Email_Links\"><\/span>Email Links<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Email links use a special protocol that launches the user\u2019s default email client. They\u2019re perfect for making it easier for users to reach you.<\/p>\n<p>Use the mailto: protocol to create email links:<\/p>\n<pre>&lt;a href=\"mailto:contact@example.com\"&gt;Email Us&lt;\/a&gt;<\/pre>\n<p>When a user clicks this link, it opens their default email program with the recipient field already populated.<\/p>\n<figure class=\"backlinko-image__screenshot backlinko-image backlinko-has-border\">\n<div class=\"backlinko-img-placeholder\"><\/div>\n<p><img decoding=\"async\" title=\"Allbirds \u2013 Help Email\" alt=\"Allbirds \u2013 Help Email\" data-aspect-ratio=\"1.09\" src=\"https:\/\/backlinko.com\/app\/uploads\/2025\/05\/allbirds-help-email.png\" loading=\"lazy\" \/><\/p><\/figure>\n<p>You can enhance email links with additional parameters too. Like this:<\/p>\n<pre>&lt;a href=\"mailto:sales@example.com?subject=Product%20Inquiry&amp;body=I%27m%20interested%20in%20learning%20more\"&gt;Email Sales Team&lt;\/a&gt;<\/pre>\n<p>This pre-fills the subject line with \u201cProduct Inquiry\u201d and adds initial text to the email body that says \u201cI\u2019m interested in learning more.\u201d<\/p>\n<p>(Note that you need to encode spaces and special characters, like %20 for a space.)<\/p>\n<div class=\"sc-quote alert blue-box font-georgia type-normal transparent-img-bg\">\n<div class=\"media\">\n<figure class=\"sc-picture media-left hidden-sm-down\">\n            <img decoding=\"async\" src=\"https:\/\/backlinko.com\/app\/uploads\/2024\/06\/icon-tip.png\" alt=\"| Craig Hordlow\" loading=\"lazy\" title=\"| Craig Hordlow\">        <\/figure>\n<div class=\"media-body\">\n<blockquote class=\"sc-quote\">\n<p><strong>Pro tip:<\/strong> Make it clear what will happen when a user clicks the link with descriptive anchor text. This way, they won\u2019t be confused when their email client opens.<\/p>\n<\/blockquote>\n<div class=\"media\">\n<figure class=\"sc-picture media-left hidden-md-up\">\n                    <img decoding=\"async\" src=\"https:\/\/backlinko.com\/app\/uploads\/2024\/06\/icon-tip.png\" alt=\"| Craig Hordlow\" loading=\"lazy\" title=\"| Craig Hordlow\">                <\/figure>\n<p>                                <cite class=\"sc-name media-body media-middle\"><br \/>\n                                    <\/cite>\n            <\/p><\/div>\n<\/div>\n<\/div>\n<\/div>\n<h3><span class=\"ez-toc-section\" id=\"Phone_Links\"><\/span>Phone Links<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>For phone numbers, use the tel: protocol:<\/p>\n<pre>&lt;a href=\"tel:+15555555555\"&gt;Call (555) 555-5555&lt;\/a&gt;<\/pre>\n<p>When a user taps this link on their mobile device, it opens the phone dialer with the number ready to call.<\/p>\n<p>For international phone numbers, always include the country code with a plus sign:<\/p>\n<pre>&lt;a href=\"tel:+442071234567\"&gt;Call our London office: +44 20 7123 4567&lt;\/a&gt;<\/pre>\n<p>You can also use the \u201csms\u201d value to open up a text message:<\/p>\n<pre>&lt;a href=\"sms:+442071234567\"&gt;Send us a text&lt;\/a&gt;<\/pre>\n<p>As with email links, be clear in your anchor text for phone and SMS links about what will happen when the user taps the link.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Jump_Links_Anchor_Links_for_Internal_Page_Navigation\"><\/span>Jump Links (Anchor Links) for Internal Page Navigation<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Jump links, also known as anchor links, help users navigate to specific sections within the same page. They\u2019re especially useful for long-form content.<\/p>\n<p>If your site uses a table of contents (like this site does), it works using jump links in this way.<\/p>\n<figure class=\"backlinko-image__screenshot backlinko-image backlinko-has-border\">\n<div class=\"backlinko-img-placeholder\"><\/div>\n<p><img decoding=\"async\" title=\"Table of content in post\" alt=\"Table of content in post\" data-aspect-ratio=\"0.86857142857143\" src=\"https:\/\/backlinko.com\/app\/uploads\/2024\/06\/table-of-content-in-post-1.png\" loading=\"lazy\" \/><\/p><\/figure>\n<p>The basic structure requires two parts:<\/p>\n<ol>\n<li>An element with an id attribute that serves as the target<\/li>\n<li>A link that points to that id using a hash (#) symbol<\/li>\n<\/ol>\n<p>For example, in our article on <a title=\"Keyword Mapping: A Step-by-Step Guide to Better SEO\" href=\"https:\/\/backlinko.com\/keyword-mapping\" target=\"_blank\" rel=\"noopener\">keyword mapping<\/a>, which is a step-by-step list, we use jump links to make it easier for users to navigate.<\/p>\n<p>First, we added \u201cid\u201d tags to the headings, like this:<\/p>\n<pre>&lt;h3 id=\"add-keywords\"&gt;3. Add the Keywords to Your Map&lt;\/h3&gt;<\/pre>\n<p>You don\u2019t see this id attribute on the page, but it\u2019s in the site\u2019s code:<\/p>\n<figure class=\"backlinko-image__screenshot backlinko-image backlinko-has-border\">\n<div class=\"backlinko-img-placeholder\"><\/div>\n<p><img decoding=\"async\" title=\"ID Tags added to the Headings\" alt=\"ID Tags added to the Headings\" data-aspect-ratio=\"0.69142857142857\" src=\"https:\/\/backlinko.com\/app\/uploads\/2025\/05\/id-tags-added-to-the-headings.png\" loading=\"lazy\" \/><\/p><\/figure>\n<p>Then, in the second step of the list, which some users might not need to follow, we include a link to skip ahead to the third step (which has the id \u201cadd-keywords\u201d).<\/p>\n<p>The HTML link code looks like this:<\/p>\n<pre>&lt;a href=\"#add-keywords\"&gt;step 3&lt;\/a&gt;<\/pre>\n<p>And the link on the page looks like this:<\/p>\n<figure class=\"backlinko-image__screenshot backlinko-image backlinko-has-border\">\n<div class=\"backlinko-img-placeholder\"><\/div>\n<p><img decoding=\"async\" title=\"Backlinko \u2013 Link to skip ahead\" alt=\"Backlinko \u2013 Link to skip ahead\" data-aspect-ratio=\"0.57857142857143\" src=\"https:\/\/backlinko.com\/app\/uploads\/2025\/05\/backlinko-link-to-skip-ahead.png\" loading=\"lazy\" \/><\/p><\/figure>\n<p>When a user clicks the link, the browser will instantly scroll to the element with the matching id (in this case, step 3). It\u2019ll also update the URL in the address bar:<\/p>\n<figure class=\"backlinko-image__screenshot backlinko-image backlinko-has-border\">\n<div class=\"backlinko-img-placeholder\"><\/div>\n<p><img decoding=\"async\" title=\"Updated URL in the address bar\" alt=\"Updated URL in the address bar\" data-aspect-ratio=\"0.45428571428571\" src=\"https:\/\/backlinko.com\/app\/uploads\/2025\/05\/updated-url-in-the-address-bar.png\" loading=\"lazy\" \/><\/p><\/figure>\n<p>Jump links are perfect for:<\/p>\n<ul>\n<li>Tables of contents at the top of articles<\/li>\n<li>\u201cBack to top\u201d links at the end of sections<\/li>\n<li>FAQ pages where users want to jump to specific questions<\/li>\n<li>Product pages with multiple information sections<\/li>\n<\/ul>\n<h3><span class=\"ez-toc-section\" id=\"Button_Links_for_Calls_to_Action\"><\/span>Button Links for Calls to Action<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>HTML links over buttons combine the functionality of an &lt;a&gt; tag with the appearance of a button.<\/p>\n<p>They\u2019re perfect for calls to action that need to stand out and attract clicks.<\/p>\n<p>The key difference between a button-style link and a regular link is that you\u2019ll typically code HTML button links with CSS:<\/p>\n<pre>&lt;a href=\"yourdomain.com\/signup\" class=\"button-link\"&gt;Get Started&lt;\/a&gt;<\/pre>\n<p>This HTML looks like a standard text link, but with CSS, you can transform it:<\/p>\n<pre>.button-link {\r\n  display: inline-block;\r\n  padding: 10px 20px;\r\n  background-color: #0066cc;\r\n  color: white;\r\n  text-decoration: none;\r\n  border-radius: 4px;\r\n  font-weight: bold;\r\n  text-align: center;\r\n}\r\n\r\n.button-link:hover {\r\n  background-color: #004080;\r\n}<\/pre>\n<p>These styles create a rectangular button with:<\/p>\n<ul>\n<li>Clear boundaries (background color and padding)<\/li>\n<li>Rounded corners (border-radius)<\/li>\n<li>Visual feedback on hover (background color change)<\/li>\n<\/ul>\n<p>For mobile users, make sure your button-style links are large enough to easily tap:<\/p>\n<pre>@media (max-width: 768px) {\r\n  .button-link {\r\n    padding: 12px 24px;\r\n    width: 100%; \r\n    margin-bottom: 10px;\r\n  }\r\n}<\/pre>\n<p>It\u2019s worth noting that in a lot of cases, you won\u2019t need to code button links yourself. If you\u2019re using a CMS like WordPress, for example, you might use button templates of some kind.<\/p>\n<p>Or perhaps, your developer will use CSS classes to create buttons rather than using HTML link codes.<\/p>\n<figure class=\"backlinko-image__screenshot backlinko-image backlinko-has-border\">\n<div class=\"backlinko-img-placeholder\"><\/div>\n<p><img decoding=\"async\" title=\"CSS classes to create buttons\" alt=\"CSS classes to create buttons\" data-aspect-ratio=\"0.82285714285714\" src=\"https:\/\/backlinko.com\/app\/uploads\/2025\/05\/css-classes-to-create-buttons.png\" loading=\"lazy\" \/><\/p><\/figure>\n<h3><span class=\"ez-toc-section\" id=\"Download_Links\"><\/span>Download Links<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Download links let your users easily save files from your website to their devices.<\/p>\n<p>The basic HTML for a download link uses the download attribute:<\/p>\n<pre>&lt;a href=\"report.pdf\" download&gt;Download PDF Report&lt;\/a&gt;<\/pre>\n<p>For files that browsers typically display rather than download (like PDFs), the download attribute ensures they\u2019re saved instead of opened.<\/p>\n<p>Many browsers will download other file types by default, without the need for a separate download attribute. This is often true for things like Excel and Word documents.<\/p>\n<div class=\"sc-quote alert blue-box font-georgia type-normal transparent-img-bg\">\n<div class=\"media\">\n<figure class=\"sc-picture media-left hidden-sm-down\">\n            <img decoding=\"async\" src=\"https:\/\/backlinko.com\/app\/uploads\/2024\/06\/icon-note.png\" alt=\"| Craig Hordlow\" loading=\"lazy\" title=\"| Craig Hordlow\">        <\/figure>\n<div class=\"media-body\">\n<blockquote class=\"sc-quote\">\n<p><strong>Note:<\/strong> Sometimes your server configuration will dictate whether a file will open or download by default. If you\u2019re not sure, speak to your developer.<\/p>\n<\/blockquote>\n<div class=\"media\">\n<figure class=\"sc-picture media-left hidden-md-up\">\n                    <img decoding=\"async\" src=\"https:\/\/backlinko.com\/app\/uploads\/2024\/06\/icon-note.png\" alt=\"| Craig Hordlow\" loading=\"lazy\" title=\"| Craig Hordlow\">                <\/figure>\n<p>                                <cite class=\"sc-name media-body media-middle\"><br \/>\n                                    <\/cite>\n            <\/p><\/div>\n<\/div>\n<\/div>\n<\/div>\n<h2><span class=\"ez-toc-section\" id=\"Other_Important_HTML_Link_Code_for_SEO\"><\/span>Other Important HTML Link Code for SEO<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>There are a few HTML link attributes you should be aware of for your site\u2019s SEO. These don\u2019t create hyperlinks, but they do go inside an HTML link element in the &lt;head&gt; portion of your page\u2019s code.<\/p>\n<p>This element looks like &lt;link&gt; rather than &lt;a&gt;.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Canonical_Tags\"><\/span>Canonical Tags<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><a title=\"Canonical Tags for SEO: How to Fix Duplicate Content URLs\" href=\"https:\/\/backlinko.com\/canonical-url-guide\" target=\"_blank\" rel=\"noopener\">Canonical tags<\/a> (technically attributes) tell search engines which version of a page is the \u201cprimary\u201d one when you have similar or <a title=\"Duplicate Content and SEO: The Complete Guide\" href=\"https:\/\/backlinko.com\/hub\/seo\/duplicate-content\" target=\"_blank\" rel=\"noopener\">duplicate content<\/a> across multiple URLs. They help prevent duplicate content issues that can hurt your SEO.<\/p>\n<p>But it\u2019s good practice to implement them on all of your pages.<\/p>\n<figure class=\"backlinko-image__screenshot backlinko-image backlinko-has-border\">\n<div class=\"backlinko-img-placeholder\"><\/div>\n<p><img decoding=\"async\" title=\"Backlinko uses canonicals\" alt=\"Backlinko uses canonicals\" data-aspect-ratio=\"0.88\" src=\"https:\/\/backlinko.com\/app\/uploads\/2025\/04\/backlinko-uses-canonicals.png\" loading=\"lazy\" \/><\/p><\/figure>\n<p>You implement canonical tags using a &lt;link&gt; element in the &lt;head&gt; section of your HTML:<\/p>\n<pre>&lt;head&gt;\r\n&lt;link rel=\"canonical\" href=\"https:\/\/example.com\/original-page\"&gt;\r\n&lt;\/head&gt;<\/pre>\n<p>This effectively tells search engines: \u201cThis page is a copy or variation of the page at the specified URL. Please attribute all ranking signals to that URL instead.\u201d<\/p>\n<p>Canonicalization can help when you have <a title=\"URL Parameters: What They Are and How to Use Them Properly\" href=\"https:\/\/backlinko.com\/url-parameters\" target=\"_blank\" rel=\"noopener\">URL parameters<\/a> for tracking, filtering, or sorting (e.g., ?source=email or ?sort=price).<\/p>\n<figure class=\"backlinko-image__visual-chart backlinko-image\">\n<div class=\"backlinko-img-placeholder\"><\/div>\n<p><img decoding=\"async\" title=\"URL Structure\" alt=\"URL Structure\" data-aspect-ratio=\"0.49571428571429\" src=\"https:\/\/backlinko.com\/app\/uploads\/2025\/03\/url-structure.png\" loading=\"lazy\" \/><\/p><\/figure>\n<h3><span class=\"ez-toc-section\" id=\"Hreflang\"><\/span>Hreflang<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>The hreflang HTML link attribute helps search engines understand the language and regional targeting of your pages. This helps them understand which version of your page to display to users in search results.<\/p>\n<p>As with canonical tags, you implement it using link elements in the &lt;head&gt; section of your HTML:<\/p>\n<pre>&lt;head&gt;\r\n\u00a0\u00a0&lt;link rel=\"alternate\" hreflang=\"en-us\" href=\"https:\/\/example.com\/en-us\/page\"&gt;\r\n\u00a0\u00a0&lt;link rel=\"alternate\" hreflang=\"es\" href=\"https:\/\/example.com\/es\/page\"&gt;\r\n\u00a0\u00a0&lt;link rel=\"alternate\" hreflang=\"fr\" href=\"https:\/\/example.com\/fr\/page\"&gt;\r\n\u00a0\u00a0&lt;link rel=\"alternate\" hreflang=\"x-default\" href=\"https:\/\/example.com\/\"&gt;\r\n&lt;\/head&gt;<\/pre>\n<p>These link elements tell search engines:<\/p>\n<ul>\n<li>This page is available in English (US), Spanish, and French<\/li>\n<li>The default version (for users speaking other languages) is at the root URL<\/li>\n<\/ul>\n<p>The hreflang attribute uses language codes (like \u201cen\u201d for English) and optional region codes (like \u201cus\u201d for the United States).<\/p>\n<figure class=\"backlinko-image__visual-chart backlinko-image\">\n<div class=\"backlinko-img-placeholder\"><\/div>\n<p><img decoding=\"async\" title=\"Hreflang structure\" alt=\"Hreflang structure\" data-aspect-ratio=\"0.39571428571429\" src=\"https:\/\/backlinko.com\/app\/uploads\/2024\/03\/hreflang-structure.png\" loading=\"lazy\" \/><\/p><\/figure>\n<p>Hreflang tags are only an issue for sites with different language versions and an international presence. They can be tricky to get right, so for more detailed info, check out our dedicated guide to <a title=\"What Is Hreflang and How To Implement It the Right Way\" href=\"https:\/\/backlinko.com\/hreflang-tag\" target=\"_blank\" rel=\"noopener\">hreflang tags<\/a>.<\/p>\n<h2 class=\"text-center\"><span class=\"ez-toc-section\" id=\"HTML_Link_Code_Best_Practices\"><\/span>HTML Link Code Best Practices<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Following these best practices will ensure your links are effective, secure, and accessible to all users. And it\u2019ll help <a title=\"17 Ways to Improve SEO of Your Website\" href=\"https:\/\/backlinko.com\/improve-your-seo\" target=\"_blank\" rel=\"noopener\">improve your SEO<\/a> too.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Syntax\"><\/span>Syntax<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Here\u2019s the correct syntax for an HTML link:<\/p>\n<pre>&lt;a href=\"url\"&gt;Anchor Text&lt;\/a&gt;<\/pre>\n<p>Here are a few syntax rules to remember:<\/p>\n<ul>\n<li>Always include the opening &lt;a&gt; and closing &lt;\/a&gt; tags<\/li>\n<li>Add the href attribute along with a value (your URL)<\/li>\n<li>Enclose attribute values in quotation marks<\/li>\n<li>Don\u2019t use spaces between the attribute, equals sign, and value<\/li>\n<\/ul>\n<h3><span class=\"ez-toc-section\" id=\"Anchor_Text\"><\/span>Anchor Text<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Anchor text is the clickable text of your link. It\u2019s the words users actually see and click on. It plays a crucial role in both user experience and SEO.<\/p>\n<p>Good anchor text clearly tells users what to expect when they click a link. It also provided<\/p>\n<p>Here\u2019s an example of poor anchor text:<\/p>\n<pre>&lt;a href=\"https:\/\/example.com\/pricing\"&gt;Click here&lt;\/a&gt;<\/pre>\n<p>And here\u2019s an example of good, descriptive anchor text:<\/p>\n<pre>&lt;a href=\"https:\/\/example.com\/pricing\"&gt;View our pricing plans&lt;\/a&gt;<\/pre>\n<p>The second example gives users (and search engines) clear information about where the link will take them.<\/p>\n<p>When writing anchor text, follow these guidelines:<\/p>\n<ul>\n<li>Make it descriptive and relevant to the destination<\/li>\n<li>Keep it concise (typically 2-5 words)<\/li>\n<li>Avoid generic phrases like \u201cclick here\u201d or \u201cread more\u201d<\/li>\n<li>Use keywords naturally, but don\u2019t stuff them in<\/li>\n<\/ul>\n<h3><span class=\"ez-toc-section\" id=\"Title_Attributes\"><\/span>Title Attributes<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>There\u2019s also a \u201ctitle\u201d attribute you can add to links. But you generally don\u2019t need this if you use descriptive anchor text.<\/p>\n<p>In fact, using it can reduce readability and accessibility if it just repeats the anchor text. Screen readers usually won\u2019t read it out, and users hovering over the link will see a tooltip that may just block other content on the screen. Plus, it won\u2019t display on mobile devices at all.<\/p>\n<p>So, unless you can meaningfully add important information about the link, don\u2019t use the title attribute. And instead just make your anchor text descriptive.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Aria_Labels\"><\/span>Aria Labels<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>ARIA (Accessible Rich Internet Applications) labels enhance accessibility by providing additional context for screen readers and other assistive technologies.<\/p>\n<p>The aria-label attribute provides an accessible name for a link when the visible text isn\u2019t descriptive enough, or for links over icons rather than text:<\/p>\n<pre>&lt;a href=\"https:\/\/yourdomain.com\/settings\" aria-label=\"Go to settings\"&gt;\r\n\u00a0\u00a0&lt;svg&gt;&lt;!-- settings icon --&gt;&lt;\/svg&gt;\r\n&lt;\/a&gt;<\/pre>\n<p>In this example, a screen reader would announce \u201cGo to settings\u201d but the site would only visually display a settings icon.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Target\"><\/span>Target<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>The target attribute determines how your link opens when a user clicks on it.<\/p>\n<p>The default link behavior opens the link in the same tab (i.e., you go from the current page to the linked page).<\/p>\n<p>The default value is \u201c_self\u201d but you don\u2019t need to specify that.<\/p>\n<p>If you want to open the link in a new tab, use the \u201c_blank\u201d target value:<\/p>\n<pre>&lt;a href=\"https:\/\/example.com\" target=\"_blank\"&gt;Example&lt;\/a&gt;<\/pre>\n<p>You used to need to add rel=\u201cnoopener\u201d to links with a blank target value for security reasons. But you no longer need to do this. (More on noopener below.)<\/p>\n<p>Opening your link in a new tab is particularly useful when:<\/p>\n<ul>\n<li>Linking to external websites<\/li>\n<li>Providing reference material that users might want to check while staying on your page<\/li>\n<li>Linking to downloads or resources that would disrupt the user\u2019s current activity<\/li>\n<\/ul>\n<p>Opinions vary on whether this is best for accessibility. Some believe this creates a disruptive user experience, especially on mobile and for those using assistive technologies (like screen readers).<\/p>\n<p>For internal links that are part of the natural navigation flow, it\u2019s usually best to stick with the default behavior (opening in the same tab).<\/p>\n<div class=\"sc-quote alert blue-box font-georgia type-normal transparent-img-bg\">\n<div class=\"media\">\n<figure class=\"sc-picture media-left hidden-sm-down\">\n            <img decoding=\"async\" src=\"https:\/\/backlinko.com\/app\/uploads\/2024\/06\/icon-note.png\" alt=\"| Craig Hordlow\" loading=\"lazy\" title=\"| Craig Hordlow\">        <\/figure>\n<div class=\"media-body\">\n<blockquote class=\"sc-quote\">\n<p><strong>Note:<\/strong> There used to be other target values (_parent and _top), but these are deprecated in HTML5.<\/p>\n<\/blockquote>\n<div class=\"media\">\n<figure class=\"sc-picture media-left hidden-md-up\">\n                    <img decoding=\"async\" src=\"https:\/\/backlinko.com\/app\/uploads\/2024\/06\/icon-note.png\" alt=\"| Craig Hordlow\" loading=\"lazy\" title=\"| Craig Hordlow\">                <\/figure>\n<p>                                <cite class=\"sc-name media-body media-middle\"><br \/>\n                                    <\/cite>\n            <\/p><\/div>\n<\/div>\n<\/div>\n<\/div>\n<h3><span class=\"ez-toc-section\" id=\"Relationships_rel\"><\/span>Relationships (rel=)<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>The rel attribute defines the relationship between your current page and the page you\u2019re linking to. It\u2019s an important attribute that affects both security and SEO.<\/p>\n<p>The default behavior is to not add any rel values. But here are a few of the most common ones:<\/p>\n<h4><span class=\"ez-toc-section\" id=\"Sponsored_Links\"><\/span>Sponsored Links<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>You use the sponsored rel value when another brand has paid to have a link on your site.<\/p>\n<p>For example, let\u2019s say you have an affiliate link to a product you promote.<\/p>\n<p>This is a form of paid or sponsored link, because you might earn money from purchases users make through that link. <a title=\"Qualify Outbound Links for SEO | Google Search Central | Documentation\" href=\"https:\/\/developers.google.com\/search\/docs\/crawling-indexing\/qualify-outbound-links\" target=\"_blank\" rel=\"noopener\">Google recommends<\/a> you use the \u201csponsored\u201d attribute for paid link placements:<\/p>\n<pre>&lt;a href=\"https:\/\/example.com\" rel=\"sponsored\"&gt;Paid link&lt;\/a&gt;<\/pre>\n<p>Here\u2019s an example of this on WireCutter, a popular product comparison website:<\/p>\n<figure class=\"backlinko-image__screenshot backlinko-image backlinko-has-border\">\n<div class=\"backlinko-img-placeholder\"><\/div>\n<p><img decoding=\"async\" title=\"Wirecutter \u2013 Sponsored attribute for paid link\" alt=\"Wirecutter \u2013 Sponsored attribute for paid link\" data-aspect-ratio=\"0.88571428571429\" src=\"https:\/\/backlinko.com\/app\/uploads\/2025\/05\/wirecutter-sponsored-attribute-for-paid-link.png\" loading=\"lazy\" \/><\/p><\/figure>\n<p>You would also use this attribute for links other companies have explicitly paid you to include on your site.<\/p>\n<h4><span class=\"ez-toc-section\" id=\"UGC_Links\"><\/span>UGC Links<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>Use the user-generated content rel value on links in comments and forum posts. These are links you don\u2019t necessarily control, and this tells Google that you don\u2019t endorse them.<\/p>\n<pre>&lt;a href=\"https:\/\/example.com\" target=\"_blank\" rel=\"ugc\"&gt;External site you haven\u2019t verified&lt;\/a&gt;<\/pre>\n<figure class=\"backlinko-image__screenshot backlinko-image backlinko-has-border\">\n<div class=\"backlinko-img-placeholder\"><\/div>\n<p><img decoding=\"async\" title=\"Reddit \u2013 UGC links\" alt=\"Reddit \u2013 UGC links\" data-aspect-ratio=\"0.97428571428571\" src=\"https:\/\/backlinko.com\/app\/uploads\/2025\/05\/reddit-ugc-links.png\" loading=\"lazy\" \/><\/p><\/figure>\n<h4><span class=\"ez-toc-section\" id=\"Nofollow_Links\"><\/span>Nofollow Links<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>Use nofollow when none of the other rel values apply and you don\u2019t want Google to associate your site with the one you\u2019re linking to. Or when you don\u2019t want Google to crawl the page you\u2019re linking to.<\/p>\n<pre>&lt;a href=\"https:\/\/example.com\" rel=\"nofollow\"&gt;Link to a site you don\u2019t endorse&lt;\/a&gt;<\/pre>\n<p>Let\u2019s say you\u2019re not the one creating the links on your site so you can\u2019t verify them before they go live. Maybe you have a team of writers, or you\u2019re accepting <a title=\"Guest Blogging: The Definitive Guide\" href=\"https:\/\/backlinko.com\/the-definitive-guide-to-guest-blogging\" target=\"_blank\" rel=\"noopener\">guest posts<\/a>.<\/p>\n<p>But you know the links are not sponsored or in user-generated content. In this case, you\u2019d use nofollow.<\/p>\n<h4><span class=\"ez-toc-section\" id=\"What_About_%E2%80%9Cnoopener%E2%80%9D_and_%E2%80%9Cnoreferrer%E2%80%9D\"><\/span>What About \u201cnoopener\u201d and \u201cnoreferrer\u201d?<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>The \u201c<strong>noopener<\/strong>\u201d rel value tells your browser to go to the target link without giving the new location access to the page with the link.<\/p>\n<p>If you\u2019re using target=\u201c_blank\u201d then modern browsers will essentially treat it as if you have added noopener. But you can also use it on other links you don\u2019t necessarily trust but aren\u2019t using the _blank target value for. Like those you\u2019re also adding nofollow to.<\/p>\n<p>Using the \u201c<strong>noreferrer<\/strong>\u201d value hides the origin of any traffic sent through that link in the analytics of the site you\u2019re linking to.<\/p>\n<p>You can combine multiple rel values by separating them with spaces:<\/p>\n<pre>&lt;a href=\"https:\/\/example.com\" rel=\"noopener noreferrer sponsored\"&gt;Affiliate link&lt;\/a&gt;<\/pre>\n<h3><span class=\"ez-toc-section\" id=\"Absolute_vs_Relative_URLs\"><\/span>Absolute vs. Relative URLs<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>When creating an HTML link, you need to decide whether to use an absolute or relative URL in the href attribute. Each has specific use cases and advantages.<\/p>\n<p>Absolute URLs include the complete web address, starting with the protocol:<\/p>\n<pre>&lt;a href=\"https:\/\/example.com\/products\/item1\"&gt;Product page&lt;\/a&gt;<\/pre>\n<p>Relative URLs are shorter and reference locations relative to the current page:<\/p>\n<pre>&lt;a href=\"\/products\/item1\"&gt;Product page&lt;\/a&gt;<\/pre>\n<p>Generally, I\u2019d recommend you use absolute URLs in <strong>most<\/strong> cases.<\/p>\n<p>Using relative URLs can speed up production if you\u2019re working with lots of them. Plus, if you move pages or domains but keep the same URL structure, your internal URLs should all continue working without you having to change them all to the new domain.<\/p>\n<p>But honestly, unless you\u2019re planning a major <a title=\"Website Migration Checklist: Essential SEO Steps for Success\" href=\"https:\/\/backlinko.com\/website-migration-checklist\" target=\"_blank\" rel=\"noopener\">website migration<\/a> at the time you\u2019re setting up your site (unlikely), you aren\u2019t likely to foresee and then benefit from this relatively minor advantage.<\/p>\n<p>You might want to use relative URLs when working with a staging site that\u2019s on a different domain from the site you\u2019re developing.<\/p>\n<p>In this case, it can avoid you or your developers having to rewrite all the internal links when you push your site live.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"How_to_Check_Your_Sites_HTML_Links\"><\/span>How to Check Your Site\u2019s HTML Links<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>You can manually check the code of an HTML link in your browser with the inspect tool. Just right-click over the link you want to check and select \u201c<strong>Inspect<\/strong>\u201d to open up the developer console:<\/p>\n<figure class=\"backlinko-image__screenshot backlinko-image backlinko-has-border\">\n<div class=\"backlinko-img-placeholder\"><\/div>\n<p><img decoding=\"async\" title=\"Backlinko \u2013 HTML Link\" alt=\"Backlinko \u2013 HTML Link\" data-aspect-ratio=\"1.0828571428571\" src=\"https:\/\/backlinko.com\/app\/uploads\/2025\/05\/backlinko-html-link.png\" loading=\"lazy\" \/><\/p><\/figure>\n<p>This is handy for quickly verifying your attributes and rel values.<\/p>\n<p>But what if you want to check your links at scale?<\/p>\n<p>That\u2019s where a tool like <a title=\"Site Audit: Improve the SEO of Your Website | Semrush\" href=\"https:\/\/www.semrush.com\/siteaudit\/\" target=\"_blank\" rel=\"noopener\">Semrush\u2019s Site Audit<\/a> comes in.<\/p>\n<p>Just plug your domain in, let the audit run, and head to the \u201c<strong>Issues<\/strong>\u201d tab. Then type in \u201clink\u201d to highlight any issues with your site\u2019s HTML links.<\/p>\n<figure class=\"backlinko-image__screenshot backlinko-image backlinko-has-border\">\n<div class=\"backlinko-img-placeholder\"><\/div>\n<p><img decoding=\"async\" title=\"Site Audit \u2013 Backlinko \u2013 Issues \u2013 Link\" alt=\"Site Audit \u2013 Backlinko \u2013 Issues \u2013 Link\" data-aspect-ratio=\"1.0857142857143\" src=\"https:\/\/backlinko.com\/app\/uploads\/2025\/05\/site-audit-backlinko-issues-link.png\" loading=\"lazy\" \/><\/p><\/figure>\n<p>Go through and fix any issues to improve your site\u2019s SEO and user experience.<\/p>\n<div class=\"sc-quote alert blue-box font-georgia type-normal transparent-img-bg\">\n<div class=\"media\">\n<figure class=\"sc-picture media-left hidden-sm-down\">\n            <img decoding=\"async\" src=\"https:\/\/backlinko.com\/app\/uploads\/2024\/06\/icon-note.png\" alt=\"| Craig Hordlow\" loading=\"lazy\" title=\"| Craig Hordlow\">        <\/figure>\n<div class=\"media-body\">\n<blockquote class=\"sc-quote\">\n<p><strong>Note:<\/strong> A free Semrush lets you audit up to 100 URLs. Or you can use this link to access a <a title=\"Backlinko &amp; Semrush: 14-day PRO Trial\" href=\"https:\/\/www.semrush.com\/lp\/backlinko-offer\/en\/\" target=\"_blank\" rel=\"noopener\">14-day trial on a Semrush Pro subscription<\/a>.<\/p>\n<\/blockquote>\n<div class=\"media\">\n<figure class=\"sc-picture media-left hidden-md-up\">\n                    <img decoding=\"async\" src=\"https:\/\/backlinko.com\/app\/uploads\/2024\/06\/icon-note.png\" alt=\"| Craig Hordlow\" loading=\"lazy\" title=\"| Craig Hordlow\">                <\/figure>\n<p>                                <cite class=\"sc-name media-body media-middle\"><br \/>\n                                    <\/cite>\n            <\/p><\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>The post <a href=\"https:\/\/backlinko.com\/html-code-for-a-link\" target=\"_blank\" rel=\"noopener\">HTML Link Code: How to Create Hyperlinks on Your Site<\/a> appeared first on <a href=\"https:\/\/backlinko.com\/\" target=\"_blank\" rel=\"noopener\">Backlinko<\/a>.<\/p>","protected":false},"excerpt":{"rendered":"<p>HTML links (also called hyperlinks) are some of the most important functions of the internet. Google literally relies on them to find, crawl, index, and rank pages. Links have a lot of power, both in terms of user experience and your site\u2019s SEO. So, understanding how to code HTML links properly is key if you want to create links that help (not hinder) your website\u2019s performance. The Components of an HTML Link You create an HTML link using the anchor element: . You then use attributes [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":13262,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"h5ap_radio_sources":[],"cybocfi_hide_featured_image":"","footnotes":""},"categories":[8],"tags":[],"class_list":["post-13261","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-backlinko"],"featured_image_src":"https:\/\/craighordlow.com\/wp-content\/uploads\/2025\/06\/backlinko-seo-strategy-internal-and-external-link-EyTeNj-600x400.png","featured_image_src_square":"https:\/\/craighordlow.com\/wp-content\/uploads\/2025\/06\/backlinko-seo-strategy-internal-and-external-link-EyTeNj-600x600.png","author_info":{"display_name":false,"author_link":"https:\/\/craighordlow.com\/author\/craig\/"},"_links":{"self":[{"href":"https:\/\/craighordlow.com\/index.php\/wp-json\/wp\/v2\/posts\/13261","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/craighordlow.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/craighordlow.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/craighordlow.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/craighordlow.com\/index.php\/wp-json\/wp\/v2\/comments?post=13261"}],"version-history":[{"count":0,"href":"https:\/\/craighordlow.com\/index.php\/wp-json\/wp\/v2\/posts\/13261\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/craighordlow.com\/index.php\/wp-json\/wp\/v2\/media\/13262"}],"wp:attachment":[{"href":"https:\/\/craighordlow.com\/index.php\/wp-json\/wp\/v2\/media?parent=13261"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/craighordlow.com\/index.php\/wp-json\/wp\/v2\/categories?post=13261"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/craighordlow.com\/index.php\/wp-json\/wp\/v2\/tags?post=13261"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}