SEO Suite Problem with Canonical

Hi there

I’ve installed the SEO Suite extra, which is really useful - but one thing I noticed is that it formats canonical links incorrectly. It outputs them as meta tags:

<meta name="canonical" content="https://www.domain.co.uk/" />

But they shouldn’t be meta tags - they should be output like this:

<link rel=”canonical” href=https://domain.co.uk/” />

I’m looking through the snippet and plugins to see if I can amend this, but i can’t see where to do it.

Any ideas?

Thanks!
Andy

I think there is a chunk with the name tplMeta, that you can change.

Yes you’re right - but then this changes ALL the meta tags - which isn’t what we want to do - it’s just the canonical meta tag we want to amend the formatting of

I’ve added it as an issue on github (Canonical tag is formatted as a meta tag - wrongly · Issue #43 · Sterc/seosuite · GitHub) but really need to fix it ASAP on a new iste which has gone live

So Canonical need to use ‘tplLink’ instead of ‘tplMeta’.
But I can’t see how/where to change which tpl it uses?

Maybe you can try changing this line to 'tpl' => $tplLink and see if that works:

1 Like

Hmm - diggin around in seosuitesnippets.class.php I found this:


        $meta['_canonical'] = [
            'name'  => 'canonical',
            'value' => $canonicalUrl,
            'tpl'   => $tpl
        ];

So I'll try and make  specific tpl and change the above..

ha - you just found the same thing I did - lols. Will give it a go - cheers!

Yep that did the trick! nice one!

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”.