Duplicate pages without canonical

I have a few pages where customers can request a quote from different pages on the website. From what I can tell the button uses a GET method and will place some info into the url so we know which page the customer came from when they fill out the form.

Anyway, These pages are apparently giving me a Duplicate pages without canonical error and I need to fix this.

I think I remember seeing how to fix the canonical situation within Modx, but if someone could help point me in the right direction it would be appreciated.

I believe it has something to do with this code in my header.

The page I have issues with is id 22. I think I just need to add a line of code for this page

This code runs the snippet Canonical-PDF for the resource with ID = 3, the snippet Canonical-Product for the resource with ID = 54 and the snippet Canonical for every other page.

Maybe take a look at those snippets and see what they do.


This is what they do. I will probably need to make a new snippet and adjust it.

Or maybe you can just use a tag like this

[[*id:is=`22`:then=`<link rel="canonical" href="[[~[[*id]]]]">`]]

to create a canonical link for the resource with ID = 22.

1 Like

Yes, I am sure I will be able to fix my problem thank you.

This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.