My site was getting traffic and it was on the rise, then I added https and somewhere in that time I also created tons of extra link for google to crawl, thinking this will increase traffic in those area where there was no traffic.

It backfired, my traffic reduced from 900/day hits to some 300 now. I have implemented 301 redirect for subdomains (subdomain somehow had duplicate pages so removed it) and then there was PHP script where I created these extra links, I don't know what properly unindex them now.

It has been 5 days since I made those changes, still the indexed pages are still in 55k which is huge. My site originally had 11k index pages, then rose to 100k and now at 55k. How can I remove those 'extra links' from index that I had created using PHP Script. Note I had asked google to index the whole page that I created and index all the links coming out of it.

PHP Code

This is the code where I created these links (forcefully). Basically my website is city base. I am pulling all cities, and then force them to use all the tags I have for all the cities.

$result1 = getDistinctBizCities();

if($result1 != false)
  while ($row1 = mysql_fetch_array($result1))
    echo '<h2>Businesses in '.$city.'</h2>';
    $result = getTags();
    $city = ucfirst($row1['city']);

    if($result != -1)
      while ($row = mysql_fetch_array($result))

        echo '<li><a href="/search.php?keywords='.$row['tags'].'&city='.$row1['city'].'">'.$row['tags'].' in '.$row1['city'].'</a></li>';     
      echo '</ol>';

I would fire the 410 Gone as a header - so Google quickly learns these pages are away and removes them fast from index.


     if ($_SERVER['REQUEST_URI'] == '(url-pattern-to-remove-1|url-pattern-to-remove-2)') {
       header ("HTTP/1.1 410 Gone");
  • This is the link to that page, what is your recommendation. Just remove the links and set the headers? – anonymous Mar 1 at 9:48
  • Because these links are valid otherwise, but I forcefully created them, do not have any valid contents. – anonymous Mar 1 at 9:50
  • If yout just remove them, I think they remain in the index database and Google will try to re-visit them. But if they remain and fire the 410 header Google deindex them just after first revisit – Evgeniy Mar 1 at 10:07
  • I am thinking of setting `$header= ('HTTP/1.1 410 Gone'); and then echo that from search page and run the script. Temporarily it should remove these pages but will effect other pages too.. Well in fact I have made all search pages NoIndex as I probably should make google crawl this page. What do you say – anonymous Mar 1 at 10:10
  • 1
    I would prefer 410 before noindex, which can be too slow and not mandatory – Evgeniy Mar 1 at 10:11

In my humble opinion and I have already tested it - the best way of removing pages from index comes in a few phases:

  1. On the pages you want to remove from index implement no-index.
  2. Create a temporary sitemap.xml with URLs of these pages.
  3. Ping this sitemap.xml file to Google using GSC or http://www.google.com/ping?sitemap=URL/of/file

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.