Post by gammongames123 » Fri May 25, 2018 9:47 pm

Hello!

We're running several different stores via opencart multistore.

We've noticed that we've gotten a few problems with running the stores because of duplicate content issues.

We have known come to the conclusion that we need to close down some stores, but still have some of them up. Since they are generating sales and are also targeted towards b2c and b2b.

We are now wondering how we can put noindex on some of the domains ( Not all of them)

We've been searching for plugins, but can't find any. Do you know of any or any other solutions?

Best regards
Douglas


Posts

Joined
Fri Jul 28, 2017 8:24 pm

Post by Qphoria » Fri May 25, 2018 10:39 pm

1. EDIT: catalog/controller/common/header.php

2. FIND:

Code: Select all

$data['title']
3. AFTER, ADD

Code: Select all

$noindex_store_ids = array(1,4,6); // Add the store ids of the stores you want to have noindex
$data['noindex'] = false;
if (in_array($this->config->get('config_store_id'), $noindex_store_ids)) {
    $data['noindex'] = true;
}
4. EDIT: catalog/view/theme/YOURTHEME/template/common/header.tpl (or header.twig)

5. BEFORE THIS:

Code: Select all

</head>
6a. (.tpl file)
ADD THIS:

Code: Select all

<?php if ($noindex) { ?>
<meta name="robots" content="noindex">
<?php } ?>
6b. (.twig file)
ADD THIS:

Code: Select all

{% if noindex %}
<meta name="robots" content="noindex">
{% endif %}

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am
Who is online

Users browsing this forum: No registered users and 286 guests