metatag icon indicating copy to clipboard operation
metatag copied to clipboard

Disable core "Meta Tags" when Metatag plugin is installed

Open lonalore opened this issue 5 years ago • 11 comments

Disable core "Meta Tags" when Metatag plugin is installed, because it results duplicated meta tags.

lonalore avatar Apr 27 '19 09:04 lonalore

Where you found this?

Jimmi08 avatar Apr 27 '19 14:04 Jimmi08

@mostym reported this on gitter.

image

lonalore avatar Apr 27 '19 15:04 lonalore

sorry, deleting former text. You meant core meta tags (set in site preferences). Your plugin worked with news, so I missed this.

Jimmi08 avatar Apr 27 '19 15:04 Jimmi08

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

lonalore avatar Apr 27 '19 15:04 lonalore

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.

Jimmi08 avatar Apr 27 '19 15:04 Jimmi08

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

Jimmi08 avatar Jul 29 '19 20:07 Jimmi08

Thank you! :)

lonalore avatar Aug 09 '19 08:08 lonalore

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 avatar Nov 15 '19 11:11 harmanwebchfez31

@harmanwebchfez31 Did you try clearing your cache?

lonalore avatar Nov 22 '19 16:11 lonalore

Hi Thanks for your response.

I did that but unfortunately meta tags are still not appearing in frontend.

Any reason for the issue.

harmanwebchfez31 avatar Nov 26 '19 11:11 harmanwebchfez31

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)?

lonalore avatar Nov 27 '19 07:11 lonalore