Jump to content



Photo
- - - - -

Addon to stop bots from following action=buy_now on the buttons


This topic has been archived. This means that you cannot reply to this topic.
10 replies to this topic

#1   NodsDorf

NodsDorf
  • Members
  • 1,278 posts

Posted 19 March 2012 - 18:22

Just noticed this today in a SEOmoz report. We are seeing 302 errors from redirection to the cookie usage page as the bots are trying to follow the buy now buttons on our site. Shouldn't those all be nofollow?

Maybe there is a mod that deals with this if so I missed it, but nofollow should be part of basic code when generating action buttons.... I think.

I think it will be a fairly simple fix, if I find a solution I'll post it, or if you have one I'd appreciate the code.

Thanks,
Don

Edited by NodsDorf, 19 March 2012 - 18:26.


#2   kymation

kymation

    Code Monkey

  • Community Sponsor
  • 8,208 posts

Posted 19 March 2012 - 18:28

The cart and checkout pages should be in your robots.txt file so the bots will leave them alone. Having them redirected to the cookies page is actually harmless, so I wouldn't put too much effort into fixing this.

Regards
Jim

My Addons

Banners Box Download Support
Categories Accordion Box Download Support
Closest Shipper 2.2x Support
Document Manager 2.2x Support
Generic Box Download Support
Get 1 Free 2.2x Support
Price in Cart Only/MAPP Download Support
Modular Front Page Download Support
Modular SEO Header Tags Download Support
MVS 2.2x Support
PDF Datasheet Download Support
Price Updater 2.2x
Products Specifications 2.3.x Development Version Support Bugs/Suggestions
Request a Review Download Support

Shopping List Download Support New!
Specials Image Overlay Download Support
Superfish Categories Box Download Support
Theme Switcher 2.3+ Support  Updated


#3   NodsDorf

NodsDorf
  • Members
  • 1,278 posts

Posted 19 March 2012 - 21:55

Hi Jim,

Indeed shopping cart / checkout pages are blocked via robots.txt, but the URL being displayed on the page is like
href="http://www.rubberstore.com/catalog/as568-nitrile-c-33_39_43.html?products_id=29&action=buy_now&sort=3a

If nothing more its annoying to see kathousand errors via Seomoz reports, I just need to figure out how to add the nofollow attribute in the product_listing where the button is generated.

#4   kymation

kymation

    Code Monkey

  • Community Sponsor
  • 8,208 posts

Posted 19 March 2012 - 22:03

Try something like this:

if( isset( $_GET['action'] && $_GET['action'] != '' ) {
// Output a noindex/nofollow tag here
}


Regards
Jim

My Addons

Banners Box Download Support
Categories Accordion Box Download Support
Closest Shipper 2.2x Support
Document Manager 2.2x Support
Generic Box Download Support
Get 1 Free 2.2x Support
Price in Cart Only/MAPP Download Support
Modular Front Page Download Support
Modular SEO Header Tags Download Support
MVS 2.2x Support
PDF Datasheet Download Support
Price Updater 2.2x
Products Specifications 2.3.x Development Version Support Bugs/Suggestions
Request a Review Download Support

Shopping List Download Support New!
Specials Image Overlay Download Support
Superfish Categories Box Download Support
Theme Switcher 2.3+ Support  Updated


#5   NodsDorf

NodsDorf
  • Members
  • 1,278 posts

Posted 22 March 2012 - 19:11

HI Jim,

Thanks for the idea there, I got around to trying to fix this today and I am coming up blank on where to put the nofollow to get it to parse correctly.

In /includes/modules/product_listing.php
I'm assuming I need to edit this code:
case 'PRODUCT_LIST_BUY_NOW':
		    $prod_list_contents .= '	    <td align="center">' . tep_draw_button(IMAGE_BUTTON_BUY_NOW, 'cart', tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action', 'products_id')) . 'action=buy_now&products_id=' . $listing[$x]['products_id'])) . '</td>';
		    break;
However no matter were I try and put rel="nofollow" the link is not coming out correctly.

I don't really think I need to check to see if there is an action set, so I was just trying to stick the tag in there. I can't think of any reason for these buttons not to have a no follow tag, since the product image and the product name already link to the product page, and the button will always link to "add to cart" action.

#6   kymation

kymation

    Code Monkey

  • Community Sponsor
  • 8,208 posts

Posted 22 March 2012 - 19:25

I think this will work. Not tested, so beware bugs:

				    $prod_list_contents .= '	    <td align="center">' . tep_draw_button(IMAGE_BUTTON_BUY_NOW, 'cart', tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action', 'products_id')) . 'action=buy_now&products_id=' . $listing[$x]['products_id']), NULL, array('params'=>'rel="nofollow"')) . '</td>';


Regards
Jim

My Addons

Banners Box Download Support
Categories Accordion Box Download Support
Closest Shipper 2.2x Support
Document Manager 2.2x Support
Generic Box Download Support
Get 1 Free 2.2x Support
Price in Cart Only/MAPP Download Support
Modular Front Page Download Support
Modular SEO Header Tags Download Support
MVS 2.2x Support
PDF Datasheet Download Support
Price Updater 2.2x
Products Specifications 2.3.x Development Version Support Bugs/Suggestions
Request a Review Download Support

Shopping List Download Support New!
Specials Image Overlay Download Support
Superfish Categories Box Download Support
Theme Switcher 2.3+ Support  Updated


#7   NodsDorf

NodsDorf
  • Members
  • 1,278 posts

Posted 22 March 2012 - 20:50

Thanks Jim

I'll let you know how it goes when I get into work tomorrow, really appreciate the continued help.

#8   NodsDorf

NodsDorf
  • Members
  • 1,278 posts

Posted 23 March 2012 - 16:28

Jim that was absolutely spot on

I was thinking that you could add the rel=nofollow into one of the all ready defined functions. Good call... and off the top of your head very nice!

<span class="tdbLink"><a id="tdb3" href="http://www.rubberstore.com/test/catalog/as568-nitrile-c-33_39_43.html?products_id=31&amp;action=buy_now&amp;sort=2a" rel="nofollow">Buy Now</a></span>

Thank you very much!

Edited by NodsDorf, 23 March 2012 - 16:31.


#9   hobievi

hobievi
  • Members
  • 23 posts

Posted 08 February 2013 - 21:03

Option 1) Go to Google Webmasters: https://www.google.c...-url-parameters
Disable "action" there

Option 2) Add this to your robots.txt: Disallow: /*action=*
Thanks,
Yavuz

#10   kymation

kymation

    Code Monkey

  • Community Sponsor
  • 8,208 posts

Posted 08 February 2013 - 23:22

Option 2 won't reliably work. The robots.txt standard does not allow wildcards in file/directory names. Some search engines might allow them, but they don't have to.

Regards
Jim

My Addons

Banners Box Download Support
Categories Accordion Box Download Support
Closest Shipper 2.2x Support
Document Manager 2.2x Support
Generic Box Download Support
Get 1 Free 2.2x Support
Price in Cart Only/MAPP Download Support
Modular Front Page Download Support
Modular SEO Header Tags Download Support
MVS 2.2x Support
PDF Datasheet Download Support
Price Updater 2.2x
Products Specifications 2.3.x Development Version Support Bugs/Suggestions
Request a Review Download Support

Shopping List Download Support New!
Specials Image Overlay Download Support
Superfish Categories Box Download Support
Theme Switcher 2.3+ Support  Updated


#11   Jack_mcs

Jack_mcs
  • Members
  • 26,497 posts

Posted 09 February 2013 - 01:23

Google, Bing and yahoo allows wildcards. Once they do, all of the others usually will and I suspect they already do.