metatag
metatag copied to clipboard
Disable core "Meta Tags" when Metatag plugin is installed
Disable core "Meta Tags" when Metatag plugin is installed, because it results duplicated meta tags.
Where you found this?
@mostym reported this on gitter.
sorry, deleting former text. You meant core meta tags (set in site preferences). Your plugin worked with news, so I missed this.
The source of the problem is in header_default.php file. It contains hardcoded meta tags:
if(empty($isKeywords))
{
echo (defined("META_KEYWORDS")) ? "\n<meta name=\"keywords\" content=\"".$key_merge.META_KEYWORDS."\" />\n" : render_meta('keywords');
}
if(empty($isDescription))
{
echo (defined("META_DESCRIPTION")) ? "\n<meta name=\"description\" content=\"".$diz_merge.META_DESCRIPTION."\" />\n" : render_meta('description');
}
e107's meta-handling leaves a lot to be desired...
Hm, but there is the correct check if e107::meta() is used.
I think that problem is that download-category doesn't use e107::meta() at all. Maybe adding them would be fix this. What about download itself? "download" uses e107::meta(), so there shouldn't be doubles.
https://github.com/e107inc/e107/issues/3911 @lonalore This is workaround or solution:
public function renderMeta($name, $content)
{
if(!empty($name) && !empty($content))
{
e107::meta(null, $content, array(
'name' => $name,
));
if($name == "description") {
e107::getSingleton('eResponse')->addMetaDescription($content);
}
}
}
- keywords , it's easier for you
Thank you! :)
Hi
I installed this plugin backend is working fine but in frontend there is issue with rendering content.
Like I want to set robots to index I checked that option in backend but in view source I am not finding it anywhere.
@harmanwebchfez31 Did you try clearing your cache?
Hi Thanks for your response.
I did that but unfortunately meta tags are still not appearing in frontend.
Any reason for the issue.
I tested this setting and it works for me. I chekced (index) Allow search engines to index this page (assumed) option, and this appeared in the html source:
<meta content="index" name="robots" />
Which version of e107 are you using? Do you use any metatag-related plugin (except metatag)?