V1.7 Changing Canonical for a specific prestashop 1.7 page

najm

New member
XNullUser
Joined
Jul 6, 2021
Messages
16
Reaction score
3
Points
3
NullCash
137
<script>
// Check if the current page URL matches the specific URL
if(window.location.href === 'Your page URL') {
// Find and update the canonical tag
var canonicalTag = document.querySelector('link[rel="canonical"]');
if(canonicalTag) {
canonicalTag.setAttribute('href', 'Your page URL');
}
}
</script>
 
Top