Documentation for Confluence 5.8 (Server).
Documentation for Confluence Cloud and earlier versions of Confluence is available too.

Skip to end of metadata
Go to start of metadata

You can use anchors to enable linking to specific locations on a page, and they can be especially useful for allowing your readers to navigate to specific parts of a long document. Anchors are invisible to the reader when the page is displayed.

There are two steps to using an anchor:

Step 1: Create the anchor

Step 2: Create a link to the anchor

Step 1: Create the anchor

Add the Anchor Macro to mark the location you want to link to:

  1. Do either of the following in the Confluence editor:
    • Choose Insert > Other Macros, then find and select the Anchor macro
    • Type { and the beginning of the macro name, then select the Anchor macro
  2. Enter the Anchor Name (For example, 'bottom' or 'important information')
  3. Choose Insert

On this page:

Related pages:

Macro options (parameters)

Parameters are options that you can set to control the content or format of the macro output. 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).

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.

Step 2: Create a link to the anchor

You can link to an anchor from:
  • A page on the same Confluence site. The link may be on the same page as the anchor, another page in the same space, or a page in another space on the same Confluence site.
  • Another web page or another Confluence site, using a specifically formatted URL.

Link to an anchor on the same Confluence site:

  1. Select some text or position your cursor where you want to insert the link
  2. Choose Link in the toolbar or press Ctrl+K
  3. Choose Advanced and enter the anchor name in the Link field, following the format below.

    Anchor locationLink syntax for anchorExamples
    Same page#anchor name

    #bottom

    #important information

    Page in same spacepage name#anchor name

    My page#bottom

    My page#important information

    Page in different spacespacekey:page name#anchor name

    DOC:My page#bottom

    DOC:My page#important information

    (info) The anchor name is case sensitive, so you need to use the same pattern of upper and lower case letters as you used when creating the Anchor macro. You need to enter page and anchor names with spaces when you link to them in the same Confluence site.

  4. Enter or modify the Link Text (this is the text that will appear on the page. If this field is left blank, the page name or URL will be used as the link text)
  5. Choose Save

Screenshot: The 'Advanced' option in the link dialog

Link to an anchor from another web page or another Confluence site:

Use a full URL in the following format:

Link syntax

Examples

http://myconfluence.com/display/spacekey/pagename#pagename-anchorname

http://myconfluence.com/display/DOCS/My+page#Mypage-bottom

http://myconfluence.com/display/DOCS/My+page#Mypage-importantinformation

Notes about the full URL:

  • The page name is repeated in the URL, after the # sign. The second occurrence of the page name is concatenated into a single word, with all spaces removed.
  • There is a single dash (hyphen) between the concatenated page name and the anchor name.
  • The anchor name in the full URL is concatenated into a single word, with all spaces removed.
  • The anchor name is case sensitive.

Notes

  • Table of contents on a page: Consider using the Table of Contents Macro to generate a list of links pointing to the headings on the page. The list of links will appear on the page, and will be automatically updated each time someone changes the wording of a heading.
  • Linking to headings: You can link directly to the headings of a page. See Working with Links. However, if someone changes the wording of a heading, those direct links will be broken. Use the Anchor macro to ensure a lasting link within the body of a page.
  • Site welcome message: If you are adding an anchor to a page that you are using in the site welcome message, you can only link to that anchor from another page. Internal links within that page will not work.
  • Templates: When you are previewing a template, a link to an anchor is displayed as a 'broken' link. However, when you create a page using the template the resulting page will have the correct link.

89 Comments

  1. In confluence 4.2, if you a add a link to an anchor using \[#anchor name\], it renders as #anchor name.

    In previous version the link text would not have the #, which is correct.

  2. Anonymous

    I have a similar issue. When I create the link to the anchor (which is near the bottom of a long page), the link brings me to the first topic on the page, which is incorrect. There's no anchor on this topic, so I can't figure out why it's going there instead of the anchored text. 

    1. Anonymous

      Update: it's not going to the topic but is directing to the TOC macro, where the heading appears. This is not correct; I want it to link directly to the bottom of my lengthy page, where the topic actually is. 

      1. I'm experiencing this issue as well.  Anyone have a solution?

        1. Hi all. I wasn't able to reproduce this on Confluence 4.3, so I'd recommend raising an issue in https://support.atlassian.com so we can investigate it with you. In future if you're having trouble that's the best place to start - these comments aren't usually monitored, so you'll get a much quicker response going through the support channel.

          1. Has this been resolved? I can't find anything on the support site about this, but I am having the same issue in 4.3.

            Thanks.

            1. Anonymous

              I got the same issue on 4.3.2, it jumps to the TOC entry.

              1. Anonymous

                I've got the same issue on 4.3.7.

                1. Anonymous

                  I think this happens, if you manually place an anchor in the headline. Then the anchor will appear in the TOC, so the link will jump to the first anchor, which is the TOC.

                  Instead just use the headline as a link, since anchors are automatically created for headlines.

                  Example: #My first headline

                  (You can keep the spaces as spaces)

                  1. Anonymous

                    This fix worked for me. 

                    1. Anonymous

                      If you want to use an anchor to prevent link breakage, put the anchor directly above the heading and ensure it's set to "paragraph." This works great for me.

  3. Anonymous

    How about linking to a page with an id?

    1. If the page is showing an ID because of a special character in the URL, do the same as described above in "Creating a link to an anchor," except url encode the special character in the anchor name.

      Page title: This & That
      Anchor name: foo
      Link

      https://sitename.com/pages/viewpage.action?pageId=15003344#This%26That-foo

      Not sure if it's supported, but it seems to work. (smile) 

  4. Can you make the TOC move with you as you scroll down the page?

  5. Anonymous

    How to create a link to an anchor when pagename has a colon (:) in its name? Example:

    Following page title "First step: buy food" is incorrectly recognized as "spacekey: pagename" and because the First step space doesn't exist I can't make a link to an anchor.

    What if the name of the page containing the anchor will be changed? Will link be updated as well (automatically)?

    Regards,
    Michal

  6. Anonymous

    I need to find out if there are links to a given anchor.

    (reason: I need to check if an anchor can be deleted)

    Is that possible?

    THX and regards

  7. I have trouble using the anchor macro to create a "Return to top" link. 

    I insert the anchor "Top" in the very beginning of my page (I tried both the wiki markup and inserting the ready-made anchor macro). Then I make a link to this anchor by going to Insert > Link > Advanced. I enter #Top in the "link" field. After saving the page and testing, my Return to Top link takes me away from my page and to the Homepage of confluence!  I just can't find what I'm doing wrong...

    Thanks for helping out.

  8. Anonymous

    #Top didn't work for me either.  I gave it a more unique name #ExportTop and that worked.

    Process Defined:

    1. Insert > Other Macros > Anchor
    2. Name uniquely MyAnchor (Copy This)
    3. Insert
    4. Highlight text to be link
    5. Click 'Link' and enter # and paste.
    6. Save
    1. Where did you inserted the anchor?

      It seems that it is not possible to insert it at the headline.

      So a "back to top" button will online go short befor the top.

      Did anybody have a solution therefor?

      Cheers, Chris

  9. Anonymous

    I would like to use an existing id in the confluence page html frame to realize a "Top" link.
    If I try to use an existing id like "content" or "page-metadata-end" confluence starts it's usual "i have to calculate titel and anchor" and the link goes to nowhere.
    Any ideas, how to use "#content" or sth. without confluence changing the link code?!
    Thx!
    Matze 

  10. Anonymous

    I was struggling with Anchors quite a bit till I tried using the Advanced Link tool rather than the basic page link. Then they worked fine.

  11. Anonymous

    Can someone direct me to where the Advanced Link tool is? I can't identify where that is, and that is why I can't make use of the anchors.

    1. Hallo Anonymous

      The 'Advanced' option is a tab on the 'Insert Link' dialog. I've added a screenshot to the page, to make it clearer. Here's the screenshot:

      If your Confluence site doesn't include the 'Advanced' tab in the dialog, then you may need to upgrade to a later version.

      Cheers

      Sarah

       

  12. Anonymous

    Yes – I do not see the "Advanced" tab in the Link menu. Upon further investigation, it seems as if our company is using Confluence 3.5.17. If you know of how it would be done in this version, it'd be great to be pointed in that direction.

    Thank you for pointing that out!

    1. Hallo there

      Ah, Confluence 3.5. (smile) You can use wiki markup to link to an anchor. The documentation is here: https://confluence.atlassian.com/display/CONF35/Working+with+Anchors

      Cheers, Sarah

  13. Anonymous

    Hi there,

    I am working with decks and cloaks to sort information and avoid numerous sub-pages. I am experiencing though that anchors do not work within decks. I expected that the respective "tab (of the deck)" opens when I link to an anchor in the content. Yet it always directs to the first tab. Is there a workaround or other possibility to direct to different tabs?


    Thanks for your support!

    1. Anonymous

      Yes. This can be done. Use the {show-card} macro to create a link to a specific card in a deck.

      I am not happy. I am really not happy. To answer your question I just edited a new page using the Confluence Editor which had a solution which could really help. THE EDITOR KILLED 20 MINUTES OF MY WORK. I have no answer now. I feel terrible. I wrote this up in a page and now it is gone. Just gone. I can't copy it out somewhere else BECAUSE IT IS IN THE CONFLUENCE EDITOR !$^!@$ AND NOT IN WIKI MARKUP.

      So. It's gone. I have just wasted my time. This is not the first time this has happened. I would be editing a page. I look at the page and think 'it's okay, when I click save it will be there if something stuffs up'. NO. IT ISN'T. Stupid editor. Damn stupid editor. Not only does it get in my way, reduce my content to only that which is headings and paragraphs under headings (heaven help you if you put macros on the page because the outcome is a page full of boxes taking up the whole screen in a huge mess) but it just destroys my hard work. My work. My time.

      There must be a better way. I am tired of creating brand new content and then having it destroyed.

      I could really help you but atlassian's editor is making my life hell. So, I give up. Sorry. I am just depressed.

  14. Anonymous

    Hello,

    I'm having an issue where anchors do not work when using the 'Include Page' macro on another Space.  When clicking the anchor link, the page does not goto the specified spot, however on the original page it works.  Any thoughts?

     

    Thank You in Advanced.

  15. Anonymous

    What do we do if our anchor looks like this? Widget+Documentation#WidgetDocumentation-<CollectionOperation> I can't seem to get it to work becuase it keeps complaining about the "<" and ">" in the link name. If this is an issue, why does Confluence allow for that link to be created in the first place?

  16. Is it possible to anchor the Confluence header throughout spaces in Confluence?

  17. Hi Atlassian, I would like to ask you what are the reasons for the anchor name to be changed as described above, e.g. #pagename-anchorname, instead just #anchorname? Also is there any way to configure this? Please elaborate the reasons, because we want to create our own macro that wouldn't add prefix to the anchor name, so we would like to know if there is any good reason why there should be a prefix?
    Thanks 

    1. I am talking about external links. (smile)

  18. Anonymous

    Why in the world does confluence add the page name to the resulting anchor? If I create an anchor 'foo', I want to be able to link to that page (from an external page, site whatever) with '<Page-URL>#foo'. This is why I named the anchor 'foo' in the first place!

    And even worse: Renaming the page actually changes the anchor! (So my 'stable' external link to the Wiki with '...?pageId=74580125#foo' breaks).

    1. Anonymous

      Sorry for the duplicate. Had a timeout the first time and hit the send button again a few hours later...

      1. Thanks Anonymous, I've removed the first duplicate. I'm sorry about the frustrating link format. There's an issue on our issue tracker, where you can vote and comment, and watch for progress: CONF-5833 - Use shorter anchor names in HTML rendering mode Resolved

        Cheers

        Sarah

  19. Anonymous

    Sorry I dont think I have a clear response to the post about the anchor not directing to the specific section where the anchor is located.   I am trying to use the anchor macro vreating a link from one page to another on the same site using syntax format page name#anchor name. after saving if I click the link it does not take me to the specific section where I have added the anchor, I still need to scroll down to find the section I intend to go. Please respond as soon as possible.

  20. Dear All,

    I prepare a globale template with summary and anchor to refer to a part of procedure.

    When I try to add hyperlink with anchor, I receive error message "Internal server error".

    Can I use hyperlink & anchor in a global template?

    Do you have a solution?

     

    Thank you for your help

     

    Cedric DEVAUX

  21. Anonymous

    This is really useful. I didn't know <a href="http://swc.bc.ca/services">bc anchors</a> could be so useful. I'm going to start using them.

  22. Anonymous

    Hi there,

    In the Creating a link to an anchor section (above), the content in the Link syntax for anchor section is incorrect.

    The equivalent content in the documentation for Confluence 5.1 was correct. Could you please update this content above?

  23. From JIRA can I link to a page anchor?

    1. To link from JIRA to a Confluence page, you need the full URL.  This works for anchors too.

      The hard part is getting the URL with the anchor. 

      If your purpose is to link to a section heading on the page, the anchors are already there. One trick I use is to add a toc to the Confluence page.  Then you can right-click on the link to the section in the TOC, and Copy Link Location.  Now you have a URL you can paste into your JIRA page.

  24. Is there a way, when entering wiki markup, to display an anchor without the '#' sign in front? I've tried both:

    [#anchor|anchor] 
    and
    [#anchor:anchor]

    with unsuccessful results.

    1. what about

      [anchor link text|#anchor]

      Just a friendly reminder. For this kind of questions, the best site to get them solved fast is in Atlassian Answers.

  25. Has the following bug been posted?

    1. Use the Advanced method to add the link to (say) SPKEY:Another Page#hereiam
    2. Save page. Anchor works.
    3. Edit the page again, and click on the link to edit it.
    4. Advanced window appears, and link says Another Page#hereiam (i.e. it loses the space-key).
    5. If you save from the Link Edit window (without changing anything), you've now broken the link.

    (Using Confluence 5.1.3.)

    1. Anonymous

      Yeah, that's like the problem I'm having as well.

      Adam

    2. CONF-28087 - Space key is missing when editing links to anchors on other pages Open

  26. Found the JIRA ticket for this exact problem.

    CONF-28087 - Space key is missing when editing links to anchors on other pages Open

    I voted for it ... others should too if they run into this problem.  It's an annoying one because it makes it really easy to break a link, and then you have to start over.

     

  27. Anonymous

    I've added anchors and then link to them from another page. The page with the target anchors is quite long and anchors are in cells in a table. The links to them use the format Page name#AnchorName. Note that the page name has a space in it, so I am including that. When I click the links, the target page does not open to the anchor location. It is always off a bit. I have to scroll up or down to find the item associated with the anchor.

    Does anyone have ideas about why this is happening?

    Thanks.

  28. It appears that this functionality is completely broken in 5.2.2. We recently upgraded, and I was able to add anchors in 5.1.2, but now when I create an anchor in a page and then try to link to it in the same page using Advanced Link as described in the document above, the link is added but does not work when you click on it. When I hover my mouse over the link, the URL shows the anchor as #page_title-AnchorName, but it doesn't take you to the spot in the page where I created Anchor Name.

  29. I'm having the same problem. My anchors that I created in a previous version still work but if I try to create a new anchor it will not take me to the page location but just to the top of the page.  We're on On Demand Confluence 5.2 and JIRA 6.1.

  30. Hi Melissa LanningMelody Bliss

    I've tried to reproduced the issue without success, it might be some special issue happen on your instance, can you please create support ticket so that we can help you to fix the issue? 

    Thanks 

    MOMO

  31. Anonymous

    My mistake, we are on Confiuence 5.1.5. I will log a ticket for this, though.

  32. Is it jus me or is the Anchor tag not working in Confluence 5.0. When I try to create an anchor on the same page it doesnt work.

    The content in the examples above are wrong.

  33. Anonymous

    Can we add an anchors into a template and be able to link to it within the page?  For instance, I want to create a link in my page template that sends me back to the top of my page. 

  34. It's not just you.  I just upgraded to 5.3 and can no longer create an anchor link.  Atlassian . . . Help!

    1. It seems to be a bug:  CONF-31139 - Not a Recognised Space Error When Creating Anchor Link Open

  35. Has this been fixed? Cannot add link and anchor to a page, in version 5.1.

    Thanks

  36. What I've found, believe it or not, is that it sometimes (but not always) works if you define short anchors–two characters or so. 

    1. Thanks! Unfortunately your tip did not work for me–I tried 2 and even 1 character anchor names. My experience has been somewhat similar to yours in that in general the whole anchor/link functionality is quite erratic–sometimes it works, sometimes it doesn't....

      Thanks again

       

  37. Anonymous

    How can I list all anchors on a page?

  38. It would be great that if the anchor is in an expand section that when the link is clicked on the expand is automatically opened. Please vote for the issue CONF-27357

    1. I wrote a short piece of javascript to fix this; you can check it out on the page for issue CONF-27357.

  39. Could you perhaps consider making this usable? I had access to better anchor manipulation tools in 1995. How about a toolbar button for inserting an anchor? How about a choice in the create link dialog box that doesn't require hand surgery?

    1. Hi Alex, I agree. I'm afraid, its a bit of a pain point for us tech writers too.  If you haven't already done so, comment or vote on this ticket   CONF-25533 - Provide a nicer way to link to page anchors Open

  40. Hello!

    I'd like to know how can i create permalink to specific place of another page. I need link like something this: "page-ID#anchor name". Because standart link to anchor "page name#anchor name" will break if i'll change name of this page.

    1. Hi Oleg,  If you create a link to an anchor on another page using the method shown below, the link will automatically update if you rename the page containing the anchor (I believe this was introduced in Confluence 5.3). 

      Note that this will only work for anchors, not headings, and not weblinks

  41. Hello Rachel. I checked it. Link didn't automatically update after renaming the page. I checked a lot of link variety, it doesn't work for anchors. My confluence version is 5.5.

    Does exist any additional variety of creating permalinks?

  42. Sorry about duplicate. The system showed error after pressing reply-button.

    1. Hi Oleg, that is very strange because I tried it in Confluence 5.5 too - with an anchor on a different page in the same space and on a different space!   Is your page in the same space or a different space? 

      The exact steps I followed were:

      1. Create a page called Page 2
      2. Add an anchor macro to the page and call it anchor
      3. Create a page called page 1
      4. Add a link to the anchor (Insert link > Advanced > Page 2#anchor)
      5. Tested the link
      6. Renamed page 2 and returned to Page 1 and tested the link - it linked correctly. 

      I also repeated this test with a page in a different space - in this case in the advanced tab i specified SPACEKEY:Page 2#anchor

      If the steps above do not work, please contact support as there might be something wrong with your content indexing. 

      As for other methods of doing this, you can use a permalink (Tools > Link to this page) but I don't think you can specify an anchor. 

      1. Rachel thank you very much, It works! I think, i forgot to edit-save page with link for changing link automatically. These steps i followed:

        1. Create a page "Page 2"
        2. Addd an ancor "anchor"
        3. Create page "Page 1"
        4. Add link to the anchor "page 2#anchor"
        5. Link works correctly
        6. Rename "page 2" to "page 21"
        7. Edit and save page "page 1" for auto changing link
        8. Links works correctly

        Step 7 is very important. Without this step link doesn't work.

        1. I am having this issue as well; the solution you and Rachel described does not seem adequate, as it does not seem feasible to revisit every page (e.g., your "page 1") that links into the anchor of the target page, and force a new Save of that page when the target page (e.g., your "page 2") is renamed.  Am I missing something here?

          I tried to "Reindex Content" as an admin to see if that refreshed the link, but it did not.

          1. Hi Oleg and Ray - I did not have to revisit or edit the original page for this change to take effect.  It might be worth contacting support for further assistance with this. 

            1. Thanks for the reply, Rachael ... after further testing, it seems I merely need to refresh "page 1", and not re-save it.  After refreshing the page, it updates the page listed in the Advanced tab of the link with the new name of the target page.

              That is a bit more workable, so thanks for chiming in.

  43. I created 57 table cell anchors and have tried to link them from various pages in one space and it doesn't work. The link goes to a random location on the page but not to the correct table cell. Any suggestions?

  44. I use Brikit and anchors with names that have spaces do not work.  So I strongly advice you to avoid any spaces in the names of the anchors.  That could save you some troubles if you use Brikit or who knows what other design tool

  45. "Find and select the required macro."???

    Why is this not "Select the Anchor macro."?

    The instruction as written is not user-friendly. It requires users to do more work to figure out what you mean. Be specific!

  46. How do you easily add a link to an anchor?

    I have text in a page like this

    FS_VMI_LOGIN

    with an anchor called FS_VMI_LOGIN

    It seems like when I want to link to this, I have to type in full:

    https://mycompany.atlassian.net/wiki/display/VMS/VMS+Functional+Spec#VMS+Functional+Spec-FS_VMI_LOGIN

    That's completely unworkable.

    Is there no way to select the anchor's URL for paste, somehow?

     

    1. Hi Martin,

      It all depends on where the anchor is in relation to your link.

      If they're on:

      • the same page – you only need to specify the anchor name in the Advanced section of the link dialog – for example, #anchor name;
      • a different page in the same space – page name#anchor name
      • a different space – spacekey:page name#anchor name

      If you're linking from another site to an anchor in Confluence, then yes, you would need to specify the full URL.

      1. Right, thanks - I've worked out that I can type 

        VMS Functional Specification#FS_VMI_LOGIN

        So it's not completely unworkable.

        It's very cumbersome still, though...  to be really useful, you should just be able to right click on an anchor and get it's link, or type the anchor name in and have it appear via Confluence finding it....  I was planning to have a lot of these anchors, and refer to them (for traceability).   I'm having second thoughts about that - just too cumbersome.

  47. Why is it that when you type [  in the editor, you can't select anchors?   That'd be ideal...

    1. Feel free to watch and comment on this issue, which seems like it's asking for similar functionality.

      CONF-25533 - Provide a nicer way to link to page anchors Open

      1. Nearly 3 years old.  I guess I shouldn't hold my breath (sad) 

  48. If I add a link like fullURL#achorname to a page in Confluence 5.6.3, this link will work. When I try the same in JIRA 6.3.1, it does not. I tried the options Confluence Page as well as Web Link in JIRA's Link screen but without success.

    The whole anchor affair is a time-consuming business and it annoys our users.

    1. Hi Evelin,

      From JIRA, you'd need to use the format for linking to an anchor from another site. So it would be:

      http://myconfluence.com/display/spacekey/pagename#pagename-anchorname

      1. Giles, note that there are exceptions to the syntax you laid out above.   For instance, when a page name begins with a number – e.g., "2015-03-18 Meeting Notes" – the syntax would have to be: http://myconfluence.com/dispay/spacekey/pagename#id-pagenamewithnospaces-anchor

        Evelin is right: the whole anchor affair is a thorn in everyone's side, almost unusable for most users.

         

        1. Hi Ray,

          I agree, the current anchor syntax is difficult to use. Unfortunately it's not in my domain to change that at the moment. Feel free to raise an improvement suggestion so we can track the feedback.

          1. Thank you, Giles.  I created this improvement suggestion, which I would encourage others to vote for ... hopefully we can get easier to use anchors sometime soon!

        2. Ray, thank you for the hint with the ID. We ran into this problem, too.

      2. Thank you Giles. Works well for now. We found an easy way to copy the link including correct syntax. We do not use the anchor macro but formatted the phrase which had the anchor before as a minor heading like h7, inserted a table of contents, copied the link adress from the TOC view, and inserted it in JIRA as a web link. Too much steps if you ask me but it avoids mistakes.