URL Usage Finder
Find and replace URL usage in posts, meta, menus, and options.
by Dmitry Shutko · github.com/shoot56/url-usage-finder · website
★ 0stars
0forks
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/shoot56/url-usage-finder/archive/refs/heads/main.zipDeclares an update source (shoot56/url-usage-finder), so updates arrive through the plugin's own updater.
Readme
URL Usage Finder
WordPress plugin to find and safely replace URL usage across multiple data sources.
Features
- Search by exact URL match in:
post_contentpost_excerptpost_meta(including ACF values stored in post meta)- navigation menu item meta (
nav_menu_item) wp_options(excluding transients by default)
- Result table with:
- source type
- object label
- field/meta key
- element hint (
link,image,button,raw_text) - context snippet
- edit link when available
- Pagination for large result sets (50 rows per page).
- CSV export for the current search results.
- Dry-run preview before replacement (
Before/After). - Safe selected-row replacement only (no bulk blind overwrite).
Installation
- Copy plugin folder to:
wp-content/plugins/url-usage-finder
- In WordPress admin, activate:
URL Usage Finder
- Open:
Tools -> URL Usage Finder
Usage
- Enter Old URL.
- Select search sources.
- Click Find URL Usage.
- Review matches and select rows.
- Enter New URL.
- Click Preview Selected (Dry Run) to inspect planned changes.
- Click Replace Selected to apply updates.
- Optionally click Export CSV to download results.
Data Handling
- Replacements are executed only for selected rows.
post_content/post_excerptupdates are done viawp_update_post().- Post meta updates are done via
update_post_meta(). - Option updates are done via
update_option(). - Arrays and objects are handled with recursive string replacement to preserve structure.
Security
- Admin capability required:
manage_options. - All write actions protected by nonces.
- Search SQL uses
$wpdb->prepare()and$wpdb->esc_like(). - Output is escaped in admin rendering.
Notes and Limitations
- Search is exact-string based for the entered URL.
- Element detection is heuristic and best-effort.
- For very large databases, initial search may still take time depending on host performance.
- CSV export uses current stored search results for the current admin user session.
Changelog
0.1.2
- Preserve percent-encoded URL input during search.
- Add encoded, decoded, and lowercase percent-encoding URL variants.
0.1.1
- Improved URL variant matching and boundary handling.
- Unified search and replacement matching logic.
- Temporarily disabled replacement UI and handlers by default.
0.1.0
- Initial release.
- Multi-source URL search.
- Selected-row replace.
- Pagination.
- CSV export.
- Dry-run diff preview.