You can create in-page links that open destination pages to positions other than the page title or that move to specific positions with within the current page. Such links are useful when one page contains several separate chunks of related information: you can link directly to the chunk of interest so that the user doesn’t have to look for it within the destination page. Usually, you want to link to a heading within a page so that is the only scenario described here.
As an example, this link jumps to the heading Destination that appears near the bottom of this page.
Instructions
These instructions double as an example by describing how to create the link in the paragraph above.
Part 1: Prepare the Destination
The destination chunk of information must exist before you can link to it. If it exists and already has a label (technical term: an HTML anchor), you can skip to Part 2.
- Open the WordPress editor to the page that contains the destination. In this example, the destination is the heading Destination below.
- Select the heading for the destination chunk and make sure the Settings panel is open on the right side of the screen.
- Under the type of the block — usually Heading or Text (Adv) — click Advanced to the right of General and Style.
If there is no Advanced option, the selected block cannot be the destination of a link. - At the bottom of the Settings panel, click Advanced again.
- When the Advanced settings expand, enter a label in the HTML Anchor box.
If there is no HTML Anchor option, the selected block cannot be the destination of a link.
The label can be any text that does not include spaces. For example, the label on the heading below is Dest.
Every label on the page must be unique. - Publish the page that contains the destination.
Part 2: Add the Link
- Return to page that contains the word or phrase that you want to convert to a link. In this page, the word “link” in the paragraph above the heading Instructions already is a link.
- Highlight the word or phrase and select Link from the edit menu.
- When asked to type the URL, do one of the following:
- For a link within the same page, enter # followed by the label you entered in step 5 above. For example, the destination address for the word “link” above is #Dest.
- For a link to a heading in a different page, search for the destination page or enter its slug. Then add # followed by the label. For example, the link address from another page to the heading below is slug-for-this-page#Dest.
- Publish the page that contain the link.
- Test by clicking the link.
Destination
If the page content below the destination is shorter than a visible page, the destination may not be at the top of the visible space after the linking. Instead, the page footer shows and the heading appears within the displayed portion of the page.