Add noindex to search URLS

For general questions and discussions specific to the AbleCommerce GOLD ASP.Net shopping cart software.
Post Reply
foodsleuth
Commander (CMDR)
Commander (CMDR)
Posts: 139
Joined: Wed Mar 31, 2010 8:59 pm

Add noindex to search URLS

Post by foodsleuth » Mon Aug 19, 2019 12:55 pm

Hi,
1. We're an older site so 150 "search" pages are already in Google's index and we don't want them to be.
2. We can add a disallow in Robots.txt but that won't take the pages our of the index.
3. We read we should put a noindex on the search page but I'm not sure where (which page) that should go on. Once I can do that, I think Google will eventually drop the pages from the index then I can put the robots.txt disallow back in.

Where should the noindex tag go (which page)?

Thanks
Barb

foodsleuth
Commander (CMDR)
Commander (CMDR)
Posts: 139
Joined: Wed Mar 31, 2010 8:59 pm

Re: Add noindex to search URLS

Post by foodsleuth » Tue Aug 20, 2019 5:22 pm

OK, so I "tried" to follow the instructions on this post: I did this but got a server error.

viewtopic.php?f=65&t=18510&p=81048&hili ... age#p81048

There were 2 sets of instructions. I tried the set towards the bottom of the post where this line:
BindSearchResultsPanel();

Is replaced with this:
// ADD NOINDEX META TAG TO PREVENT BROWSERS FROM INDEXING THE PAGE
HtmlMeta keyword = new HtmlMeta();
keyword.Name = "robots";
keyword.Content = "noindex";
Page.Header.Controls.Add(keyword);

BindSearchResultsPanel();

Now, in the first post it mentions adding this to the top of the page (which I did not do). Is this perhaps what gave the server error, this missing line?
using System.Web.UI.HtmlControls;

Thanks
Barb

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Add noindex to search URLS

Post by mazhar » Fri Aug 30, 2019 4:35 am

Now, in the first post it mentions adding this to the top of the page (which I did not do). Is this perhaps what gave the server error, this missing line?
using System.Web.UI.HtmlControls;
Yes, you must add this line at the top. This will make controls available that you are using in other lines of code.

foodsleuth
Commander (CMDR)
Commander (CMDR)
Posts: 139
Joined: Wed Mar 31, 2010 8:59 pm

Re: Add noindex to search URLS

Post by foodsleuth » Fri Aug 30, 2019 9:50 am

Hi,
Yes, I finally tried that and It seems to be working. It takes forever to get stuff out of Google's index!
Thanks!
Barb

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Add noindex to search URLS

Post by mazhar » Tue Sep 03, 2019 6:27 am

Glad that you have it all sorted!

Post Reply