WP Search Query Redirect — How To
Summary
Automatically route search intent (Google/Bing referrer, on-site ?s=, UTMs) to the most relevant page, collection, or promo.
Prerequisites
- WordPress (latest).
- Clear destination URLs (collections, filtered shop, landing pages).
Install & Activate
Upload ZIP → Activate → Settings → Search Redirect (or under Woo settings if you prefer).
Create Your First Rule
- Add Rule.
- IF condition:
- Referrer Query contains
spades(or exact/regex/synonym). - OR On-site Search
?s=containsgift card. - OR UTM
campaignequalssummer-bags.
- Referrer Query contains
- THEN action: set Destination URL (e.g.,
/shop/?filter=spades). - Redirect Type: 302 (default), 301, or 307.
- Priority and optional Fallback URL.
- Save and click Preview/Test (built-in simulator).
Best Practices
- Start with 302 while validating; switch to 301 for permanent mappings.
- Add synonyms/plurals (e.g.,
tote, totes, shopper). - Use exclusions for admin/logged-in roles or specific paths.
Bot/SEO Controls
- Optionally bypass crawlers to avoid cloaking concerns.
- Canonicals on destination pages remain intact.
Logging & Insights
- Enable Logs to see top triggers, misses, and destinations.
- Export rules for backup or stage → prod.
Caching/CDN
Redirects happen very early—no special exclusions typically needed. If you use any plugin endpoints for testing/simulation, exclude them as documented in Settings → Diagnostics.
Troubleshooting
- Rule not firing: lower the priority number; confirm condition type (exact vs contains vs regex).
- Wrong destination: check URL formatting and ensure the page exists/is public.
- Infinite redirects: add an exclusion if destination also matches the IF condition.
Uninstall
Deactivate → Delete. (Toggle “Remove data” first if you want to remove rules and logs.)
