It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Dead page, need the page ID to delete it

Deleted user Mar 24, 2015

Working with Confluence 5.7.1. I have managed to kill a page through some recursive embedding (and/or my personal magnetic field). Regardless of the cause, the page is unreachable in the usual way. If I could find out the page ID, I could delete it and start over. 

I've searched for a macro to display the ID. I found various discussions but none of them worked: 

I tried building the macro on one of the pages (can't find that page again to link to it ... which is odd, was only just there a little while ago).  Nevertheless, here's the macro - sorry I can't acknowledge the author: 


## Macro title: pageid_edit                                                                                                                       
## Macro has a body: No                                                                                                                           
## Body processing: Use unprocessed macro body                                                                                                    
## Output: Generates Wiki Markup                                                                                                                  
## This macro displays a View Page and Edit Page link                                                                                             
## for the space/page you specify. (These URL forms require                                                                                       
## a pageid, so this macro determines the pageid from the space/page.)                                                                            
## Useful when a page won't display, or when you need to view or edit                                                                             
## a large volume of pages (such as when you have a list of pages in                                                                              
## a text file or Excel spreadsheet).                                                                                                             
## Params:                                                                                                                                        
##     space:   the space key                                                                                                                     
##     page:     the page title                                                                                                                   
## ----------------------------------------------------                                                                                           
#set ($wikibaseurl = "$action.getGlobalSettings().getBaseUrl()")                                                                                  
#if ($paramspace)                                                                                                                                 
  #set ($spacekey=${paramspace})                                                                                                                  
#if ($parampage)                                                                                                                                  
  #set ($page=${parampage})                                                                                                                       
#set ($pageid="{page-info:pageId|page=$spacekey:$page}")                                                                                          
[View $spacekey:$page|$wikibaseurl/pages/viewpage.action?pageId=$pageid]  [Edit $spacekey:$page|$wikibaseurl/pages/editpage.action?pageId=$pageid]

I don't think that code is valid in this version of Confluence. It doesn't work anyway. I've tried Macro Body in all its permutations (no macro body, escaped, unrendered, rendered) and they all display the same way (wrongly).  

If I enter this: 

{pageid:space=KAT|page="My Page"}

then it does find the correct base URL but it simply displays last line of code in the macro with the addition of the parameters I entered like this: 

[View spacekey:KAT:My Page$pageID]

Can anyone help with this, please? I really need to delete that page before users start trying to read it and complain that Confluence is dying. 



2 answers

1 accepted

0 votes
Answer accepted

Ohh, there was a trick here when we worked together.  I wrote a user-macro that would list the immediate children of a page, with their IDs exposed.  I don't have it to hand, but it went something like


#set ($childpages=$content.getSortedChildren())
#foreach ($childpage in $childpages)
Then we temporarily stuck the macro on the page above the broken one, and got the ID from there.
Deleted user Mar 24, 2015

I knew it had something to do with child/parent pages. Thanks, Nic. I'll give it a go.

Deleted user Mar 24, 2015

Once again, whatever they're paying you isn't enough. :) That worked well enough -- the first column ( $childpage.getTitle ) didn't do anything, but the important bit worked beautifully. And I didn't even need to delete the page -- I managed to salvage it by removing the include page that was actually broken. /me Over the moon

Oops. I think it should be getTitle(). I'll blame doing it from memory and lack of coffee ;-)

Deleted user Mar 24, 2015

Well, I nearly fixed the lack of a </table> and then I thought, No. Best see what Nic's caffeine level is like before I start changing his code ;) and ... yes, it is getTitle() - now working perfectly.

Deleted user Mar 24, 2015

Oh, and the correct setting for creating the macro is "No macro body"

0 votes
Deleted user Mar 24, 2015

Found the original source of the macro:

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Confluence Cloud

What's New in Confluence Cloud – July 2020 Edition

Here’s another edition of “What’s New” this month in Confluence Cloud. Quickly (and more easily) adjust permission settings We know that sometimes the layers of space permissions and page restric...

6,463 views 11 30
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you