How to link to an anchor in a page with pageID?

Mehrdad Mirreza February 3, 2016

This question is in reference to Atlassian Documentation: Anchors

I want to link to an anchor or heading inside a page, but that page has no Name but an pageID. What is the syntax for linking to that anchor?

This question was already asked, but not answered yet: https://answers.atlassian.com/questions/291677

7 answers

1 accepted

2 votes
Answer accepted
Giles B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 3, 2016

Hi Mehrdad,

Just copy the name of the page and enter it in the advanced section of the link dialog like so:

Page name#anchorname

It should work even when there are weird characters in the name. I'll add a note to the page to make this clearer.

Mehrdad Mirreza February 3, 2016

Hi Giles,

I tried it, but it didn't work. The title of my page is "This/That" and it is in the space "Galaxy". I tried both:

Galaxy:This/That#the_anchor

and:

This/That#the_anchor

The result was "Page not found!"

I thought the slash in the tame is the problem, so I tried the whole thing on another page that did have a name --> the same problem!!

At the end I found out, the problem is the auto-converter of that textbox in the advanced page. Like many other auto-conversions in Confluence the mechanism only works, if your really type the page name just when you first click in the textbox. Pasting the text or having a wrong value then editing it, or even completely removing it and then re-typing the correct text don't work, you should really type without editing:

This/That#the_anchor

Then it works.

Alternatively you can use:

http://confluence.mycompany.com/pages/viewpage.action?pageId=34325612#This/That-the_anchor

 - Mehrdad

Martin Tengler April 26, 2016

Worked for me. Thanks a lot!

Bree Abell November 14, 2017

Thanks that solved my problem too!

1 vote
sarah izadyar February 3, 2016

Bingo! That title is the page name.

0 votes
Marie Line Ulysse December 30, 2019

Hi There,

As far as I am concerned, I am trying to link an anchor from a page in an other space, so I made this link that works properly:

IDEA:Règles d'affaires (version finale)#My-Anchor

The name of my page is "Règles d'affaires (version finale)" and I know it could be renamed soon by anyone in my team and cause a broken link...   :( 

My question: Can I use a page ID instead of the page name to ensure that my link is never broken in the case I rename my page?

Thanks a lot!

Conrad Braam _zaphodikus_ November 10, 2020

Although it's totally counter intuitive to include the page name in the anchor name, this had me puzzled for the longest time.
https://ourdomain.com/pages/viewpage.action?pageId=9699987#IPSECVPNsettings(foriOS)-apple_test

Where "apple_test" was my anchor name, and "IPSEC VPN settings (for iOS)" is the page title, did it for me. The docs could do with a bit of clarifying, but really the macro 'should' just generate an extra anchor without the name or with the id, in my mind then, the problem would disappear?

0 votes
Mehrdad Mirreza February 3, 2016

Well, I just click on [Create] and a new page apears. I type the title and the content, then save it. What I then see in the address bar is something like "...?pageid=897632". So even if the page has a Name, I don't know it.

0 votes
Mehrdad Mirreza February 3, 2016

OK, then tell me how to find out the Name of the page, when in the address bar I only see the ID?

Milo Test
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 3, 2016

It's the title of page, that is, the line above "Created by ..."

0 votes
sarah izadyar February 3, 2016

Is it possible to create a page without name?!

0 votes
Milo Test
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 3, 2016

Every page has a name AND an ID.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events