Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
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

How do I rename a confluence page using the api?

Try as I might, I can't find this in the docs. I have a series of pages that I would like to rename. There are hundreds, and what needs to be done (remove the last word in the title) is very simple, so I was hoping to automate it.

What is the secret?

1 answer

1 accepted

0 votes
Answer accepted

Found it! I kept seeing the process for updating content and glossing it over because I wasn't thinking of the title as content...

Dominic Lagger Community Leader Sep 30, 2020

can you share how you did it? 
I'm stuck with the same problem now...

Thanks

I use atlassian-python-api to manipulate Confluence pages, here is my example for page moving to another parent with renaming, you can use my idea to understand how it works:

 

# Old page title
old_title
= 'Beautiful Page Title'

# Title that you want to change to
new_title
= f"Much More {old_title}"

# Title of parent page where you want to move page to
parent_title
= 'New Home'

# Get ID for new parent page
parent_id = confluence.get_page_id(space=space, title=parent_title)

# Get old page contents
old_page_content = confluence.get_page_by_title(space=space, title=old_title, expand='body') # Old page contents

# Rename and move page, get updated content
new_page_content = confluence.update_page(old_page_content['id'], title=new_title, body=old_page_content['body'], parent_id=parent_id, type="page", representation="storage")

Suggest an answer

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

🏠 Say hello to the new Confluence Home!

Hi Atlassian Community, My name is DJ Chung, and I’m a Product Manager on the Confluence Cloud team. Today, I’m excited to share a new and improved version of Home. The new Home helps you ...

38,654 views 28 126
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