Opencart noindex, nofollow tags?

Opencart noindex, nofollow tags?

It is very easy to put a “noindex” tag on the tag pages from your Opencart store.

You need to find and edit the file named “header.tpl”. This can be found in “catalog\view\theme\your theme\template\common”.

Open “header.tpl” and add anywhere in the header, before the style tag.

1
2
3
4
5
6
7
8
9
10
<?
$url = $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
if (preg_match('/tag/', $url)) 
        {
echo'<meta name="Googlebot" content="NOIndex, Follow" />';
	}
   else
   	{
        }
?>

This will work if your tag url is something like “index.php?route=product/search&tag=purple maxi dress” (it contains the word “tag”).


Yes, php scripts are working in the header.tpl file.

The tag pages will have NOIndex, Follow while the rest of the pages won’t have any Googlebot tag. You can add “Index, Follow” but it won’t matter.

Add a comment: