Problem
Dynamic filtering components (like the Contract Addresses Table and DVN Addresses Table) update URLs with query parameters to make filter states shareable:Solution
We implement a multi-layered approach to prevent duplicate content indexing:1. Meta Tags (Primary Solution)
TheuseSearchIndexing hook automatically adds appropriate meta tags when filters are active:
- Canonical URL: Points to the base page without query parameters
- Noindex: Prevents indexing of filtered pages while allowing link following
2. Robots.txt (Secondary Protection)
Additional robots.txt rules block crawlers from accessing filtered URLs:3. Usage in Components
For any component with filtering, use the hook:Benefits
- Prevents Duplicate Content: Search engines won’t index multiple versions of the same page
- Maintains Shareability: URLs with filters still work for users sharing links
- Preserves SEO: Base pages retain their search ranking
- Automatic: Works without manual intervention once implemented
Implementation Details
- Canonical URLs tell search engines which version is the “master”
- Noindex prevents duplicate content while preserving link equity
- Robots.txt provides an additional layer of protection
- Cleanup ensures meta tags are removed when filters are cleared
Best Practices
- Always use the hook for any component that modifies URLs based on user interaction
- Test thoroughly to ensure meta tags are added/removed correctly
- Monitor search console for any remaining duplicate content issues
- Consider analytics when deciding which filtered pages (if any) should be indexed
Monitoring
Check Google Search Console and other search tools for:- Duplicate content warnings
- Pages with canonical issues
- Unexpected indexed URLs with query parameters
References
This approach follows industry best practices used by:- Major ecommerce sites (Amazon, eBay)
- Documentation platforms (Algolia, GitLab)
- Content management systems (WordPress, Drupal)