Drupal SEO in under 5 minutes

by Brian Chappell on February 12, 2008

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?

{ 3 trackbacks }

Friday Tea Time - 2/22/08
February 22, 2008 at 1:46 pm
Top 10 Reasons Why Great Content Fails on Social Media · SEO Guide - Tips, Tricks and Secrets
May 21, 2008 at 3:41 pm
How to SEO Drupal - Video by Brian Chappell | Free Online Books
July 15, 2008 at 3:35 am

{ 12 comments… read them below or add one }

DJLitten February 13, 2008 at 1:49 pm

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

Francois Harris February 14, 2008 at 2:13 am

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.

yaph February 18, 2008 at 1:24 pm

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.

Gab Goldenberg February 21, 2008 at 12:09 am

This shoulda gone hot on Sphinn! Malakas…

Brian Chappell February 21, 2008 at 9:36 am

@ 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 ;)

Linda Bustos March 12, 2008 at 6:16 pm

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

Brian Chappell March 20, 2008 at 8:15 am

@ 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.

Wpanssi June 10, 2008 at 3:26 pm

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!

james September 16, 2008 at 8:21 pm

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!

drupalranch September 26, 2008 at 1:26 pm

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

Andrew January 5, 2009 at 3:50 am

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

Perry Donham January 12, 2009 at 2:17 pm

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

Leave a Comment

Previous post: 23 Top online retailers analytic packages revealed

Next post: Trackur Review – Is it worth it?