Forums / General Questions / Wanting to have <noindex> on certain categories

Wanting to have <noindex> on certain categories

Started by dannyvarley on 30 May 2013, 11:31 AM · Views: 1,472

Results 1 to 7 of 7
30 May 2013, 11:31 AM
#1
dannyvarley avatar

dannyvarley

Zen Follower

Join Date:
Dec 2011
Posts:
287
Plugin Contributions:
0

Wanting to have <noindex> on certain categories

Hi There!

My cart had thousands of products which are very very similar and I don't want any of these indexed by the search engines. I want to add a <Noindex> tag to certain products. I'm not sure how to do this.

I think I good way would be to code something in so I can add meta tags into the page where you change the products title?

I nowhere near have the skill to do this though :P. so I'm looking for you lovely people to give me a little help or advice in the best way to do this?

Many thanks
Daniel

30 May 2013, 1:07 PM
#2
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Wanting to have <noindex> on certain categories

DannyVarley:

I want to add a <Noindex> tag to certain products. I'm not sure how to do this.

noindex tags can only be added to pages, not specific products (unless those products are on a page of their own, of course).

My instinct here is to tell you it can't be done, but I'm sure if I do so, someone will go out of their way to demonstrate that it can, so on that basis, in order to best help you. It can't be done <smiles>

Cheers
Rod

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

30 May 2013, 1:47 PM
#3
dannyvarley avatar

dannyvarley

Zen Follower

Join Date:
Dec 2011
Posts:
287
Plugin Contributions:
0

Re: Wanting to have <noindex> on certain categories

Hehehe thanks for the help! :laugh:

When I say that I was it on certain products I mean the product pages for example:

http://kitchenwarehouseltd.com/complete-kitchen-units/18mm-thick-shaker/beech-units/150-base-unit

So i'm gonna explain something but I might be completely wrong just stick with me.

In my mind it would be accomplished by putting code in the html_header.php to say "If the product is marked as no index* and if it is a product info page then apply the meta tag"

*This will be done by a checkbox on the same page as where you specify the page title

Thats just some rambling idea that i'm not sure is possible or would even work or even makes sense. Maybe a better way to put it is I want all the product pages in one certain catagory "cPath=1" to have the noindex tag.

Danny

30 May 2013, 8:11 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Wanting to have <noindex> on certain categories

Two small coding additions required:

  1. /includes/auto_loaders/config.customNoIndex.php```
<?php $autoLoadConfig[165][] = array('autoType'=>'init_script', 'loadFile'=> 'init_custom_noindex.php'); ``` 2. /includes/init_includes/init_custom_noindex.php``` <?php // Custom additional rules to cause the noindex,nofollow metatag to be output if (isset($cPath_array) && sizeof($cPath_array) > 0) { // category-specific rules here if ($cPath[0] == 1 && isset($_GET['products_id']) && (int)$_GET['products_id'] != 0) { // if the first part of cPath is "1" or "1_" and a products_id is specified $robotsNoIndex = true; } // more category-related rules can go here // the following brace ends the file } ```

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

31 May 2013, 8:47 AM
#5
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Wanting to have <noindex> on certain categories

DannyVarley:

Hehehe thanks for the help! :laugh:

<big grin>No problem. It was actually more productive than I expected it to be. LOL.

Dare I say it, but the predictability level around these parts sometimes even takes me by surprise. That's not to say DrByte wouldn't have given the exact same reply without my little exercise in psychology, but is there any real way of knowing for sure?

Problem now is that I probably won't be able to use this ploy again for another few months now that I've made people aware that they are being 'played'. Or, will it be due to this new revelation that I won't be able to use it that will have people double guessing themselves (and me), with the net result that nothing will change. (See what I did there?). <g>

Cheers
Rod

They sees me coming. They be hating........

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

31 May 2013, 9:02 AM
#6
dannyvarley avatar

dannyvarley

Zen Follower

Join Date:
Dec 2011
Posts:
287
Plugin Contributions:
0

Re: Wanting to have <noindex> on certain categories

Hi DrByte!

I tried your way but I couldn't get it to work :( Could this be to do with the URL rewriter?

Also I found another thread where you helped which could also apply to my situation

So, instead of creating them as "Product General" when you create the products in your admin, choose "Document-General". (You mentioned importing, so use the proper products_type when importing if that's the method you're using instead.)
Then in your custom version of the meta_tag.php language file set the ROBOTS_PAGES_TO_SKIP to include document_general_info and it'll automatically set the noindex,nofollow for you when those products are displayed.

Could I change all the product types to another type and then just do what you said above?

Many thanks,
Danny

31 May 2013, 11:09 AM
#7
dannyvarley avatar

dannyvarley

Zen Follower

Join Date:
Dec 2011
Posts:
287
Plugin Contributions:
0

Re: Wanting to have <noindex> on certain categories

Ok So heres another update,

I think that I can change all my products to the Product Type of free shipping but just change the free shipping default to off. Then add product_free_shipping_info to the meta tags. I have tested this by changing the product_type in the database to 5 on one of the products and it works!

Now I think all I need to do is update all the products in the category id 1 to have a product type of 5. I thought I might be able to just use easy populate to change the product types but Im not sure if it works? And theres a whole lot of products to change them in the database manually. Any ideas?

Danny