How do you delete a page with going through confluence
Asked by Grant Williams:

*This question is in reference to Atlassian Documentation: [Deleting a Page](https://confluence.atlassian.com/pages/viewpage.action?pageId=428803497)*

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...


Answers:
author: Grant Williams
body: 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?


author: Stephen Deutsch
body: 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.

comments: author: Stephen Deutsch
body: I just took a look, and maybe that wouldn't work either, but it's worth a shot as a first option.


author: Robert Ortner
body: @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:


author: Stephen Deutsch
body: 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.


author: Robert Ortner
body: 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


author: Alex Yasurek
body: 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.

comments: author: Grant Williams
body: 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...


author: Alex Yasurek
body: 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>


Tags: confluence-administration

documentation