How to find and fix broken links in Confluence Cloud

Updated 2 December 2026 ยท 8 min read

Short answer: Confluence Cloud has no built-in broken link report. Atlassian's request for one, CONFCLOUD-65867, is still open with the status Gathering Interest as of December 2026. To find broken links, scan page bodies through the REST API and test each link, use a Marketplace app, or audit the common failures by hand: links to deleted pages, localhost addresses, placeholder URLs and leftover .md paths. Fix each one by pointing it at the new page, or by removing the link and keeping its text.

Does Confluence Cloud have a broken link checker?

No. The public request is CONFCLOUD-65867, "Link Report/Link Validator". It was opened in March 2019, shows 108 votes in the Gathering Interest status as of December 2026, and says administrators currently have to check links by hand. Atlassian's tooltip for that status asks for more votes from unique domains and more comments before the team reviews it.

Two partial safeguards do exist. When you delete a page, Atlassian's delete and restore article says the content details list the items that link to it, with the warning that deleting breaks those links. And links to archived pages keep working and show an Archived lozenge. Neither one finds links that are already broken.

What kinds of broken links do Confluence pages collect?

A broken link is a link that does not lead a reader to the intended content. Five kinds account for most of what you will find:

KindTypical causeHow to detect it
Link to a deleted or purged pageA page or space was removed without checking incoming links.REST scan (the page ID returns 404), or an app.
Leftover relative Markdown link, such as ./setup.mdMarkdown was pasted or imported and the link was never converted to a page link.Scan for relative links that end in .md.
Localhost or placeholder URL, such as http://localhost:3000A link copied from a developer's notes or a template.Scan, or text search when the URL is visible text.
External URL that now returns 404 or 410A vendor moved or retired its docs.A script or app that makes outbound HTTP requests.
Link to a page the reader cannot viewPage restrictions or a private space.Not detectable as "broken". It looks the same as a missing page to the viewer.

Can you find broken links with search or CQL?

Not directly. Confluence does not index link URLs, so you cannot search for a bad address. Atlassian's suggestion AI-320 asks for URLs to be indexed so their text can be searched, and it is still unresolved. An older request to search external link URLs was closed as Won't Fix.

CQL text search matches visible text. The query text ~ "localhost" finds pages that display the word, for example a URL pasted as plain text, but not a link whose visible label is "dev server" and whose hidden target is localhost. Use CQL to narrow what you scan instead (examples, replace the space key and page ID):

QueryWhy it helps
type = page and space = ENG and text ~ "localhost"Pages that show a localhost address as text.
type = page and ancestor = 123456 and lastmodified < now("-365d")Old pages in one tree, where links have had the longest time to rot.
type = page and space = ENG order by lastmodified ascA prioritized scan order, oldest first.

See how to find stale pages for running these through the REST API.

How do you scan every link in a space with a script?

The Confluence Cloud REST API v2 can return page bodies in Atlassian Document Format (ADF), a JSON tree in which every hyperlink is a link mark on a text node and every smart link is a card node. A script can walk that tree, check each URL and print the failures. Atlassian documents the endpoint in its REST API v2 page reference: GET /wiki/api/v2/spaces/{id}/pages accepts body-format=atlas_doc_format and a limit of up to 250.

This example script is read-only and uses only the Python standard library. It checks internal page links by asking Confluence whether the page ID still exists, and checks external links with a HEAD request, falling back to GET:

import base64, json, os, re, sys, urllib.error, urllib.request

SITE = os.environ["CONFLUENCE_SITE"].rstrip("/")  # for example https://your-site.atlassian.net
AUTH = base64.b64encode(
    f'{os.environ["CONFLUENCE_EMAIL"]}:{os.environ["CONFLUENCE_API_TOKEN"]}'.encode()
).decode()
PAGE_ID = re.compile(r"/pages/(\d+)")


def confluence_get(url):
    request = urllib.request.Request(url, headers={"Authorization": "Basic " + AUTH})
    with urllib.request.urlopen(request, timeout=30) as response:
        return json.load(response)


def pages_in_space(space_id):
    url = f"{SITE}/wiki/api/v2/spaces/{space_id}/pages?body-format=atlas_doc_format&limit=250"
    while url:
        data = confluence_get(url)
        yield from data["results"]
        next_path = data.get("_links", {}).get("next")
        url = SITE + next_path if next_path else None


def links_in(node):
    for mark in node.get("marks", []):
        if mark.get("type") == "link":
            yield mark["attrs"]["href"]
    if node.get("type") in ("inlineCard", "blockCard", "embedCard"):
        url = node.get("attrs", {}).get("url")
        if url:
            yield url
    for child in node.get("content", []):
        yield from links_in(child)


def page_exists(page_id):
    try:
        confluence_get(f"{SITE}/wiki/api/v2/pages/{page_id}")
        return True
    except urllib.error.HTTPError as error:
        return error.code != 404


def external_status(url):
    # Atlassian credentials are never sent to external hosts.
    for method in ("HEAD", "GET"):
        request = urllib.request.Request(url, method=method, headers={"User-Agent": "link-audit"})
        try:
            with urllib.request.urlopen(request, timeout=15) as response:
                return response.status
        except urllib.error.HTTPError as error:
            if method == "HEAD" and error.code in (403, 405, 501):
                continue
            return error.code
        except Exception as error:
            return type(error).__name__


def main(space_id):
    for page in pages_in_space(space_id):
        adf = json.loads(page["body"]["atlas_doc_format"]["value"])
        for href in sorted(set(links_in(adf))):
            if href.startswith("/wiki/"):
                href = SITE + href
            if not href.startswith("http"):
                if re.search(r"\.md(#|$)", href):
                    print(f'MARKDOWN LINK  {page["title"]}  ->  {href}')
                continue
            match = PAGE_ID.search(href)
            if href.startswith(SITE):
                if match and not page_exists(match.group(1)):
                    print(f'MISSING PAGE  {page["title"]}  ->  {href}')
            else:
                status = external_status(href)
                if status != 200:
                    print(f'{status}  {page["title"]}  ->  {href}')


if __name__ == "__main__":
    main(sys.argv[1])  # numeric space ID, from GET /wiki/api/v2/spaces?keys=ENG

To run it, find the numeric space ID with GET /wiki/api/v2/spaces?keys=ENG, set CONFLUENCE_SITE, CONFLUENCE_EMAIL and CONFLUENCE_API_TOKEN as environment variables (never paste a token into the file), and run python3 scan_links.py 12345. Read the output like this:

  • MARKDOWN LINK: a relative .md link that was never converted to a page link.
  • MISSING PAGE: Confluence answered 404 for the page ID. A 404 can also mean the account cannot view the page, so confirm with a space admin before removing the link.
  • 404 or 410 on an external URL: the target is gone. Fix the link.
  • DNS or timeout errors: hosts such as localhost or internal names fail from your machine. Decide whether your readers can reach them.
  • 401, 403, 429 or 5xx: check by hand. Many sites require a login, block scripts or rate limit.

The script reads body links and smart links only. It does not look inside macro parameters, and it checks every distinct link once per page, so slow down or batch it for very large spaces.

Do Marketplace apps find broken links?

Yes, several Marketplace apps scan spaces for broken links and report them in a table. Compare them on four points:

  • External URLs. Checking them needs outbound requests. An app that runs entirely on Atlassian infrastructure with no external calls can find missing pages and placeholder links, but it cannot confirm that an external site still answers.
  • Scopes. Does the app only read pages, or can it also edit them?
  • Fixes. Are changes previewed and approved before anything is written?
  • History. Does it keep earlier results, so you can see whether the count is falling?

How do you fix broken links safely?

  1. Decide what each link should do. If the target moved or was replaced, relink it. If it was removed on purpose, unlink the text and keep the words. If it is a localhost or placeholder address, replace it with the canonical URL or remove it.
  2. Try restoring before relinking. If a deleted page is still in the trash, open Space settings, then Content, then Trash and restore it. Atlassian notes that a restored page returns to the root of the space without its inherited permissions, so move it back and check its restrictions. Purged pages cannot be restored.
  3. Edit one page at a time. Every save creates a page version, so page history lets you compare the change and restore the old text.
  4. Link to pages, not to pasted URLs. Use the editor's link search to pick the target page so the link carries its page ID, and paste Jira work item links so Confluence converts them.
  5. Archive before you delete. Links to archived pages keep working, while deleting a page breaks every link to it.
  6. Run the scan again and keep the count. A falling number is the evidence that the cleanup worked.

Where does Folio fit?

Folio for Confluence checks link integrity as one of four pillars in its 0 to 100 Context Health Score. Link integrity is 25 of the 100 points. Folio flags links to missing or deleted pages, leftover raw .md paths, and localhost or placeholder URLs, and it lists each problem on the page where it sits.

From the Audit & fix tab you can review proposed fixes such as "Remove 4 localhost links". Folio unlinks the text and keeps the words, shows the score the section would reach, and changes nothing until you apply. Each change is made as you and saved in page history. See Fixing docs in the Folio documentation.

Folio runs on Atlassian and makes no external requests, so it does not check whether an external website still responds. Use a script or another tool for that part. Folio works on Confluence Cloud only.

FAQ

Will Atlassian add a native broken link report?

Atlassian has made no commitment. The status Gathering Interest means the suggestion needs more votes from unique domains and more comments before the product team reviews it. Voting and commenting on CONFCLOUD-65867 with your use case is the only lever, and it is worth doing, but plan for a script or an app in the meantime.

Will links to archived pages break?

No. Atlassian documents that links to archived content keep working and display an Archived lozenge. That makes archiving a safer cleanup step than deleting, which breaks every link that points at the page.

Why do links break after a Markdown import?

Relative links such as ./setup.md point at files, not at Confluence pages. If the target file was not part of the same import, or the importer did not rewrite links, the .md path stays in the page and fails for every reader. Importers that work in two passes create every page first and then rewrite relative links to the new page URLs.

Does a 403 or 401 response mean a link is broken?

Not necessarily. Those codes usually mean the site wants a login or blocks scripts, and 429 means you sent requests too fast. Open those links by hand before changing anything. Treat 404, 410 and DNS failures as confirmed dead links.

Can I restore a deleted page to repair links?

Yes, until the trash is purged. Restore the page from the space trash, then move it back to its old location and re-apply any page restrictions, because a restored page returns to the space root without its inherited permissions.