Anchor Macro

Add the Anchor macro to a page to link to a specific part of a page. 

This is useful on long pages, where you want to link to specific parts of the page. 

Don't see the Anchor macro? This macro isn't available in the new Confluence Cloud editor. See We're cleaning up our macros for alternative ways to link.

The example below shows an example of an Anchor macro as it appears in the editor, and as it would appear to someone viewing the page. 

On this page:

  1. Anchor macro as it appears in the editor
  2. Anchor macro as it appears when viewing a page (it isn't visible). 

Add the anchor macro to your page

To add the Anchor macro to a page:

  1. From the editor toolbar, choose Insert > Other Macros.
  2. Choose Anchor from the Confluence content category.
  3. Enter the anchor name - this will form part of your link.
  4. Choose Insert

You can then add a link to your macro from this page or another page. 

Linking to an anchor

To link to an anchor on the same page:

  1. Click the Insert Link icon.
  2. Choose the Advanced tab.
  3. Enter # followed by your anchor name in the Link field. For example #top.
  4. Choose Insert.

You can also link to an anchor on another page. See Anchors for more information on the different link syntax you can use.

Animation: Adding the Anchor macro to a page, then linking to that macro. 

Change the macro parameters

Macro parameters are used to change the behaviour of a macro.

To change the macro parameters:

  1. In the editor, click the macro placeholder and choose Edit.
  2. Update the parameters as required then choose Insert.

Here's a list of the parameters available in this macro. 

Parameter

Default

Description

Anchor Name

None

This is the anchor name that you will use when creating the link.

  • The anchor name can include spaces. Confluence will remove the spaces automatically when building a URL that points to this anchor.
  • The anchor name is case sensitive. You must use the same pattern of upper and lower case letters when creating the link as you used when creating the Anchor macro.

Where the parameter name used in Confluence storage format or wikimarkup is different to the label used in the macro browser, it will be listed below in brackets (example).

Other ways to add this macro

Add this macro as you type

Type followed by the start of the macro name, to see a list of macros. 

Add this macro using wiki markup

This is useful when you want to add a macro outside the editor, for example as custom content in the sidebar, header or footer of a space.

Macro name: anchor

Macro body: None.

{anchor:here}

Last modified on Jul 30, 2024

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.