Duplicate page titles when importing Markdown into Confluence: why it fails and how to fix it
Updated 2 December 2026 ยท 6 min read
Short answer: Confluence requires every page in a space to have a unique title, so an import that creates two pages called Overview, such as two README.md files with the same first heading, fails on the second one. Fix it before importing by giving each page a distinct title in frontmatter or in the first heading, or let the importer add folder context, for example Overview (Billing). A re-import must also update the existing pages instead of creating new ones, or the same collision returns on the next run.
Why does Confluence say a page with this title already exists?
Confluence requires page titles to be unique within a space. Atlassian has held this position for years. When a request to allow same-named pages in one space was closed as Won't Fix (CONFSERVER-2524), the explanation was that a space key and a page title together identify one page, and that changing this would break plugins, macros and APIs. Atlassian's Cloud knowledge base describes the same-title check as expected behavior.
The wording of the failure has varied. A bug report, CONFCLOUD-71477, records the editor showing only a generic "Your work is safe, but there's an issue" message while the response behind it said that a page with this title already exists. When a script or importer creates a page through the REST API, developers report an HTTP 400 error whose message names the title and the space key.
The rule is per space, not per site. A title can also be held by a page you do not expect: one deep in another branch of the tree, or one hidden from you by restrictions (Atlassian documents this case for Data Center). Atlassian does not state a case rule for Cloud on the pages cited here, so treat titles that differ only in letter case, such as FAQ and faq, as duplicates. Folio compares titles that way.
Why do Markdown folders trigger duplicate titles?
In Git, the same file name can appear in every folder, and the usual convention is one README.md per folder. An importer derives a title from the title frontmatter field, the first # heading, or the file name. Many READMEs open with the same heading, such as Overview, and many folders hold files with the same name, such as setup.md, so titles collide.
This example tree has five files and only two distinct titles:
README.md # Overview
billing/
README.md # Overview
setup.md # Setup
payments/
README.md # Overview
setup.md # Setup
There are three kinds of collision:
- Between files in the same import. The tree above produces three pages called Overview and two called Setup.
- With pages already in the space. Pages such as Overview or Getting Started are often created by hand long before the import.
- Between runs. An importer that does not remember which file produced which page creates a new page on every re-import, so the second run collides with the first.
What are the ways to fix duplicate page titles?
| Approach | Example | Trade-off |
|---|---|---|
| Set a unique title in the source | title: Billing Overview in frontmatter, or a distinct first heading | Cleanest result, and the title matches in Git and Confluence. Needs edits across many files. |
| Add folder context | Overview (Billing) | Readable and predictable. Titles get longer, and the suffix depends on folder names. |
| Add a prefix or a hash | md2cf's --prefix option, or mark's --title-append-generated-hash option | Easy to automate. A hash is hard to read. |
| Split content into spaces | One space per product or team | The same title is allowed in different spaces. Navigation and cross-space links get harder. |
| Update the existing page | Re-run an import that recognizes the page | Right when both files are the same document. Wrong when two documents merely share a name. |
Open-source publishers handle collisions in their own ways. The md2cf README suggests a title prefix to prevent collisions when uploading a folder, and says that uploading a page with the same title twice updates the existing page. That makes re-runs safe, but it also means two different files that share a title are treated as one page. The mark README documents an option that appends a short hash, generated from the page path, to the title.
How does Folio avoid duplicate-title failures?
Folio resolves titles before it creates any page, and the page-tree preview shows the final titles so you can review them.
- Inside the import, titles are compared without regard to case. When pages collide, Folio appends the nearest folder name in parentheses. If titles still collide, it adds more folder context, and as a last resort a number such as (2).
- Against pages already in the space, Folio does not overwrite an unrelated page. It renames the imported page, using the folder name, then (Folio), then a number. If you tick Adopt untracked pages with matching titles in the preview, Folio updates the existing page instead.
- Across re-imports, a per-space sync map links each file path to its page ID, so a file updates its own page and never collides with it.
For the example tree above, the preview titles are:
README.md Overview (Root)
billing/README.md Overview (Billing)
billing/setup.md Setup (Billing)
payments/README.md Overview (Payments)
payments/setup.md Setup (Payments)
A few details are worth knowing:
- When Folio renames a page, the original first heading stays in the body, because Folio only removes a first heading that matches the final page title.
- Disambiguated titles come from folder names, so renaming a folder renames the page on the next re-import. Set
titlein frontmatter for titles that must stay stable. - A file moved or renamed in Git has a new path that the sync map has not seen. If its title still matches the old page, tick the adopt option so Folio updates that page. Otherwise Folio creates a new page with a disambiguated title.
How do you find duplicate titles before importing?
Check the source folder first. This example command lists first-heading titles that appear more than once, ignoring case. It reads only the first # heading of each file, so it does not see titles set in frontmatter:
find docs -name '*.md' -exec grep -m1 -H '^# ' {} \; | sed 's/^[^:]*:# //' | tr 'A-Z' 'a-z' | sort | uniq -d
Then check the target space for titles that already exist. This example CQL query looks for a page called Overview in a space with the key ENG:
space = "ENG" AND type = page AND title = "Overview"
Use ~ instead of = for a fuzzy match on similar titles. If you script the import yourself, the Confluence Cloud REST API v2 can list the pages in a space filtered by title (GET /spaces/{id}/pages with the title parameter), so you can look before you create.
FAQ
Can two pages in different Confluence spaces share a title?
Yes. The unique-title rule applies within one space. A space key and a page title together identify a page, so the same title can exist in two different spaces.
Will Folio overwrite an existing page that has the same title?
Not by default. If a page with a matching title already exists in the space and is not linked to that file by an earlier Folio import, Folio renames the imported page instead. It updates the existing page only when you tick the option to adopt untracked pages with matching titles.
What happens if I rename a page in Confluence after importing it?
On the next re-import Folio updates the same page in place and writes the title derived from the Markdown back to it, so a manual rename in Confluence is replaced. Rename pages in the Markdown source instead, either with a title field in the frontmatter or by changing the first heading.
Why do I get a duplicate title error when the title is unique?
Check for a page you cannot see and for titles that differ only in case. Atlassian's Cloud knowledge base also describes a rare case where Confluence reports the error for a title that is unique, and it says that re-typing the title by hand lets the page publish.