How do you delete a page with going through confluence

This question is in reference to Atlassian Documentation: Deleting a Page

So we have an issue where it looks like someone created a page with invalid characters in the title and now when we try to goto the page we get a runtime error. So with that being said, I was hoping for a back end way to delete the page...

4 answers

If you can find the id of the page then you can use the API to delete the page. We ran into a similar issue and I had to first use the API to get a list of the pages in the space, then find the broken page in the list and get the page ID, then use the API to delete the page. 

Since I'm not super familiar with confluence, how do I go about doing that...I'm not really a developer...I can code up some simple things but not super proficient at it...

You can try the Bob Swift CLI plugin since you may not know how to create a script to do it. 

https://marketplace.atlassian.com/plugins/org.swift.confluence.cli/server/overview

I had similar problems in the past and fixed them without CLI

  • find out the PageID - not sure how I did it, I think by browsing the Database with SQLDeveloper
  • open a random page in your wiki
  • open the "..." menu and copy the link behind the "delete" entry with a right mouse click 
  • paste the link in your browser and replace the ID with the ID of the corrupt page and no hit return

should work

best Robert

 

p.s.: Just found it:

  • you need a database browser open it and connect to your database
  • have a look at your SPACES table and find out manually your SPACEID, should be easy
  • send the following statement to your database by replacing XXXXX with a keyword you are looking for (included in the page) and replace YYY  with the spaceID you found before
  • select * from bodycontent 
    join content on content.CONTENTID=bodycontent.CONTENTID and content.SPACEID='YYY' 
    where body like '%XXXXX%';

    As a result you find a list of pages - look for the line which fits your page and you find the ContentID we are looking for in third column named CONTENTID

 

0 vote
Stephen Deutsch Community Champion Apr 08, 2016

You may not have to go through all this trouble.  If you can figure out the pageId, then you could simply press delete on another page, edit the pageId attribute to be the page you want to delete, and press enter to load the URL and it should update to delete the page you want.

e.g. https://<myConfluence>/wiki/pages/removepage.action?pageId=12345678

so if the pageId for the page you want to delete is 23456789, just replace pageId=12345678 with pageId=23456789

This might avoid having to use the API, CLI, or database.

Stephen Deutsch Community Champion Apr 08, 2016

I just took a look, and maybe that wouldn't work either, but it's worth a shot as a first option.

@Stephen Deutsch how can you find the ID of a page if you are not able to open it anymore - the only way I found in the past was SQL see my suggested solution. You made me afraid and I tested it - it works adding the pageid instead of 123.... like you suggested wink

Stephen Deutsch Community Champion Apr 08, 2016

Well, if your page has special characters in the title, then you can just search for it and copy the pageId out of the link URL.  If it's not, one thing you could do is to open the browser console (I like to use Chrome for this) on the search page, switch to the network tab, run the search (so that it will show a request to the confluence server for the search), click on the request, and click the Preview tab.  Then expand the "results" section, and you should be able to see the pageId next to the page titles.

so I've hit another snag. So I did a query against the database (MS SQL Server) and got the records in the content table but my new issue is that there is no PageID. That being said, Is it safe to turf from the database directly? and If so, does anyone know what all tables I have to reference?

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Tuesday in Confluence

We want to see the templates you've created in Confluence!

Hi Community, Jessica here from the Confluence Product Marketing team!  July’s community challenge is all about sharing pictures  — and as an extension of our first post on what ...

387 views 17 9
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you