Duplicate Snippet
Embed Snippet on Your Site
Set current URL as the Canonical URL and ignore query strings
This snippet searches for a specific string in the current URL and if found, it set the current URL as the Canonical URL and ignores any query strings.
Important: Replace '/home-search/listing/' with the string to be searched in the current URL.
Code Preview
php
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
Comments