Loyalty Links
·
Conditionally break external links based on referrer history.
Loyalty Links is a WordPress plugin that implements a ”give and take” approach to external linking. The plugin tracks which external domains have sent visitors to your site via referrers, and only allows links to those domains to remain functional. Links to domains that haven’t recently referred visitors are ”broken” (href changed to ”#”) while remaining visible on the page.
Key Features
- Referrer Tracking: Automatically tracks external domains that send visitors to your site
- Dynamic Link Breaking: Links to domains without recent referrers are automatically disabled
- Selective Monitoring: Only monitor specific domains you choose – other external links remain untouched
- Configurable Retention: Set how many days to retain referrer records (default: 30 days)
- Test Mode: Add test domains to verify functionality without waiting for actual referrals
- Cache-Friendly: Uses REST API endpoints for dynamic data, compatible with WP Rocket, WP Fastest Cache, and other caching plugins
- Performance Optimized: Asynchronous script loading and efficient database operations
How It Works
- Track Referrers: When a visitor arrives from an external domain (in your monitored list), JavaScript sends the referrer information to a REST API endpoint which records the domain, timestamp, and increments the visit count
- Approve Domains: Domains that have sent referrers within your retention period are considered ”approved”
- Break Links: Links pointing to non-approved domains have their
hrefchanged to#andpointer-events: noneapplied - Real-Time Updates: Approved domains are fetched dynamically via REST API, ensuring cache compatibility
Use Cases
- Encourage reciprocal linking by only allowing functional links to sites that link back to you
- Create a ”loyalty” system where sites that send traffic get link benefits
- Test link management strategies without manual intervention
- Maintain link quality by prioritizing domains that drive traffic
