Apa Itu Hyperlink, Jenis, Contoh Cara Membuatnya

A hyperlink is a link that can be clicked or activated to take a user to a specific page, document, file, email address, or section of the same page. On websites, hyperlinks are most often text or images. Their function is more than just to move visitors along: well-designed links help people find information, make the site structure easier to understand, and support search engine crawling.

If you’re building a website, writing articles, or managing SEO, it’s important to understand the differences between hyperlinks, URLs, anchor text, internal links, and external links. This guide covers the types, HTML examples, steps for creating hyperlinks in WordPress, and how to check their security and usability.

What Is a Hyperlink and How Does It Work?

In web documents, hyperlink is an interactive element that points to another resource. In HTML, the most common form is the element <a> with attributes href. Browser reads the value href as a destination when a visitor activates a link using a mouse, touch screen, or keyboard.

A simple example is the text “Learn URL structure” that leads to a page about web addresses. When clicked, the browser navigates to the destination. To understand the destination address separately, read the explanation of the definition and structure of URLs.

Four important components of a hyperlink

  • Link elements: usually tag <a> which has href.
  • Destination address: Absolute URLs, relative addresses, fragments like #contoh, or a suitable scheme such as mailto:.
  • Link text or content: called anchor text on text-based links; should explain what the reader will find.
  • Navigation behavior: can open the same location, new tab, download files, or launch applications according to the attributes and type of URL.

In SEO practice, the term anchor text also discussed when evaluating link context. See the specific discussion of anchor text in SEO to differentiate that term from HTML tags. <a>.

Hyperlink is not a URL, button, or backlink

URL is the address or identifier of the resource location, whereas hyperlink is an element that takes the user to that address. Buttons typically perform actions in the interface, while links are primarily used for navigation. backlink refers to links from other sites to your site; only a small fraction of all hyperlinks on the web. A full explanation is available in the article “what is a backlink?”

Implementing SEO for UMKM, small and medium enterprises is now affordable. We help Indonesian UMKMs and small businesses grow through digitalization

Types of Hyperlinks and Examples of Their Use

1. Text hyperlink

Text hyperlinks display clickable words or phrases. For example, “Read the technical SEO guide” is a clearer anchor than “click here.” Text should still be easily recognizable as a link even if users cannot distinguish colors; underlining or a clear focus style is helpful.

2. Image hyperlink

Images can be links, such as a logo that takes the user to the main page or an article card that leads to a full discussion. When the image is the only content of the link, the attribute alt It is important to explain the purpose or function of the image, not to repeat irrelevant descriptions. Don’t use image links without names that readers with assistive technology can understand.

3. Inline or contextual hyperlinks

Inline hyperlinks are inserted within paragraphs that explain a concept. For example, when discussing navigation, the author can refer to the navbar function without disrupting the reader’s flow. This is the most natural format for recommending additional reading.

4. Anchor link or fragment link

Fragment links take readers to elements with specific IDs, such as from the table of contents to the FAQ section on the same page. A similar use can be found in website breadcrumb navigation, although breadcrumbs themselves are hierarchical collections of links between locations, not simply fragments.

5. Internal hyperlink

Internal links connect pages within the same website. An example of this might be a technical article discussing technical SEO, then linking to more specific reading about XML sitemaps or the website crawling process. The relationships between topics help visitors and crawlers understand the site’s structure; this doesn’t mean every article should be filled with dozens of contextless links.

6. External hyperlink

External links to different domains, such as references to platform documentation or standards bodies, should be selected based on their support for the claims made. For outbound links that open in a new tab, use the appropriate security attributes and be aware that switching contexts can impact the user experience.

7. Absolute URL and relative URL

Absolute URL include schemas and domains, for example https://example.com/panduan/. Root-relative URL begins with a slash like /panduan/, whereas document-relative URL can be written panduan.html or ../panduan.html. Relative addresses are resolved based on the document’s base address; this doesn’t mean they can always be opened without an internet connection. Incorrectly used paths can result in broken links when the page is moved.

How to Create a Hyperlink with HTML

You don’t need JavaScript to create basic web navigation. Use anchor elements with valid destination attributes. The example below is code shown as an example, not an active link in the article.

1. Create a text-based hyperlink

<a href="https://example.com/panduan/">Baca panduan lengkap</a>

Element href contains the URL, while the content between the opening and closing tags is the text the user reads. Choose words that describe the purpose, avoiding generic phrases like “here” when the context of the purpose is unclear.

2. Create a link on the image

<a href="/produk/">
  <img src="/images/katalog.jpg" alt="Lihat katalog produk">
</a>

Make sure the image file is actually available and the value alt reveal the function of the link. If the link also has equivalent descriptive text, don’t repeat the same information excessively.

3. Create a link to a section of the page

<a href="#faq">Lompat ke pertanyaan umum</a>
<h2 id="faq">Pertanyaan Umum</h2>

Value after # must match the attributes id target element. Don’t use the same ID for multiple sections, as fragment navigation can become erratic. The fragment structure can also be utilized in long-article tables of contents.

4. Using absolute and relative URLs

<a href="https://example.com/tentang/">Tentang kami</a>
<a href="/kontak/">Hubungi kami</a>
<a href="../panduan/">Panduan di direktori induk</a>

Absolute URLs are useful when pointing to external domains. Relative paths often make it easier to manage links on the same site, but should be tested based on directory structure and base URL document. Changing the path name or slug of a page without proper handling can cause the old URL to fail to be accessed.

5. Open external links in new tabs

<a href="https://example.org/referensi"
   target="_blank"
   rel="noopener noreferrer">Buka sumber referensi</a>

Attribute target="_blank" usually asks for a new browsing context. noopener prevent the destination page from being accessed window.opener, whereas noreferrer also holds referrer information in the header Referer. Modern browsers do implement protection noopener implicitly to _blank, but explicit attributes help indicate implementation intent. Consider privacy, analytics, and accessibility needs before adopting the new tab behavior broadly.

6. Create email and download links

<a href="mailto:[email protected]">Kirim email</a>
<a href="/files/checklist.pdf" download>Unduh checklist PDF</a>

mailto: can call the email application according to the device settings. Attributes download can be used for files that the browser allows, but its behavior depends on the origin, response headers, and browser configuration. Don’t assume that every PDF link will always download automatically.

How to Add Hyperlinks in WordPress

For authors who don’t edit HTML directly, WordPress provides a link feature in the content editor. The name and position of the control may vary slightly depending on the Classic Editor, Block Editor, or editor plugin.

Via Block Editor (Gutenberg)

  1. Open an article or page that you have permission to edit.
  2. The block of text you want to link to in the relevant paragraph block or heading.
  3. Select the link icon on the toolbar, or use the editor-supported link-adding keyboard shortcut.
  4. Enter the full URL or search for the internal page you want to go to.
  5. Confirm the link, then use Preview to check the destination and link text before updating the article.

For projects that frequently change slugs or undergo migrations, regularly check important links. If the address change is permanent, understanding 301 redirects and choosing a WordPress redirect plugin can help maintain access to the old location.

Via Classic Editor

In the classic editor, select the text, click the link button, enter the destination URL, and then save. Use the HTML/Text tab only when you need to check attributes such as target or rel. After the update, review the public view results as plugins, themes, or sanitization filters may affect the saved HTML.

What are the Benefits of Hyperlinks for Users and SEO?

Clearer navigation

Hyperlinks help users move from introductory information to more specific information without having to search again. Websites can combine menus, breadcrumbs, tables of contents, and contextual links to suit the reader’s needs. Each has a different function; repeating the same link over and over again does not automatically improve usability.

Page discovery by crawler

Google Search Central explains that links are in the form of <a href="..."> generally crawlable. A crawlable structure helps URL discovery, but discovery doesn’t guarantee a page will be indexed by Google. Pages must still meet indexing and relevance requirements. For a broader discussion, read our explanation of on-page SEO.

Topic context and relevance

Descriptive anchor text helps readers and search engines interpret what’s on the landing page. Link information that truly complements the topic; for example, an article structure guide might address how to create SEO-friendly articles, while a technical audit might address important on-page SEO elements. Google doesn’t specify a mandatory number of internal links for each page. Quality and context are more important than simply chasing numbers.

Reference sources and attribution

Links to official documentation allow readers to review statements, technical limitations, or policy changes. This doesn’t mean all external links automatically improve rankings. In link building and off-page SEO, the quality, rationale, and clarity of link relationships are more important than collecting links without consideration.

Common Mistakes in Creating Hyperlinks

1. Anchor text is too general

The text “click here” is difficult to understand if the user only sees a list of links without a surrounding paragraph. Use phrases like “guide to creating a sitemap” or “check the anchor HTML documentation” to clarify the purpose. W3C accessibility standards emphasize the importance of link names that convey the purpose in context.

2. Broken links and long redirect chains

Changed URLs, deleted documents, or typos can result in access errors. Regularly audit links, especially after migrations, category changes, and slug updates. Don’t use chain redirects without reason; evaluate whether the final URL is truly the most appropriate.

3. Misunderstanding canonical, redirect, and link

Hyperlinks take readers to the destination URL; elements rel="canonical" A canonical URL is chosen to signal the page’s canonical URL, while a redirect redirects the HTTP request. The three features are not interchangeable. Canonical URLs are helpful when multiple addresses contain similar content.

4. Opening new tabs without consideration

New tabs can be useful for external references, but users need to understand that doing so changes the browser context. If site policy requires that outbound links open new tabs, enforce them consistently and include security attributes. Do not enforce target to the address in the code example or to the iframe source; the rules apply to the actual click link element.

5. Adding tracking parameters without testing

Campaign parameters help with attribution when used correctly. Avoid automatically adding parameters to internal links, as this can skew session source readings in certain analytics tools. For external campaign links, understand the concept of UTM tracking and ensure the URLs point to the intended location.

A Quick Checklist Before Publishing a Hyperlink

  • Is the link destination correct, accessible, and relevant to the context of the sentence?
  • Does the anchor text describe the content or action on the landing page?
  • Are internal links pointing to active article URLs, not drafts, improper archives, or unnecessary redirects?
  • Do image links have alternative text that explains their function?
  • Does the fragment link point to the correct and unique element ID?
  • Do external links that open new tabs have security attributes according to site policy?
  • Does the example markup inside the code block remain text, not accidentally turning into an active link?
  • Are paid or user-generated links given the appropriate rel attribute, such as sponsored or ugc, if needed?

FAQ about Hyperlinks

Do all hyperlinks use text?

No. Links can enclose images or other HTML-permitted content. However, users still need a name or adequate description to understand the navigation purpose.

Are hyperlinks and backlinks the same?

No. A backlink is a hyperlink from another site that points to the site being analyzed. Hyperlinks include all navigational links, including internal links, page fragments, email links, and outbound links.

Does adding lots of internal links definitely improve ranking?

No amount guarantees ranking. Internal links aid navigation and page discovery, but ranking involves many factors and content quality. Prioritize topical relationships that make sense to readers.

How to know if a hyperlink is broken?

Click or test destinations from public pages, check URL responses, and use crawl tools for regular audits. Remember that a successful HTTP status doesn’t necessarily mean the destination page is relevant; review its content and canonical content as well.

Conclusion

Hyperlinks are the foundation of web navigation that is most effective when they have a clear purpose, informative text, correct HTML, and regular maintenance. Start with the visitor’s needs: determine useful follow-up information, use elements <a href>, test the intent, and consider accessibility and security. For SEO, treat links as connectors to useful information, not just numerical targets.

Official Reference

Oh hi there 👋
It’s nice to meet you.

Sign up to receive awesome content in your inbox, every month.

We don’t spam! Read our privacy policy for more info.

Rijal Fahmi Mohamadi

I bring an engineer’s analytical mindset to Digital Marketing. Leveraging my background in software development, I specialize in SEO, SEM, social media, and data analytics to help businesses scale and drive profitability in remote setups.

P.S. I haven't lost my coding touch! I'm highly proficient in PHP and currently expanding my data analytics toolkit with Python."

Leave a Reply

Your email address will not be published. Required fields are marked *