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 \le NN 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
Prune Inactive Links Settings Panel

Installation

  1. Copy or move the prune-inactive-links directory into your YOURLS user/plugins/ directory.
  2. Go to your YOURLS Administration Panel and navigate to Plugins.
  3. 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 OptionTypeDefault ValueDescription
Link AgeInteger7 daysLinks newer than this number of days will be excluded from pruning.
Click Inspection WindowInteger7 daysThe number of recent days of click logs to check for activity.
Max Click CountInteger0 clicksRedirects with clicks less than or equal to this limit are pruned.
Prune Run IntervalInteger86400 secondsFrequency of the background prune job (e.g., 86400 for daily, 3600 for hourly).
Dry Run ModeBooleanfalseWhen 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:

AI Disclaimer

This plugin was created and is maintained with the assistance of Antigravity, an agentic AI coding assistant by Google DeepMind.