Go Top
advertise here!!!

Library || READ MORE || DOWNLOAD PDF || QUESTION ANSWERS || HOME

  • DRUPAL INTRODUCTION ↓

    Welcome to the doorsteps of Drupal, the current buzz of World Wide Web. Today more than 1.5% of all websites rely on Drupal as their back end support and many more are on their way to join in the march to make this technology the most affordable and effective way to broadcast websites with unique faces. From government houses, corporations, media & publishing companies, social communities and individuals, the usage of Drupal is extensively increasing year after year since its birth in 2001. From a recent estimate, it is found that 7.2 million sites use Drupal. Proud winner of Packt Open Source CMS Awards and Webware 100, Drupal is all set to take the next gen Internet world into complete control.

    What is Drupal?

    Drupal is a free to download and available open source software package for social publishing system from the brain house of Dries Buytaert. It facilitates an open source content management system (CMS) and content management framework (CMF). With its base codewriting in PHP is maintained and developed by a large community of more than 630K users and developers globally. As the name suggests, it is a free to download and share software and is distributed under the terms of GNU General Public License.

  • DRUPAL INSTALLATION ↓

    UPDATE: This tutorial was for Drupal 4.7. With Drupal 5 and Drupal 6 installation is much easier. Just upload the files to your server and visit your site. Follow the directions on the screen and you are done!

    I've read some reviews of Drupal online that claim Drupal is hard to install.

    I'm not sure what kinds of problems people have had, but installing Drupal is actually very easy if you server is configured correctly.

    There are only four steps:

    1. Upload Drupal to your server (for Drupal hosting, I recommend Site5)
    2. Create a database and database user
    3. Edit the file /sites/default/settings.php to add your database connection information
    4. Create the database tables using the appropriate .sql file in the /database directory

    An easy way to install Drupal

    Downloading and Uploading Drupal

    First download Drupal from Drupal.org.

    Uncompress the file. If you are using Windows and are not sure how to uncompress a file, download a free trial version of WinRAR. WinRAR is similar to WinZIP, but I think it's better.

    Upload the files in the Drupal directory to your web server with an FTP program. If you are using GNU/Linux/BSD, Konqueror and gFTP are two good FTP programs. If you are using Windows, try a free FTP program called Filezilla (or Portable Filezilla).

    Creating a MySQL database and database user

    You should create a database in MySQL for your Drupal installation. You can usually do that through your web hosting control panel. You need to create a database, a database user, and then add the database user to the database with "all" privileges. If you don't know how to create a MySQL database, check your hosting company's help documentation.

    Edit settings.php

    You then need to add your database connection settings to the file located at /sites/default/settings.php.

    Find the line that says:

    $db_url = 'mysql://username:password@localhost/databasename';

    Fill in your database username, database user's password, the database name, and the database host (usually just localhost)

    Create the database tables

    Navigate to Drupal's /database directory on the Drupal folder your local computer.

    Here is a list of the files in that directory from the current Drupal version 4.7:

    Drupal database files

    You are probably using MySQL. You hosting control panel should let you know which version of MySQL is installed. If you can't find out what version on MySQL is installed, you can create a file called info.php that contains the following lines:

    <?php 
      echo phpinfo();
    ?>

    Upload that info.php file to the root of your Web server and then open it in a browser (e.g., http://www.EXAMPLE.com/info.php). That page will display information about your PHP and MySQL installation including the MySQL version.

    If you are using MySQL 4.0 then you will use the file called database.4.0.mysql. If you are using MySQL 4.1 then you should use the file called database.4.1.mysql. (If using PostgreSQL, then use the file database.pgsql.)

    Go to your web hosting control panel and find PHPmyAdmin (most hosting companies offer it). Click on the tab that says "Import" as shown below:

    PHPmyAdmin - importing database commands

    Use the "Browse" button to find the correct database file to upload. PHPmyAdmin will create your database from that file.

    Finished

    After you complete those steps Drupal should be installed. Navigate to your new Drupal site (e.g., http://www.EXAMPLE.com/) and you should see the welcome page something like the one shown below, although yours may have a different blue theme:

    Drupal welcome page

    Follow the directions on that page to create the admin account, and configure your new Drupal site.


    These are instructions for installing Drupal 5:

    Download Drupal

    Download the latest version of Drupal from Drupal.org.

    Create the Database

    Create a new MySQL database on your Web server. If you are using a shared host like Site5, you can create a new MySQL database in the control panel. Be sure to write down the database name, database user, database password, and database host. The database host is usually localhost, but read the instructions in your hosting company's control panel to be sure.

    Upload Drupal

    Uncompress and upload Drupal to your server.

    Enter Database Settings

    Visit your Drupal installation with your Web browser and enter your database into the database configuration screen that should appear:

    Install Drupal configuration screen

    Create the Admin Account

    You will then be directed to the front page of your new Drupal site where there is a link to create the administrator account.

    Home page of new Drupal installation

    For more detailed instructions, see the comprehensive How to Install Drupal 5 instructions on Drupal.org.

  • WHY DRUPAL ↓

    Drupal CMS - Great for SEO!
    If you are interested in developing search engine friendly Web sites with a content management system, you should be taking a close look at the open-source Drupal CMS. This post covers 10 reasons why you should be considering Drupal for your SEO-friendly content management instead of WordPress, Joomla, or Plone. [scroll down for the list]


    Why Content Management?

    If you are building search-engine-friendly Web sites and want them to be scalable, you should be using a content management system rather than building sites with plain HTML pages or Dreamweaver templates.

    A content management system:

    • generally stores your content in a database
    • keeps the design of the site separate from the content
    • makes it so that to update something on every page of your CMS Web site you generally only have to update it in one place, not on every individual page of the Web site.

    This makes content management systems highly scalable.

    Also, good content management systems allow non-technical users add and edit the content without needing to know any HTML or Web design knowledge.

    10 Reasons to Use Drupal

    Here are 10 reasons why you should seriously be considering Drupal for your SEO-based Web development projects.

    1. Advanced URL Control — Unlike WordPress, Drupal gives you precise control over URL structure. Each item of content in Drupal (called a node) can be given a custom URL (called a URL alias). In WordPress you are generally limited to one type of permalink URL for all posts. You can override the "post slug", but it's much less precise than Drupal's URL aliases. You can also automate custom URL structures for each different content type with the Pathauto Module. The Global Redirect Module will automatically 301 redirect the internal Drupal URL to the custom URL alias. Unlike many other content management systems, Drupal's content pages have nice clean URLs.
    2. Custom Content Types and Views — You can use the Content Construction Kit (CCK) and Views Modules to create new content types and create advanced custom views for them without writing any codewriting. A few examples of "content types" are "blog posts", "news stories", "forum posts", "tutorials", "classified ads", "podcasts". You can create as many custom content types as you would like and display them in many different ways. Most content management systems would require writing codewriting to accomplish these tasks, but there is no programming knowledge required to do them in Drupal. Here is a quick & basic intro to Views called How To Build Flickr in Drupal.
    3. Revision Control — You can configure Drupal to save a new version of your pages every time they are editing. That means that you can go back to view or revert old revisions if you want.
    4. Taxonomy — Drupal has a powerful taxonomy (category) system that allows you to organize and tag content. Each Drupal "vocabulary" (set of categories) can be limited to certain content types. For example, you could have blog contents that allowed free tagging (similar to WordPress categories), while your news section might have a different vocabulary (set of categories) that could only be selected from an existing list of categories. You can also have hierarchical categories, with single or multiple parent categories. Drupal's advanced taxonomy features, combined with CCK and Views, allows you to easily target all of those long-tail keywords that you researched in Wordtracker.
    5. User Management — Drupal was designed for community-based Web sites and has strong user role and access control functionality. You can create as many custom user roles with custom access levels as you need. For example you could create the following roles, each with different levels of access to your features: "anonymous visitor", "authenticated user", "moderator", "editor", "webmaster", "admin". You can keep the advanced user management features (like multiple blogs) turned off if you don't want them, enabling them later if your site grows to a point where you would like to add more community features.
    6. Page Titles and Meta Tags — Drupal's Page Title Module gives you custom control of your HTML <title> elements, while the Meta Tags Module gives you control over your pages' individual meta description tags. This is difficult in some content management systems, but it's easy with Drupal.
    7. Excellent Documentation — Documentation includes the official handbooks, the massive API Reference, numerous tutorials, blogs, videos, and podcasts, and the excellent new book Pro Drupal Development. There is even a Drupal Dojo community where you can learn how to become a Drupal ninja.
    8. PHP Template — Drupal uses the PHP Template theme engine by default. Theming in Drupal is easier than theming in WordPress and doesn't necessarily require any PHP knowledge. Drupal's Theme Developer Guide is a great resource. I also recommend reading Chapter 8 in Pro Drupal Development.
    9. Drupal Cookbooks — If you want a feature that is not built into Drupal by default, chances are that someone has already written a codewriting snippet for it and posted it in the codewriting snippets section of Drupal.org.
    10. Large and Friendly Community — With so many major sites using Drupal, it's not going away soon. For an idea of the size of the developer community, take a look at the long list of community-contributed modules. The Drupal forum is highly active and are a great place to get your Drupal questions answered. You can also find Drupal support on IRC chat on channels #drupal-support and #drupal-dojo. To meet other Drupal users in your area, visit Drupal Groups.

    There are other open-source alternatives to Drupal, but here are a few reasons why I think that Drupal is better:

    • Joomla - It's not as search engine friendly out of the box as Drupal.
    • Plone - It''s powerful, but Plone is written in Python and has certain server requirements. It is not as easy to extend as Drupal, and it's harder to find people who know Python than who know PHP. Plone runs on the powerful, but complex, Zope 2.
    • WordPress - WordPress is excellent, but if you need something more heavy-duty or are building a site that you might want to extend in the future you should be considering Drupal.

    To get started with Drupal


  • DRUPAL BASIC CONFIGURATION ↓

    After you have installed Drupal and created the admin account, you will see a menu on the left side of the screen:

    Drupal installation - admin block

    Click on the menu item that says "Administer". That will lead you the the Drupal admin screen.

    You will probably see a warning message like this:

    Drupal warning message on installation

    Follow the "status report" link for more information, and you should see a screen something like this that contains information about your Drupal installation:

    Drupal status report

    Don't worry about cron right now, but if you have an error about your file system, then you should take care of it right away. Usually this means creating a directory called images/ in the root of your Drupal installation and making sure that it is writable.

  • DRUPAL MODULES ↓

    Installing Modules

    This is a quick introduction on how to install Drupal modules.

    Navigate to your /sites/all/ directory and view the README.txt file that exists there.

    As of Drupal 5.3, it says:

    This directory should be used to place downloaded and custom modules
    and themes which are common to all sites. This will allow you to
    more easily update Drupal core files. These modules and themes should
    be placed in subdirectories called modules and themes as follows:

    sites/all/modules
    sites/all/themes

    You should create those two new directories if you haven't done so already. All of your uploaded and custom modules should go in the new /sites/all/modules/ directory.

    Drupal modules can be downloaded from the Drupal modules pages.


    Recommended Modules

    Recommended Drupal modules for SEO

    Pathauto Module
    The Pathauto Module creates custom URL aliases based on configurable rules.
    Global Redirect Module
    The Global Redirect Module automatically redirects Drupal's internal URLs (e.g., http://example.com/node/123) to their URL aliases.
    Page Title Module
    The Page Title Module allows you to create cusom <title> elements for each node (page) of content.
    Front Page Module
    There are several ways to make a custom front page in Drupal, but this is the easiest one. Making a custom front page helps prevent duplicate content problems. More about that later.

    Recommended Drupal Modules

    Content Construction Kit (CCK)
    This module is one of the reasons that Drupal is great. Drupal provides several basic content types like "page", "story", "blog post", "forum post", and it gives you the ability to create new content types. The CCK module takes it a step further by allowing you to add custom fields to your custom content types (beyond the default "title" and "body"). A CCK tutorial is coming soon.
    Views Module
    The Views Module allows you to list nodes (pages) in custom ways. For example, if you created a custom content type called "business" for a business directory, you could use the Views Module to display lists of businesses in various ways. You might choose to list 25 business per page, or maybe a photo gallery of business photos arranged in a grid pattern.
  • DRUPAL THEMES ↓

    INSTALLING THEMES

    There are many free Drupal themes for download on Drupal.org's theme pages.

    To install a Drupal theme, navigate to your /sites/all directory and take a quick look at the README.txt file.

    As of Drupal 5.3, it says:

    This directory should be used to place downloaded and custom modules
    and themes which are common to all sites. This will allow you to
    more easily update Drupal core files. These modules and themes should
    be placed in subdirectories called modules and themes as follows:

    sites/all/modules
    sites/all/themes

    If you haven't done so already, just create those two new folders inside /sites/all/ called modules and themes. You will then have two new folders located at /sites/all/modules/ and /sites/all/themes/.

    All of your uploaded and custom themes and modules should go in those two new folders, and not in the same folders as Drupal's default themes and modules.

    If you want to modify an existing Drupal default theme, copy it from /themes/ to /sites/all/themes/ and give it a new name. For example, to make a modified version of the Bluemarine theme, copy it from /themes/ to /sites/all/themes/ and rename it.

    If you keep your modified modules and themes only in the /sites/all/ directory, it will be easier to keep track of your modifications.


    HOW TO MAKE DRUPAL THEMES

    Making a custom Drupal theme is actually quite easy. A Drupal theme is just a few PHP files, a CSS file, and an info file. I prefer the PHPtemplate theme engine (the default one) but you have several choices. See the bottom of this post for a link to the official Drupal Theme Developer's Guide which has information on other Drupal template engines.

    The following information was originally written for Drupal 4.7, but has been updated for Drupal 6 on March 4, 2009.

    Navigate to your /themes directory. You should have a theme there called /bluemarine. We will use that as an example.

    NOTE: before you edit any files you will copy the theme to another directory and rename it. Your custom themes go in the directory /sites/all/themes/. Details about that come later in this tutorial.

    Here is a list of the files in the Drupal 6's Bluemarine theme:

    Bluemarine Drupal tempate directory

    The Files of a Drupal Theme

    • bluemarine.info — A required file that is new to Drupal 6 which provides information about the theme.
    • page.tpl.php — The main template that defines the content on most of the page.
    • style.css — The CSS file that sets the CSS rules for the template.
    • node.tpl.php — This file defines the content of the nodes.
    • block.tpl.php — Defines the content of the blocks.
    • comment.tpl.php — Defines the content of the comments.
    • logo.png — Your logo, if you are using one.
    • screenshot.png — This is a screenshot of your theme that is used in the admin panel and in the user account settings if you have enabled more than one theme so that visitors can choose which theme they want to use.
    • box.tpl.php — puts a box around things like comments. See also http://drupal.org/node/11814.
    • style-rtl.css — this file is new to Drupal 6's Bluemarine. I think it's a CSS for right to left languages and can be ignored if you're using a left-to-right language like English.

    page.tpl.php and style.css

    The page.tpl.php and style.css files are the main files for your Drupal theme. The page.tpl.php is a mix of HTML and PHP. Look at the file and notice which snippets of PHP are used where. For example, the following snippet from the page.tpl.php file inserts the site's <head> information. Just copy that snippet into your own custom Drupal template.

    <head>
      <title><?php print $head_title ?></title>
      <?php print $head ?>
      <?php print $styles ?>
      <?php print $scripts ?>
      <script type="text/javascript"><?php /* Needed to avoid Flash of Unstyle Content in IE */ ?> </script>
    </head>
    

    The following code from the Bluemarine page.tpl.php file use PHP if statements to print out optional information such as primary links, secondary links, and site slogan. You control whether those display in the Drupal control panel. The Bluemarine template uses tables, but you can easily remove the tables and make it a 100% CSS-based template.

    <table border="0" cellpadding="0" cellspacing="0" id="header">
      <tr>
        <td id="logo">
          <?php if ($logo) { ?><a href="<?php print $base_path ?>" title="<?php print t('Home') ?>">
    <img src="<?php print $logo ?>" alt="<?php print t('Home') ?>" /></a><?php } ?>
          <?php if ($site_name) { ?>
    <h1 class='site-name'><a href="<?php print $base_path ?>" 
    title="<?php print t('Home') ?>"><?php print $site_name ?></a></h1><?php } ?>
          <?php if ($site_slogan) { ?><div class='site-slogan'><?php print $site_slogan ?></div><?php } ?>
        </td>
        <td id="menu">
          <?php if (isset($secondary_links)) { ?>
    <div id="secondary"><?php print theme('links', $secondary_links) ?></div><?php } ?>
          <?php if (isset($primary_links)) { ?>
    <div id="primary"><?php print theme('links', $primary_links) ?></div><?php } ?>
          <?php print $search_box ?>
        </td>
      </tr>
      <tr>
        <td colspan="2"><div><?php print $header ?></div></td>
      </tr>
    </table>
    

    The Drupal styles.css File

    The style.css file is straightforward. I recommend the Firefox Web Developer Toolbar for creating the style.css file. Use the toolbars option Display ID & Class Details in the Information menu to view the CSS classes and ID's that Drupal is generating. Then add your own CSS rules to the style.css file.

    Other Drupal Theme Files

    Other files in the Drupal theme are block.tpl.php, box.tpl.php, comment.tpl.php, and node.tpl.php. Each one controls the layout of certain parts of the template. The comment.tpl.php defines the comment layout as shown below. It is fairly straightforward PHP: "If there is a user picture, print the user picture, etc.

      <div class="comment<?php if ($comment->status == COMMENT_NOT_PUBLISHED) print ' comment-unpublished'; ?>">
        <?php if ($picture) {
        print $picture;
      } ?>
    <h3 class="title"><?php print $title; ?></h3>
    <?php if ($new != '') { ?><span class="new"><?php print $new; ?></span><?php } ?>
        <div class="submitted"><?php print $submitted; ?></div>
        <div class="content"><?php print $content; ?></div>
        <div class="links">&raquo; <?php print $links; ?></div>
      </div>
    

    Your First Custom Drupal Theme

    Just make a copy of the default Bluemarine template and put it in your Drupal /sites/all/themes/ directory. That directory doesn't exist by default, so you should create it if you haven't already. See the README file in /sites/all/ for more information. Rename the copy of Bluemarine to the name of your new theme. Enable the new theme.

    NOTE: In Drupal 6 there are also theme info files. To change the name of the theme you'll also need to change the name in the bluemarine.info file:

    ; $Id: bluemarine.info,v 1.4 2007/06/08 05:50:57 dries Exp $
    name = Bluemarine
    description = Table-based multi-column theme with a marine and ash color scheme.
    version = VERSION
    core = 6.x
    engine = phptemplate

    Then strip most of the HTML out of the page.tpl.php file and replace it with the HTML that you would like for your theme. Leave the PHP, modifying it as desired. If you are using Linux for Web development, you can use Quanta Plus as an editor to edit your template files directly on the server. Each time you save the file in Quanta Plus, the remote copy of the file will be updated.

    Use the Firefox Web Developer Toolbar's Display ID & Class Details feature to view CSS information on your new template that you are viewing the the browser. Either start a new style.css file from scratch, or modify the existing one to get the template the way you would like. To edit the display of blocks, nodes, and comments, edit the block.tpl.php, node.tpl.php, and comment.tpl.php files respectively.

    When you are finished with your template, take a screenshot and resize it to about 150x90 pixels. Upload it to your theme directory as screenshot.png.

    Drupal Template Variables

    The PHP snippets in the examples above are just printing PHPtemplate variables. A complete list of available PHPtemplate variables that you can use in your template can be found on Drupal.org's PHPtemplate variables page. Below are the available variables from 24 July 2007:

    $breadcrumb
    HTML for displaying the breadcrumbs at the top of the page.
    $closure
    Needs to be displayed at the bottom of the page, for any dynamic javascript that needs to be called once the page has already been displayed.
    $content
    The HTML content generated by Drupal to be displayed.
    $directory
    The directory the theme is located in , e.g.
    themes/box_grey or themes/box_grey/box_cleanslate.
    $footer_message
    The footer message as defined in the admin settings.
    $head
    HTML as generated by drupal_get_html_head().
    $head_title
    The text to be displayed in the page title.
    $help
    Dynamic help text, mostly for admin pages.
    $is_front
    True if the front page is currently being displayed. Used to toggle the mission.
    $language
    The language the site is being displayed in.
    $layout
    This setting allows you to style different types of layout ('none', 'left', 'right' or 'both') differently, depending on how many sidebars are enabled.
    $logo
    The path to the logo image, as defined in theme configuration.
    $messages
    HTML for status and error messages, to be displayed at the top of the page.
    $mission
    The text of the site mission.
    $node
    (5.x and after only)If you are in page.tpl.php displaying a node in full page view then $node is available to your template.
    $onload_attribute
    (4.7 and older only) Onload tags to be added to the head tag, to allow for autoexecution of attached scripts.
    $primary_links (array)
    An array containing the links as they have been defined in the phptemplate specific configuration block.
    $scripts
    (5.x and after only) HTML to load the JavaScript files and make the JS settings available. Previously, javascript files are hardcoded into the page.tpl.php
    $search_box
    True(1) if the search box has been enabled.
    $search_button_text
    (4.7 and older only)Translated text on the search button.
    $search_description
    (4.7 and older only)Translated description for the search button.
    $search_url
    (4.7 and older only)URL the search form is submitted to.
    $secondary_links (array)
    An array containing the links as they have been defined in the phptemplate specific configuration block.
    $sidebar_left
    The HTML for the left sidebar.
    $sidebar_right
    The HTML for the right sidebar.
    $site
    The name of the site, always filled in.
    $site_name
    The site name of the site, to be used in the header, empty when display has been disabled.
    $site_slogan
    The slogan of the site, empty when display has been disabled.
    $styles
    Required for stylesheet switching to work. This prints out the style tags required.
    $tabs
    HTML for displaying tabs at the top of the page.
    $title
    Title, different from head_title, as this is just the node title most of the time.
  • DRUPAL SEO ↓

    We offer two types of SEO services:

    1. SEO Site Audits
    2. SEO Campaigns

    I've written some of the most comprehensive Drupal SEO tutorials on the Web, including the Drupalzilla robots.txt tutorial and the basic Drupal SEO tutorial that is at the top of Google for drupal seo right after Drupal.org.

    SEO Site Audits

    An SEO Site Audit is a detailed analysis of your site's configuration and structure, and it contains recommendations on optimizing your SEO with Drupal-specific tips.

    SEO site audits are delivered in PDF format, with 2 hour of consulting beyond the delivery of the site audit. A typical site audit is between 35 to 50 pages in length.

    SEO Campaigns

    An SEO Campaign is a longer consulting agreement of 6 or more months where I work with your Web developers to systematically increase traffic through comprehensive search engine and social media optimization techniques.

    SEO and SMO traffic

    Basic Drupal SEO: On-site Optimization

    Summary

    1. Enable Clean URLs
    2. Enable Path Module and install and enable Pathauto, Global Redirect and Token Modules.
    3. Configure the Pathauto Module
    4. Install and enable the Meta Tags Module.
    5. Install enable the Page Title Module
    6. Do NOT install the Drupal Sitemap Module.
    7. Fix .htaccess to redirect to "www" or remove the "www" subdomain.
    8. Fix your theme's HTML headers if they aren't right
    9. Recommended: create a custom front page
    10. Modify your robots.txt file.

    Enable clean URLs

    Search engines prefer clean URLs. In Drupal 6, clean URLs should be automatically enabled if your server allows it. In Drupal 5 you can enable clean URLs under administer —> settings —> Clean URLs. Clean URLs are necessary for the pathauto module, mentioned below.

    Install the pathauto module and enable it

    The pathauto module is highly recommended. Pathauto will automatically make nice customized URLs based on things like title, taxonomy, content type, and username. You also have to enable the path module for pathauto to work.

    Think carefully about how you want your URLs to look. It takes some experience with Drupal to get the exact URL paths that you might want. The URLs are controlled by a combination of taxonomy and pathauto, and I hope to cover that in another tutorial. You can also use the path module to write custom URLs for each page, but that might become tedious and inconsistent on a large site.

    At the very least, enable the path module and install the pathauto module. It will generate nice-looking URLs for you without much configuration.

    Caution: The above advice is directed towards new Drupal sites. If you have an existing Drupal site be very careful that you don't rename your previously existing URLs with the pathauto module. It is generally a very bad idea to change existing URLs because the search engines will no longer be able to find those pages.

    Here are some pathauto settings to watch out for:

    For update action choose "Do nothing. Leave the old alias intact." Otherwise the URLs of nodes will change every time you change the title of your post, causing problems with search engines:

    Drupal Pathauto update action settings

    There is also a more comprehensive Pathauto tutorial.

    Install the Global Redirect Module

    The Global Redirect Module will automatically do 301 redirects to your URL aliases. So if you have a node a example.com/node/5, the Global Redirect Module will redirect that URL to your alias at example.com/my-page.

    Read more about the Global Redirect Module.

    Install the Meta Tags (Nodewords) Module

    The Meta Tags Module (formerly called "Nodewords Module") can be highly beneficial to your site. There is a myth in some search engine optimization circles that says, "meta tags are not important". This is not true.

    Meta tags are not meant to be used for keyword stuffing. Don't use them for that purpose because it isn't going to help you. The really important meta tag is the meta description.

    The meta description should be different on every page for best results. The meta description should be one or two brief sentences to summarize the page. It should be written for your human visitors, but it is not a bad idea to tastefully and sparingly insert a couple of your keywords. Often when a search engine lists your site in the search engine results pages, it will use your page's HTML title for the title, and your meta description for the text snippet. That is why the meta description should be written with human visitors in mind. You want a text snippet that is going to make them want to click on the link.

    Here is one textbook example from this site in the Google SERPs with the meta description highlighted in red:

    Drupal meta description being used as a text snippet in Google

    I generally configure the Drupal Nodewords module to output the meta description and meta keywords on every page. I have a few default keywords set, and add a couple more on every post to make a unique combination of relevant keywords. I don't spend much time with it because I don't think the meta keywords are that important.

    On the nodewords module's administration page, be sure to check the box that says "Use the teaser of the page if the meta description is not set?". That way each page will get a unique meta description even if you have denied access to create custom meta tags for nodes to some users.

    Install the Page Title Module

    The Page Title Module allows you to set custom page titles on every page. Highly recommended.

    Google Sitemaps Module

    Google Sitemaps are not essential, but I've been adding them to my Drupal sites. I think that Google Sitemaps were created by Google primarily for debugging Googlebot and not for the benefit of search engine optimizers.

    There is a Drupal Sitemap Module, but the last time I checked it had serious bugs that made it unusable. In any case, I don't think that most Web sites need XML sitemaps. Other SEOs have similar opinions about sitemaps.

    I recommend not using the Drupal Sitemaps Module. [See the comments on this article for a longer discussion about XML sitemaps and Drupal.]

    Drupal Rewrite Rules

    Make sure that your site does a permanent (301) redirect in either of the following two ways:

    • http://example.com to http://www.example.com, or
    • http://www.example.com to http://example.com

    You can setup this redirect in your .htaccess file.

    To remove the www from your site, look for the following code in your .htaccess file and uncomment and adapt:

      # To redirect all users to access the site WITHOUT the 'www.' prefix,
      # (http://www.example.com/... will be redirected to http://example.com/...)
      # uncomment and adapt the following:
      # RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
      # RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]
    

    To redirect to the www version of the site, look for the following code and uncomment and adapt:

      # To redirect all users to access the site WITH the 'www.' prefix,
      # (http://example.com/... will be redirected to http://www.example.com/...)
      # adapt and uncomment the following:
      # RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
      # RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
      

    Be sure to replace example.com with your domain name, and then test the redirects in a browser.

    Fix Your HTML Headers

    There should be one <h1> header element on every page and it should have your keywords in it.

    1. Enclose your site name in DIV tags, not HTML header tags.
    2. I would add one H1 element to the home page.
    3. On teaser views, the node titles should be enclosed in H2 tags, while the main header of the page (e.g., taxonomy term name) should be enclosed in H1 tags.
    4. On node view pages, the node title should be enclosed in H1 tags.

    Duplicate Content from /node

    By default, the front page of a Drupal site has nearly identical content to the page at /node. Search engines are going to spider and index /node because on the paginated home page view, the link to the first page in the series points at /node.

    The fix for this is simple — always use a custom front page when building a Drupal site.

    Drupal PHP Session IDs

    I haven't seen this problem on Drupal sites in a long time, but if you see PHP session IDs in your URLs, it is very bad for search engines. They have to be removed if you want search engines to be able to spider your site well. A PHP session ID in your URL might look something like this: ?PHPSESSID=37765439acbd6c12345ee987776e65be.

    From what I understand, this is the fix if your server supports mod_php — it goes in your .htaccess file:

    # Fix PHP session ID problems in Drupal
    php_value session.use_trans_sid 0
    php_value session.use_only_cookies 1

    Otherwise you can probably fix it my modifying your php.ini file (or creating one). I don't know the exact procedure for every host, only that your web site must not have PHP session IDs in the URLs if you want good spidering by search engines. Search Drupal.org or Google for how to turn off PHP session IDs on your server.



    Drupal and Canonical URLs

    Google Engineer Matt Cutts talks about canonical home page URLs on his blog. The concept is basically this:

    For the most part, search engines view different URLs as being entirely different pages. So the following URLs all may show the same content, but search engines will often see them a different pages with duplicate content:

    1. http://example.com
    2. http://www.example.com/
    3. http://example.com/index.php
    4. and so on...

    Drupal does not link to its index.php file so the third URL example is generally not an issue with Drupal. However you should choose between using the www version of the domain name or the non-www version of the domain name. Drupal makes this easy by providing instructions in the default .htaccess file as shown below:

    # adapt and uncomment the following:
    # RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
    # RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
    #
    # To redirect all users to access the site WITHOUT the 'www.' prefix,
    # (http://www.example.com/... will be redirected to http://example.com/...)
    # adapt and uncomment the following:
    # RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
    # RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]

    When setting up your Drupal site you should decide whether you want your site to have the www subdomain or not and choose one of the two options in the .htaccess file.

    For SEO purposes it doesn't matter either way unless your site has already been live for a while. If Google has indexed your site and shows the PageRank value of the home page (as seen in the Google Toolbar or through a Firefox Extension like Search Status), then Google has already chosen one version or the other for your domain name. In that case I would redirect to the version of the domain that Google has already accepted. You can determine which version Google has chosen by typing your domain name into Google without the www like this: example.com

    Google should show your domain name at the top of the SERPs. If Google shows your home page with the www then you should redirect your site to the www-version. If they leave off the www then redirect to the version without the www.

    Some people would say that it doesn't matter which one you redirect to even if Google has already indexed the site. But sometimes when you 301 redirect pages or sites, Google drops the original URL and it takes a while to get it ranked again. That is why I recommend going with the choice that Google has already made for you.



    Top 21 Drupal SEO Modules To Optimize Your Website

    top 21 drupal seo modules to optimise your website

    Whether you’re a SEO practitioner, a webmaster, or a Drupal developer who works on a daily basis, having a web technology that enhances search engine optimization (SEO) is never underrated. In fact, choosing a CMS that assists to elevate your site to the top results of search engine results page (SERP) should be planned before setting your foot on building your websites.

    Why?

    Because once you get the whole website completed, and then realize that you need to replace the CMS, it would consume you tons of efforts and cost. That would be very painful.

    If you have just started with Drupal, and intend to learn website optimization, or even if you’re a loyal Drupal user but never taking any steps with SEO, we have a good news for you. Drupal is considered one of the top SEO friendly CMSes. Besides the advantage of Drupal core & architect, we attribute this to Drupal’s various choices of useful SEO modules. Keep these modules in mind when you need to boost your websites in search engines.

    • Pathauto - One of the most downloaded modules of Drupal. The Pathauto module saves your time from manually creating the path/URL aliases. It does this by automatically generating URL/path aliases for the contents (nodes, taxonomy, terms, users) based on configurable patterns.
      Let’s say we configure our blog entry as blog-entry/[node:title]. And we publish this blog post with the title “Top Drupal SEO Modules”, Pathauto will immediately manufacture a seo friendly URL as “blog/top-drupal-seo-modules” instead of “node/121”.
    • Page Title - Title is undeniably among the most important factor of your seo plan. The Drupal default title is rendered by the node. Page Title allows you to take control of the node, and creates whatever title name you want. By setting patterns for the title, you can create unique and relevant title for the content. You can also set different patterns if you choose page title as automatically being generated.
    • Metatag - Drupal doesn’t support editable meta tags fields. That’s when meta tags module comes in handy.
      This module enables your control over the meta tags, including page title, description, and keywords. You are are able to set meta tags for users, nodes, taxonomy terms, and views,…
      Meta tags also gives users options to set default meta tags for the entire site - whole or individual pages.
    • Search 404 - The search 404 module gives you a way to handle with 404 page errors on your website. Upon installing the modules, when a user enters a URL that renders a 404 page, the result be will automatically navigated to the internal site search with the related term in the URL. Why is this useful?
      404 page can be a negative sign to the visitors. When they see there are no results on the page, they can escape your site. This thereby increases the bounce rate, which is a criteria search engines uses to rate your website's quality. Search 404 module helps get over this issue.
    • Redirect - What if you want to redirect an existing URL to another one? Redirect helps you with the task. In addition, it keeps the two links on your website without rendering a 404 not found error. This is a great module if you want to deal with duplicate content.
    • Global Redirect - While the alias system in Drupal helps generate clean SEO-friendly URLs, there’s a problem rising. The default URL is still there, meaning there are 2 URLs with the same content on your site. The search engine bot can specify this duplicate content, and this may be a big issue. Global Redirect handles this problem by checking to see if there is an alias for the existing URL and redirect to the alias URL.
      The module also comes with other important features: removing the trailing slash in the URL; verifying that clean URLs are being implemented correctly; checking permission and access to nodes, URLs.
    • Content Optimizer - Content Optimizer brings a quick analysis and statistics of your website content and gives you a specific idea about how SEO friendly your site is. And it provides recommended actions to improve search engine rankings. The Content Analysis module is required for installation.
    • SEO Checklist - The SEO checklist modules lists the most important SEO tasks and the relevant modules needed installing to improve onsite SEO. The module doesn’t take any action with your site. It only informs a comprehensive SEO tasks you need to do. Once a task is completed, you’ll see a mark off. For someone who has known SEO basics, this is valuable because you don’t have to go through everything to check your on-site SEO issues.
    • Drupal SEO Tools - This is an “all in one” SEO suite. Drupal SEO Tools provides a dashboard which covers a number of SEO functions for the sites including: keywords, titles, tags, paths, redirects, sitemaps, Google analytics, webmaster tool, etc.
      It has some prerequisites that must be installed before use. It also gives a number of recommended modules to make full use of the suite. This module is hugely useful if you intend to work with multiple seo tools in one place.
    • Menu Attributes - The Menu attributes module allows the administrator to pinpoint specific attributes, consisting id, name, class, styles, and rel.
      In terms of SEO, menu attributes lets you apply custom attributes rel =”nofollow”. This should not be missed in your seo strategy because nofollow devalues unimportant internal and external links so that you can pass more link juices on links that matter.
    • Menu Breadcrumb - As the name has said, this module adds a breadcrumb menu line on the top of your website. Breadcrumb has two tangible benefit for both users and search engines. First, it lets the user know where he is in the navigation hierarchy. Finally, there’s an anchor text in the breadcrumb, which gives an internal link to the relevant URL.
    • Links Checker - Broken links are precisely a negative signal to search engines. You’ll need a module like Links Checker to occasionally specify failed results which you need to make a fix to.
    • SEO Compliance Checker - The SEO Compliance Checker executes a full check upon your creation and modification of a node. This module is immensely helpful for SEO beginners & webmasters as it visually display a result which lets them know what needs improving to bring in a strong well optimized content.
      This encompasses scanning if there are sufficient alt tags in the image, usage of keywords in the node titles, keyword density on the body,… You can make a preset of user-defined rule to base the module result of choices shown.
    • Xml sitemap - Your website definitely needs a Xml site map – a directory of your website. It makes it easy for Google’s search bot to crawl and index the website. Xml sitemap automatically generates an up to date sitemap that conforms to sitemaps.org specifications.
    • Site Verification - In order to make sure that search engines are properly crawling and indexing your site, you have to verify it. This module makes the verifying process easier and it supports a number of search engines – Google, Yahoo, Bing,… The module enables verifying by uploading a html file or adding meta tags.
      Use this with xml sitemap allows your website content to be appropriately indexed and up to date in the search engines’ eyes.
    • Html Purifier - Search engine reads your website content via raw html. So it’s always important to make sure have a clean easy-to-read code. Html filter will check your website code to conform to standard html rule. It also helps removes malicious code along the way.
    • Tag Clouds - As the name implies, this module creates tag clouds - lists of tags, based on the taxonomies of your site. There are other modules with the similar function, but we find this is the widely used, simple, and easy to work with.
    • Taxonomy Title - With Taxonomy Title, you can edit the heading tag (H1) of the taxonomy page. The importance of H1 tag should never be neglected for on page SEO. And we have a whole module dedicated to change the H1 tag of the taxonomy.
    • Google Analytics - This tool by Google is by far the best free analytic software you should integrate with your website. Although it is possible to manually insert the Google Analytics into your site, the module makes the task easier. Besides it offers a variety of features: track/exclude certain users, roles & pages; modify what kinds of links are tracked; Drupal message tracking,…
    • Mollom - Spam has always been an issue that we need to deal with when working with contents. It causes your website to look bad in the eyes of the visitors and the search engines. Sometimes spam with links extracts the page juice of your website. That’s why we need Mollom.
      The module using a free version of Mollon service helps us detect and prevent spam based on the posted content, the reputation and activity history of the users. It operates by blocking the poster immediately or forcing entering the Captcha to be accepted.
    • Schedule - What if you want set specific time for your node to be published? Since Drupal core doesn’t support the function, Schedule module can't be missed.
      Not only does It let posts be published on a given date, it also allows it to be unpublished later. It is extremely handy if you work with multiple contents. You can set time span for the blog posts, or choose the time that when there are the most visitors on your site for the content release. Definitely valuable for content marketing & SEO.