Divi Tips No. 110: Link anchors

Create links within the same page with Divi or WordPress

Updated on 19/06/24

1850 words

7 minutes of reading
41 comments

This article contains affiliate links recognizable by the percentage icon (%) → I am an affiliate link

Some of you certainly already know how create links within the same page (which point to a specific place on your page)... But when we start, it's not obvious... During my training, I see many learners who still have a little trouble with this practice. And to avoid always repeating the same things (lol), I decided to explain it in this article, it could help other people who would go through here

1 – Small reminder: what is an anchor?

Anchoring or "Link anchor' or "anchoring text" is the word under which the publisher of a site goes insert link. The link in question is a web address, also called URL.

The link can point to:

  • An internal page of your site. For example, for my blog, this could be a link to my contact page:
<a href="https://astucesdivi.com/contact">Me contacter</a>

In this example, "Contact me" is the link anchor to my contact page.

  • A page outside your site. For example, you link to an external site whose subject is related to the theme of your site or to your Facebook profile (regardless):
<a href="https://www.elegantthemes.com/">Découvrir Divi</a>

In this example, Discover Divi is link anchor to an external site.

  • A specific place within a page: you make a link to a section or paragraph within the same page:
<a href="#identifiant-css">Voir le paragraphe 3</a>

In this example, "See paragraph 3" is the link anchor to a specific section of my page.

You can see that the web address to which the anchor refers is not a classic URL, it is an identifier: #identifier-css.

And it is precisely this last point which raises some concerns when we begin and which deserves special attention, hence the subject of this article.

2 - How to create a simple link: external or internal?

For great beginners, let's first see how to create a simple link (external or internal) with Divi and WordPress...

With the Divi Visual Builder

Divi allows to place links in various ways. The traditional way is to highlight Link anchor contents in your text and click on the link icon to enter the web address, external or internal:

Insert a classic link with the Divi Builder

Divi also offers another possibility to insert a link: Link present in the tab Content of each module, line or section:

Link to a module with the Divi Builder

In this example, I placed a link on the module Image But I could have placed it on any other type of Divi module since each item in Divi has this tab Link.

Unlike the first example, not only the anchor text is clickable but the entire module.

With WordPress Editor (Gutenberg)

If you wish insert links within a page edited with WordPress (without enabling the Divi Builder), the procedure is identical:

Link Gutengeng 1

The only difference is that with the Gutenberg editor, you can only insert links on an anchor text (such as the animated image above), on an Image block or on a Button block. The other Gutenberg blocks do not offer the possibility of inserting a link on the entire block. For example, you cannot insert a link on a Tableau block.

Reminder: "Link Target" is the way your link should open. You can decide to open it normally (in place of the current page) or in a new browser tab. In HTML, it gives:

This link will open instead of the current page:

<a href="https://astucesdivi.com/contact">Me contacter</a>

This link will open in a new browser tab with the attribute target= »_blank » placed in the tag :

<a href="https://astucesdivi.com/contact" target="_blank">Me contacter</a>

3 – How to link to a section on the same page

Now let's see how to create a link that returns, not to another page of the site or to an external site, but to a specific section of your page.

For this, you will need to create a CSS identifier, which is called CSS ID.

This identifier ( CSS ID) must be unique in your page, you can only use it once, unlike CSS Classes that can be reused infinity.

LCSS ID allows us to name a web element and stylize it with CSS for example, but in our case this ID will be used for create an internal link within the same page.

Whether with Divi or Gutenberg, you have all the tools at your disposal to create CSS IDs and use them to make links in the same page.

Internal links in the same page with Divi

Here is an example of a link to be clicked at the top of the page that refers to a section at the bottom of the page:

Link within the same page with the Divi Builder

After clicking on the link, the page scrolls to the desired section (scroll). Now let's see how to do this:

Link to a section on the same page with Divi
Link to a section in the same page with Divi
  1. Edit the settings of the Section destination (the section to which the internal link must return).
  2. See you in the tab "Advanced" and use the CSS ID field to enter a unique term (which you invent), for example: Learn-more. Note that this CSS ID must not contain special characters, accents, capitals or space (only tiny ones and dashes).
  3. Then go to the element that must host your link: it can be a button, a call to action or an anchor text. Enter the anchor URL, for my example, it is #learn-more.

Here, the link that leads to a specific section of your page is created and is functional, it's as simple as that!

Note: CSS ID does not contain # – Internal link URL uses #

Internal links in the same page with Gutenberg

With Gutenberg, it's the same. Simply place a CSS ID on a block and create the corresponding link:

Internal link in the same page with Gutenberg
Make an internal link in the same page with Gutenberg
  1. Select the destination block to which the link should return
  2. In the sidebar, go to the tab Advanced > HTML anchor and enter an ID of your choice. For my example, it is my anchor.
  3. Elsewhere in your page, you can create an anchor text (or use a button block), by highlighting the element that will become clickable.
  4. Then click the Link icon.
  5. Enter the address: for my example, this is #my anchor.

You will understand, this practice is a great classic of HTML and this is why all the web editing tools allow to create internal link anchors in this way.

4 - How do I create a link to a section in another page?

A small precision, however, if you need to make an internal link to a specific section located on another page.

For example, you are on the "Contact" page and you want to link to a section at the bottom of your home page:

Internal Link Section Other Page

In this case, you will have to specify full URL address followed by CSSID. For example use https://mydomain.com/#lear-more/ for #learn-more Only, otherwise your link will not work.

Internal link to a section of another page
Internal link to a section in another page of your site (with Divi)

5 - Link of the menu that points to a section of a specific page

This is a fairly common use of internal HTML anchors: an item in the main menu of your site points to a section on a specific page.

For example, you find it unnecessary to create a contact page because a section of your home page might simply contain your form, but you would still like to indicate a link to this form in the main menu.

The approach is then identical to the previous explanations:

Link from the main menu to a section of the page
An item in the main menu points to a section of the page
  1. Place your form at the bottom of your home page. See you in the tab Advanced and enter a CSS ID. For example: my-contact-form.
  2. Then go to the tab Appearance > Menu of your WordPress interface and select the field "Customized Links".
  3. Enter the full URL of the page where your form is located (in my example, this is the home page) and add the CSSID at the end of the URL without forgetting the sign #. Example: https://mydomain.com/#my-contact-form/. Add this item to the menu and save your changes.

In this way, the form at the bottom of your home page will be accessible with just one click from your main menu and you Save creating a new page.

6 - Create a manual table of contents

Finally, another common use of internal HTML anchors is to create a table of contents within an article or page so that users can access parts (sections) of the publication more quickly.

Manual Table of Contents with Divi or Gutenberg
Create a manual table of contents with Divi (top) or Gutenberg (bottom).

You will then need to add a CSS ID to each of your sections or items in your page. For example, section-1, section-2, section-3, etc.

Then you can use a Text module for Divi or a numbered List block for Gutenberg and you will need to add your links manually to each item in the list. For example: #section-4 to return to the section that uses CSSID Section 4.

If you publish a lot of content and you need a summary on a regular basis, I would advise you to use a automatic table of contents that will save you a lot of time. If it is casual, the manual method will suffice and you avoid using a plugin additional.

7 - HTML anchor, link in the same page, link anchor...

It's a whole jargon! This article is a "return to basics" but it is super important to know them precisely...

Because nowadays, WordPress tools require so little knowledge that we would almost forget that they write code for us and if you know some tips of this kind, you understand better how WordPress works, Divi, Gutenberg or even other builders like Elementor and company.

And if you were looking how to make a link that points in a section of your pageI hope you found your happiness here!

Link to same page Divi or Gutenberg
Links to a Divi section

Get Divi

Divi training

Ebook Divi PDF

Free tips

Divi Quiz

Live coaching

icon 256x256
Discover my wpLingua plugin that makes your WordPress websites multilingual ! SEO-Friendly / Automatic / Editable

41 Comments

  1. ivan chosse
  2. Lycia Diaz
  3. Vero
  4. Vicky
  5. Lycia Diaz
  6. Adr111
  7. Lycia Diaz
  8. marie
  9. Lycia Diaz
  10. Julien
  11. Lycia Diaz
  12. Julien
  13. Lycia Diaz
  14. Olivier Guichon
  15. Lycia Diaz
  16. Olivier Guichon
  17. Olivier Guichon
  18. Lycia Diaz
  19. Lycia Diaz
  20. mapi
  21. Lycia Diaz
  22. Helene
  23. Lycia Diaz
  24. Nicolas
  25. Lycia Diaz
  26. Valéry
  27. Lycia Diaz
  28. Valéry
  29. Lycia Diaz
  30. laureline Graphillu
  31. Lycia Diaz
  32. laureline Graphillu
  33. laureline Graphillu
  34. Bruno
  35. Lycia Diaz
  36. myriam
  37. myriam
  38. myriam
  39. Quentin
  40. Mael & Zélie - Consultant SEO
  41. Lycia Diaz

Submit a comment

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

This site uses Akismet to reduce undesirables. Learn more about how your feedback data is used.