The community members are discussing how to set a canonical link on Webstudio websites. One community member suggests that if Webstudio is the source of truth, the canonical link needs to be set in the other place. Another community member asks if there is a setting in Webstudio to set the canonical URL. The discussion continues, with one community member stating that Webstudio currently does not have that setting, and another community member suggesting that running a script in the head tag is solving the issue.
Sorry to elevate this old post, but I have a particular use case that is worth consideration in allowing for control over a canonical link in the head.
I'm using the CMS integration and generating dynamic pages using a post ID but also putting a source slug into the URL for SEO reasons. For good or bad the same page renders with any slug, so long as the ID is correct. The problem is that the slug may change at the source, but old links to the site using the former slug will continue to render the page. This creates duplicate content that is a problem for SEO. The most elegant solution I can think of would be to populate the canonical link dynamically with the most current slug so that however someone lands on a page, the most current page is regarded by crawlers as authoritative.
I suspect this may be an issue for others using CMS integrations, whether they realize it or not. I'm open to suggestions if someone can think of another way to solve this.