Drupal SEO in under 5 minutes

by on Feb 12th, 2008 - 15 Comments

stopwatchDrupal in my opinion is the most search engine friendly, out of the box, solution in existence today. However, with that said, there are still some things that need to be done to any installation to ensure search engine success, and save you from issues down the road.

Note: Keep in mind many of the tactics listed below are things that should be done from the get go. If you plan on implementing these tactics with a site that is already fully built, indexed and aged, then you are going to want to take different steps to ensure SERP disaster doesn’t ensue.

  • First thing is first, turn on clean URLs (which is the same thing as entering /%postname%/ in the permalink structure section in WordPress) Navigate to Home > Administration > Site Configuration > Clean URL’s. You need to make sure your server accepts mod_rewrite or this is not going to work.
  • Go download the Drupal page title module. It is going to take some tinkering to get this to work, but in the end gives you the flexibility of having different page titles than your headings.
  • To make this work you need to make sure your theme has a template.php If it doesn’t then you will need to create one (the page title module has an example one you can use). These lines need to be added to the ‘page’ hook of the _phptemplate_variables function.

    if (module_exists(‘page_title’)) {
    $vars['head_title'] = page_title_page_get_title();
    }

  • Next, go download the global redirect module. This will take care of the duplicate content issues that arise from having a directory and a page with the same exact content. Eg., www.example.com/duplicate & www.example.com/duplicate/ This module will automatically redirect the “/” version of the page to the non “/” version, thus creating one version. You can also do this on your own by modifying your .htaccess file, but this is an easier solution.
  • You will also want to alleviate any canonicalization issues that your site might see from backlinks that point to non www versions or www versions. Use the following code in your .htaccess file to ensure this is taken care of.
  • RewriteCond %{HTTP_HOST} ^site\.com$ [NC]
    RewriteRule ^(.*)$ http://www.site.com/$1 [R=301,L]

  • Drupal also creates duplicate content, similar to the directory issue noted above, in the /node/ section of your site. This is a very simple fix as well. Go into your robots.txt folder and block this section of your site with the following code:
  • Disallow: /node$

  • Make sure you also download the Drupal Meta Tag module, this allows you to insert meta tags and description tags for each page/article you post on the site.

What other modules do you use to make your Drupal site SEO friendly?

  • DJLitten

    Very cool, passing it around the office as we speak.

  • http://blog.sa-nethost.com Francois Harris

    Cool man, will definitely give it a bash, am quite a ‘joomla boy’ but am gonna play with Drupal today, so am glad I read this.

  • http://www.seo-expert-blog.com yaph

    I use the pathauto module for automatically creating URL aliases. It allows you to create patterns for URLs based on node types, users, dates, etc. and offers filtering out selected words.

  • http://seoroi.com/ Gab Goldenberg

    This shoulda gone hot on Sphinn! Malakas…

  • http://www.BrianChappell.com Brian Chappell

    @ Dj , @ Francois

    Thanks guys glad it was of some use!

    @ Yaph

    I like to simply go in there and manually set the page name since Drupal gives you that option. I didn’t realize that module utilized patterns though, pretty cool.

    @ Gab

    Yea Drupal doesn’t serve the mass populous like WordPress does. If it was a WordPress SEO post it probably would have ;)

  • Pingback: Friday Tea Time - 2/22/08

  • http://www.getelastic.com Linda Bustos

    Yay Drupal!

    What do you think of the Google Sitemaps module? Beneficial or no for SEO?

    http://drupal.org/project/gsitemap

    I also like to throw in Analytics so you can see the results of your SEO

    http://drupal.org/project/google_analytics

    And nodewords to write meta descriptions for a bit more control over your SERP listing and hopefully better click through, even if you’re not #1

    http://drupal.org/project/nodewords

  • http://www.BrianChappell.com Brian Chappell

    @ Linda

    I think the gsitemap plugin is now called the XML plugin, which is the one I mentioned above.

    Never used the g analytics plugin, will have to check that out.

    Nodewords is pretty much the same as the Meta Tag module.

  • Pingback: Top 10 Reasons Why Great Content Fails on Social Media · SEO Guide - Tips, Tricks and Secrets

  • http://www.sitemedia.fi Wpanssi

    Thanks for the article! I became a little curious when you mentioned in the beginning that “If you plan on implementing these tactics with a site that is already fully built, indexed and aged, then you are going to want to take different steps to ensure SERP disaster doesn’t ensue.”

    What should I do if I’ve had my site running for some time already? And what’s a SERP disaster?

    Thanks!

  • Pingback: How to SEO Drupal - Video by Brian Chappell | Free Online Books

  • james

    Hi…I’m trying to figure out where to add the .htaccess lines you suggest. At the end of my .htaccess file I find the following:

    # If your site is running in a VirtualDocumentRoot at http://example.com/,
    # uncomment the following line:
    # RewriteBase /
    # Rewrite URLs of the form ‘x’ to the form ‘index.php?q=x’.
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !=/favicon.ico
    RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

    # $Id: .htaccess,v 1.90.2.1 2008/07/08 09:33:14 goba Exp $

    Should your lines come after this?

    Thanks for the great article!

  • http://drupalranch.com/ drupalranch

    nice tutorial..
    see more drupal tutorials here.
    http://drupalranch.com/tag/tutorial

  • Andrew

    Nice Article Brian, you can find another good article at http://nbridges.com/blog/seo-for-drupal/

  • http://www.kidpub.com Perry Donham

    Excellent advice, especially about the title tag. Google uses the title tag to form the link to your site when displaying search results. My feeling is that the tag is critical for effective marketing…it should in ten words tell the reader exactly what your website offers. You are only going to get a second or to of the reader’s attention, so that link is perhaps the only thing that the searcher will see.

    I have some discussion of the title and description tags and some empirical results at http://kidpub.blogspot.com.

    Perry

  • http://www.sehitak.com sehitak

    thank you for sharing this , nice post

  • http://www.ontimesharetips.com Jaya Lakshmi

    Drupal rocks in too many ways. Just read an article on how WordPress could be hacked by Microsoft IIS Server and it’s really scary.