Documentation Index
Fetch the complete documentation index at: https://mintlify.com/finsweet/attributes/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The Remove Query attribute automatically removes all query parameters from the URL after the page loads. This is useful for cleaning up URLs after capturing tracking parameters or form data, providing users with cleaner, more shareable URLs.Attribute Syntax
This attribute has no specific elements or settings. Simply add the script tag with the attribute to your page.Usage Examples
Common Use Cases
UTM Parameter Cleanup
Capture marketing campaign parameters in hidden form fields, then remove them from the URL for a cleaner user experience:Referral Tracking
Track referral sources while keeping URLs clean and shareable:Search Parameters
Remove search or filter parameters after capturing them:Form Pre-fill Data
Pre-fill forms with URL parameters, then clean the URL:Share-Friendly URLs
Provide users with clean URLs for sharing after they arrive via parametrized links:How It Works
- The attribute waits for the page to fully load
- It waits for other attributes (like Query Param) to finish processing
- It removes all query parameters from the URL
- The URL is updated using
window.history.replaceState() - The page does not reload - only the URL changes
Remove Query uses
history.replaceState() to update the URL without reloading the page. This means:- The page doesn’t refresh
- Browser history is preserved
- Users can still use the back button
- No additional page views are tracked
Loading Order
The attribute automatically waits for these attributes to load first (if present):- Query Param attribute
- CMS Filter attribute
Integration with Query Param
Remove Query works seamlessly with the Query Param attribute:- Form fields are populated with query parameter values
- URL is cleaned for better user experience
- Data is still available for form submission
SEO Considerations
Benefits
- Cleaner URLs: More shareable and user-friendly
- Duplicate content: Prevents search engines from indexing parameter variations
- Social sharing: Cleaned URLs look better when shared
Best Practices
- Use canonical tags to specify the preferred URL version
- Configure Google Analytics to exclude marketing parameters from reports
- Ensure tracking pixels/scripts fire before parameters are removed
- Consider using
rel="canonical"to point to the clean URL
Browser Compatibility
Remove Query useswindow.history.replaceState(), which is supported by:
- Chrome 5+
- Firefox 4+
- Safari 5+
- Edge (all versions)
- IE 10+