Canonical Tag Issue in Elements CMS

@ben The rel="canonical" tag does not work in Elements CMS.

While checking and reviewing the source code, I just discovered that for blog posts in Elements CMS, the SLUG is not being correctly replaced in the rel="canonical" tag.

See the screenshot.

It would be great if this could be fixed so that the blog posts can be indexed by Google.

Also, when I activate the Open Graph meta tags under the CMS item, they are also not being replaced or outputted.


3 Likes

could you send me a project with the issue so I can take a closer look? :slight_smile:

you can see this with elements cms project.

  • Project: elementsapp://downloadDocument/iyaFQsPZ4B87

Thanks! I’ve just checked this here and…

  1. The CMS doesn’t currently support updating/setting the canonical URL — we need to add support for that.
  2. The Open Graph tags not being set is a bug — we need to fix that!

I’ve added both of these to the list and will get to them ASAP :slight_smile:

2 Likes

just been digging in to this some more, and the open graph stuff does work on published sites — it won’t work in some situations when previewing locally due to some technical reasons.

The canonical link is more tricky, we will need to add a feature to Elements to make this happen. I can’t say when we’ll get around to this as we have a few other pressing issues we need to get to first.

2 Likes

Wouldn’t it maybe be a simple solution to take the “slug” from the markdown frontmatter and use that?

Anyway, I’ve now started creating “blog articles” directly in Elements. That way all the {{ item.parameter }} are included, the correct canonical is applied, and I save myself the redirect to the “pretty URL” :slight_smile: