To block products from indexing in OpenCart, you must first make changes to the controller that are responsible for displaying products. This can be done by adding a special meta tag <meta name="robots" content="noindex, nofollow"> to the HTML code of product pages.
Let's look at it step by step:
- Open the product controller file at catalog/controller/product/product.php
- Find the index() method and add code to it that adds the "robots" meta tag. It will roughly look like this:
public function index() {
$this->load->language('product/product');
// Your code for loading product data
$this->document->addMeta('robots', 'noindex, nofollow');
// The rest of the index() method code
}
Go to your store's product page and make sure the <meta name="robots" content="noindex, nofollow"> meta tag is present in the page code.

















































Comments