tm2000
November 5, 2021, 3:55pm
1
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.
tm2000
November 5, 2021, 4:03pm
3
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
tm2000
November 5, 2021, 4:05pm
4
tm2000:
’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?
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
tm2000
November 5, 2021, 4:07pm
5
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:
$this->config['tab_seo']['default_index_type'] ? 'index' : 'noindex',
$this->config['tab_seo']['default_follow_type'] ? 'follow' : 'nofollow'
]),
'tpl' => $tpl
];
}
$meta['_canonical'] = [
'name' => 'canonical',
'value' => $canonicalUrl,
'tpl' => $tpl
];
if (!empty($this->config['tab_social']['default_og_image'])) {
$meta['og_image'] = [
'name' => 'og:image',
'value' => $this->config['tab_social']['default_og_image'],
'tpl' => $tplSocial
];
}
2 Likes
tm2000
November 5, 2021, 4:11pm
7
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..
1 Like
tm2000
November 5, 2021, 4:12pm
8
ha - you just found the same thing I did - lols. Will give it a go - cheers!
tm2000
November 5, 2021, 4:14pm
9
Yep that did the trick! nice one!
system
Closed
November 7, 2021, 4:15pm
10
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”.