# Renumber XREFs (with links)

> Renumber XREFs with automatic link repair

---

The standard webtrees renumbering (Control panel
Manage family trees → [Family tree] → Renumber XREFs) resolves cross-tree XREF collisions but does not update linkenhancer or classic links. This module provides an extended renumber that repairs all affected links in one step.

**Access:** Control panel → LinkEnhancer → Renumber XREFs (with links)

**Workflow:**

1. Select the tree that has XREF collisions (duplicate XREFs with other trees).
2. The page shows each conflicting XREF, its record type, and the number of inbound linkenhancer references from the link index.
3. On submit, each conflicting XREF is:
   - renamed in the GEDCOM core tables (same as the standard renumber)
   - all `wt=@XREF@` / `id=@XREF@` links in notes and blocks are updated
   - the link index (`le_link_index`) and UID index (`le_uid_index`) are repaired inline or deferred to cron
4. Each renumbered record is logged in the edit log (Admin → Changes log), e.g. `Renumbered @I456@ → @I457@ (INDI, 3 core rows, 2 links)`.
5. If the PHP time limit is reached, the run stops with partial progress — the remaining conflicts are renumbered on the next run.

> **Note:** The standard webtrees renumber (without links) remains available and is unaffected. Use this module's renumber when your notes or blocks contain linkenhancer links.
> See also: [fisharebest/webtrees#5156](https://github.com/fisharebest/webtrees/issues/5156)
