# How to Use Link Maintainer
## ⚠️ Important Warning
> [!warning]
> **Please read before using**: While Link Maintainer implements several safety measures to ensure robust handling of block references and note links, the operations are **not reversible**. Before performing any link updates:
>
> 1. **Always Review the Confirmation Window**: Carefully check all proposed changes in the confirmation dialog before proceeding.
> 2. **Exercise Caution**: Take extra care when performing bulk operations that affect multiple files.
> 3. **Back Up Your Vault**: Since link updates cannot be undone, make sure you have a backup of your vault.
>
> The plugin follows these principles to maximize safety:
>
> - Shows a detailed preview of all changes before applying them
> - Tracks and logs all updated links for reference
> - Provides clear warnings for potentially risky operations
> - Implements thorough validation before any changes
>
> However, just like renaming tags in Obsidian (e.g., with Tag Wrangler), once links are updated, there is no automatic way to revert the changes. Always proceed with caution and ensure you understand the scope of the changes before confirming them.
## How to Use
The plugin provides a command to help you maintain block references in your vault:
### Available Command
**Update block references from selection** (`Cmd/Ctrl + P`)
- Select text containing a block ID in your note
- Run the command through Command Palette
- The plugin will update all references to that block
### Workflow Example
1. **Select Block Reference**:
- Find the line containing your block ID (e.g., `^important-block`)
- Select that line in your note
2. **Run Command**:
- Open Command Palette (`Cmd/Ctrl + P`)
- Choose "Update block references from selection"
3. **Review Changes**:
- The plugin shows you all found references
- Each reference shows:
- File location
- Current content
- Preview of the change
4. **Confirm Updates**:
- Review the proposed changes
- Click "Confirm" to apply the updates
- All changes will be logged if logging is enabled
### Example
```markdown
// new-note.md (current file)
Some important text here ^important-block
// other-notes.md (will be updated)
Before: [[old-note#^important-block]]
After: [[new-note#^important-block]]
```
## Settings
The plugin provides several settings to customize its behavior:
- **Replace Existing Block Links**: Choose whether to replace block links that already exist in the target file
- **Show Confirmation Dialog**: Enable/disable confirmation before applying changes
- **Change Logging**:
- Enable/disable logging of link updates
- Set log file path (default: 'link-maintainer-changes.md')
- Log entries include:
- Timestamp of changes
- Original and new file paths
- Line numbers and content changes
- Block IDs for block references
- Batch operation details
### Link Updates
- **Force update all block references**: Choose between safe mode (default) and force update mode
- Safe mode: Only updates broken or invalid links
- Force mode: Updates all references to point to the new location
- **Show confirmation dialog**: Review and confirm changes before they're applied
### Change Tracking
- **Enable change logging**: Keep a detailed record of all updates
- **Log file path**: Customize where change logs are stored
## Installation
1. Open Obsidian Settings
2. Navigate to Community Plugins and disable Safe Mode
3. Click Browse and search for "Link Maintainer"
4. Install the plugin
5. Enable the plugin in your Community Plugins list
## Learn More About Link Maintainer
- [[Key Features of Link Maintainer]]