Prune Inactive Links Plugin for YOURLS
July 14, 2026 · View on GitHub
A maintenance utility plugin for YOURLS that automatically deletes old links that have not received any recent clicks to keep your database clean and performant.
Features
- Automated Background Pruning: Runs periodically to clean up redirects based on your chosen interval.
- Customizable Thresholds:
- Link Age: Only inspect links older than X days.
- Click Inspection Window: Examine click logs within a specific window of Y days.
- Max Clicks: Define a click threshold (e.g., delete links with clicks in that period).
- Dry Run Mode: Test parameters and view matched link counts without deleting them.
- Manual Trigger: Run pruning instantly from the settings panel or via API.
- Prune ALL Links: Permanently delete all links in the database (with double-confirmation safety popup).
Screenshots
Screenshot(s)
| Prune Inactive Links Settings |
|---|
![]() |
Installation
- Copy or move the
prune-inactive-linksdirectory into your YOURLSuser/plugins/directory. - Go to your YOURLS Administration Panel and navigate to Plugins.
- Locate Prune Inactive Links and click Activate.
Settings & Configuration
Navigate to Prune Inactive Links Settings in the admin sidebar navigation menu to configure the following settings:
| Setting Option | Type | Default Value | Description |
|---|---|---|---|
Link Age | Integer | 7 days | Links newer than this number of days will be excluded from pruning. |
Click Inspection Window | Integer | 7 days | The number of recent days of click logs to check for activity. |
Max Click Count | Integer | 0 clicks | Redirects with clicks less than or equal to this limit are pruned. |
Prune Run Interval | Integer | 86400 seconds | Frequency of the background prune job (e.g., 86400 for daily, 3600 for hourly). |
Dry Run Mode | Boolean | false | When enabled, logs/previews matches without actually deleting them. |
API Triggering
You can trigger a prune execution programmatically by sending a GET request to:
https://your-yourls-site.com/yourls-api.php?action=prune_inactive&signature=YOUR_SIGNATURE
Authors
- Bluscream
- Antigravity.AI
Other Plugins
Check out our other YOURLS plugins:
- Manage Protocols: Add, view, toggle, and delete allowed URL protocols.
- Public Shortener Front Page: A premium, Turnstile-secured public URL shortener.
- Webhook Notification: Sends a JSON POST webhook notification on new link creation.
- Modern Clicks Log Viewer: Responsive table of click logs with GeoLite2 geolocation.
AI Disclaimer
This plugin was created and is maintained with the assistance of Antigravity, an agentic AI coding assistant by Google DeepMind.
