SEO: Proper way of deleting pages

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
pnigro's picture

Hello,

I plan on redoing my site and would like to know the proper way of deleting pages in terms of seo. I have ~100 product nodes, taxonomy, views, and panel pages I will be deleting in the process. From what I can gather, I would need to implement a 301 redirect using Path Redirect for each of the pages before removing them. Since the pages will no longer be related to the new version of the site, does it matter where I redirect the pages to if they have no PR or inbound links? I was thinking of redirecting them to the home page. Will this have an effect on my home page (~100 page redirects to /), which has a PR of 2? Any help would be much appreciated.

Thank you,
Paul

Comments

redirecting to a new site

harryc's picture

In the interest of economy, I always redirect wayward links to the home page of the new site. This is mostly for the benefit of visitors not search engines.

Perhaps a better way would be to create a landing page that explains that the page no longer exists, but you can find what you need by clicking here...

That way the search engine will quickly learn that the content at the link no longer exists and won't be searching for relevance on your new home page.

Happy visitors. Happy search engines.

Hello harryc, So if I

pnigro's picture

Hello harryc,

So if I understand you correctly, I can redirect the old pages to lets say a page node that explains that the content no longer exists and provide links to other content on this page node?

Thank you for the help

I assume I would also need to

pnigro's picture

I assume I would also need to tag the landing page with noindex so that the page doesn't get indexed by crawlers?

But you might want it to

brianmercer's picture

But you might want it to return a 404 to search engines so that they remove the page from the index.

You could use the custom_error module and show a message on 404 that "The page you're trying to access doesn't exist. It may have been deleted".

You could also include a search box under it or a related topics box based on the title if you insert the proper php code.

Hello brianmercer, Yes, I

pnigro's picture

Hello brianmercer,

Yes, I want to make sure that the old pages are removed from the index. So if I install custom_error module, do I even need to do 301 redirects from the old pages? Could I just put a link to the home page in the custom_error module description field?

Thanks

Something like this:

brianmercer's picture

Something like this: http://test.brianmercer.com/nonexistentpage

is produced by this code in custom_error:

<p>Sorry, the page you requested does not seem to exist.  It may have been deleted.  Use the search form below to search the site, or go to the <a href="/">home page.</a></p>

<?php
// check that the search module exists and the user has permission to hit the form
if (module_exists('search') && user_access('search content')) {
 
// cool! - customerror doesn't trash the page request and the full path is available
 
$path = $_REQUEST['destination'];
 
// bin anything that's not alphanumeric and replace with spaces
 
$keys = strtolower(preg_replace('/[^a-zA-Z0-9-]+/', ' ', $path));

 
// retrieve the search form using the data we've pull from the request
  // note that we can override the label for the search terms field here too
 
print drupal_get_form('search_form', NULL, $keys, 'node', 'Search terms');
}
?>

Although that preg_replace isn't working for me atm. It's searching with the hyphens...Hmmm

It depends on how many 404s you get, but I am not crazy about the search404 module which actually runs the search on every 404. This way just populates a search box.

OK, make that: $keys =

brianmercer's picture

OK, make that:

$keys = strtolower(preg_replace('/[^a-zA-Z0-9]+/', ' ', $path));

Thank you very much for the

pnigro's picture

Thank you very much for the snippet. By having all these 404s, do you think that will hurt my site? The pages I will be deleting receive very little traffic, are mostly accessed by crawlers and do not have PR or inbound links.

Issuing a 404 is the proper

brianmercer's picture

Issuing a 404 is the proper procedure for removal from the index.

http://googlewebmastercentral.blogspot.com/2007/04/requesting-removal-of...

Interesting how that article suggests also using a 410 "Gone". Someone already suggested that it be added to path_redirect, http://drupal.org/node/189105, but got shot down.

You could write a module that keeps a list of paths and returns a 410 with a custom message "this page has been deleted".

Thank you very much for your

pnigro's picture

Thank you very much for your help. I am going to use the custom_error module along with the snippet you provided for all of the pages that have no relevant new page. I will then use a 301 redirect for all pages that do have a relevant page.

search 404

I just don't like the fact

brianmercer's picture

I just don't like the fact that search404 actually runs the cpu-intensive/db-intensive search on every 404, even if it's a crawler doing the visiting. With custom_error the visitor has to press the additional button if he wants to run the search.

I see he added the sideblocks into the page with search404, which is nice. Can you customize the text on search404? I haven't looked at search404 in at least a year.

Just 404 'em

Dave Reid's picture

You should be returning 404's if you're removing content. Redirect back to the homepage isn't really helpful - to me I would think something's wrong on the site that won't let me get to the content rather than it just no longer exists. I also second the recommendation for making your 404 page more friendly and using http://drupal.org/project/search404.

Senior Drupal Developer for Lullabot | www.davereid.net | @davereid

Search Engine Optimization (SEO)

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week