This guide covers two new features added to the Backlink Tracker Plugin:
- Domain Filtering - Block specific domains from appearing in backlink displays
- URL Redirect Mapping - Handle URL migrations and redirects automatically
Allows you to exclude backlinks from specific domains (e.g., spam sites, irrelevant referrers) from being displayed on article pages.
- Go to Settings → Website → Plugins
- Find "Backlink Tracker" and click Settings
- Scroll to Domain Filtering section
- Enter domains to block (one per line)
- Click Save
spamsite.com
badactor.net
irrelevant-domain.org
- Subdomain Matching: Blocking
example.comwill also blockwww.example.com,blog.example.com, etc. - Case Insensitive:
SpamSite.comandspamsite.comare treated the same - No Protocol Needed: Enter just the domain name (e.g.,
example.com, nothttps://example.com) - Instant Effect: Changes apply immediately after saving
- Remove Spam Backlinks: Block known spam domains
- Hide Internal References: Block your own domains if needed
- Filter Low-Quality Sites: Block domains with poor reputation
Automatically maps old URLs to new URLs after domain migration or site restructuring. This ensures backlinks pointing to old URLs are correctly attributed to the current article pages.
Scenario:
- Your old site:
jlsr.thelawbrigade.com - Your new site:
journal.thelawbrigade.com/jlsr - You have Cloudflare redirects from old → new
- SEMrush CSV still contains backlinks to old URLs
- Without mapping: These backlinks won't appear on article pages
- With mapping: Old URLs automatically matched to new article pages ✓
CSV Backlink Points To:
https://jlsr.thelawbrigade.com/article/my-article/
↓
Plugin Checks Redirect Mapping
↓
Finds Match:
https://journal.thelawbrigade.com/jlsr/article/view/123
↓
Displays Backlink on Article #123 ✓
Create a CSV file with two columns:
| Column 1 | Column 2 |
|---|---|
| old_url | new_url |
Example CSV Content:
old_url,new_url
https://jlsr.thelawbrigade.com/article/constitutional-law-review/,https://journal.thelawbrigade.com/jlsr/article/view/227
https://jlsr.thelawbrigade.com/article/criminal-law-analysis/,https://journal.thelawbrigade.com/jlsr/article/view/228
https://jlsr.thelawbrigade.com/article/civil-procedure-study/,https://journal.thelawbrigade.com/jlsr/article/view/229Important CSV Rules:
- ✅ First row can be header (
old_url,new_url) or data - ✅ URLs must be complete (include
https://) - ✅ No trailing slashes needed (plugin normalizes automatically)
- ✅ Query parameters are ignored (
?param=value) - ❌ Don't include fragments (
#section)
- Go to Settings → Website → Plugins
- Find "Backlink Tracker" and click Settings
- Scroll to URL Redirect Mapping section
- Click Choose File and select your CSV
- Click Upload Redirect Mapping
- Wait for success message
- Close settings window
- Export backlinks from SEMrush/Ahrefs/GSC
- Upload using Upload Backlinks Data section
- Plugin will automatically apply redirect mappings
- Visit article pages to see matched backlinks
A sample file (REDIRECT_MAPPING_SAMPLE.csv) is included in the plugin folder for reference.
Option 1: Manual Creation (Small Sites)
Create Excel/CSV with two columns:
- List all old article URLs
- Manually match to new OJS article URLs
Option 2: Database Query (Large Sites)
If you have access to OJS database, you can generate mappings:
-- Example query (adjust for your setup)
SELECT
CONCAT('https://jlsr.thelawbrigade.com/article/', old_slug, '/') as old_url,
CONCAT('https://journal.thelawbrigade.com/jlsr/article/view/', article_id) as new_url
FROM article_migration_table;Option 3: Script/Tool
Write a script to crawl your old site and generate mappings based on redirects.
View Current Status:
- Settings form shows total mappings and last updated date
Update Mappings:
- Upload new CSV to completely replace old mappings
- Mappings are permanent (stored in database)
Clear All Mappings:
- Click "Clear All Redirect Mappings" button
- Confirms before deleting
- Permanent Storage: Mappings are stored permanently in the database
- Full Replace: Each upload replaces all previous mappings
- No Merge Mode: Cannot add to existing mappings (must re-upload complete list)
- Case Insensitive: URLs are normalized to lowercase for matching
- Applies to All Uploads: Once set, mappings apply to all future backlink CSV uploads
- No Performance Impact: Mapping lookup is instant (uses PHP associative array)
Problem: Backlinks still not showing after mapping
Solutions:
- Verify CSV format is correct (two columns, complete URLs)
- Check that old URLs in mapping exactly match URLs in backlink CSV
- Re-upload backlink CSV after uploading mappings
- Check browser console for JavaScript errors
Problem: Wrong articles showing backlinks
Solutions:
- Review redirect mapping CSV for incorrect new URLs
- Ensure new URLs point to correct OJS article IDs
- Clear and re-upload corrected mapping
Problem: Upload fails
Solutions:
- Ensure file is CSV format (not Excel)
- Check for special characters in URLs
- Verify no empty rows in CSV
Your Setup:
- Migrated from
old-domain.comtonew-domain.com - Want to block spam domains from displaying
Steps:
-
Create redirect mapping CSV:
old_url,new_url https://old-domain.com/article/123,https://new-domain.com/article/view/456 https://old-domain.com/article/124,https://new-domain.com/article/view/457
-
Upload redirect mapping in plugin settings
-
Configure domain filtering:
spamsite.com badactor.net -
Upload backlinks CSV from SEMrush
-
Result:
- Backlinks to old URLs → Matched to new articles ✓
- Spam domains → Filtered out ✓
- Clean, accurate backlink display ✓
- Setting Key:
blockedDomains - Format: Plain text (newline-separated)
- Location:
plugin_settingstable
- Setting Keys:
redirectMappingData(JSON)redirectMappingCount(int)redirectMappingDate(timestamp)
- Format: JSON object
{"old_url": "new_url"} - Location:
plugin_settingstable
Both features use consistent URL normalization:
- Parse URL into components
- Remove trailing slashes
- Remove query parameters
- Remove fragments
- Convert to lowercase
Example:
Input: https://Example.com/Article/123/?param=value#section
Output: https://example.com/article/123
Redirect Mapping (applied first):
For each backlink:
1. Normalize target_url
2. Check if exists in redirect mapping
3. If yes → Replace with new URL
4. Match against article URLs
Domain Filtering (applied last):
For each matched backlink:
1. Extract source domain
2. Check against blocked domains
3. If blocked → Exclude from display
4. If not blocked → Include
- Redirect Mapping: O(1) lookup (PHP associative array)
- Domain Filtering: O(n×m) where n=backlinks, m=blocked domains
- No Impact: Both features add negligible processing time
Q: Can I use wildcards in domain filtering?
A: Not currently. Use the base domain (e.g., example.com blocks all subdomains).
Q: Can I merge new redirect mappings with existing ones? A: No. Each upload replaces all mappings. Keep a master CSV file.
Q: Do redirect mappings affect backlink CSV uploads? A: No. Mappings are applied during display, not storage. Original CSV data is preserved.
Q: Can I export redirect mappings? A: Not currently. Keep your CSV file as a backup.
Q: What happens if a URL is in the mapping but not in backlinks? A: Nothing. Unused mappings are harmless.
Q: Can I map multiple old URLs to one new URL? A: Yes! Multiple old URLs can point to the same new article.
Q: How many redirect mappings can I have? A: Tested with 1000+ mappings. No practical limit.
- Keep Master CSV: Always maintain your redirect mapping CSV file
- Document Changes: Track which old URLs map to which new URLs
- Test Small First: Upload 5-10 mappings first to verify format
- Regular Updates: Update mappings when adding new articles
- Backup Database: Before major changes, backup plugin settings
- Monitor Results: Check article pages after uploading to verify
Version 1.1.0 (December 2024)
- Added domain filtering feature
- Added URL redirect mapping feature
- Updated locale files
- Enhanced backlink matching logic
For issues or questions:
- Check this guide first
- Review main README.md
- Check OJS forum: https://forum.pkp.sfu.ca/
- Review plugin code in
BacklinkHandler.inc.php(lines 200-204 for redirect mapping)
GNU General Public License v3.0