Search form

Drupal 7 Search Engine Optimization (SEO)

So I recently migrated my web site to Drupal after running it in WordPress for several years. Not surprisingly for a redesign where all the URLs changed and much content was added, my traffic numbers cratered, but after some tinkering they've gone back up again. After this little experiment with SEO, here are some things I'd recommend to draw traffic to your Drupal site.

Tips and Modules for Drupal SEO

  • If you do nothing else, enable Clean URLs (admin/config/search/clean-urls). This gives you URLs like http://www.mysite.com/mypage instead of http://www.mysite.com/?q=87. Not only is this more intuitive for visitors, it helps search engine rankings because your actual subject matter is reflected in your links.
  • Install and enable Pathauto, which allows you to set human-readable naming conventions for nodes. In addition to being more usable, this can help improve search engine rankings.
  • Use the XML Sitemap module to generate a sitemap of your content, then submit your sitemap to the Google Webmaster and Bing Webmaster tools. XML Sitemap can also regenerate and resubmit itself automatically when Drupal cron is run.
  • Add the Metatag module, which allows to you set meaningful descriptions and page titles to appear in search rankings. Metatag has other useful features, like providing multilingual titles and descriptions (with the i18n module), the ability to set per-page archiving rules, and the ability to override a node's default meta tags (like the home page description, for example). You can use an analyzer like the the Yoast module below to assess the effectiveness of your meta tags.
  • Use the Redirect module to point old URLs to the new ones, and ensure that each redirect is returning a 301 (permanently moved) HTTP code to point web crawlers and analyzers to the new URL. Redirect also provides a convenient list of your top 404 errors and allows you to create redirects for them with one click.
  • Try the Yoast SEO module. Yoast SEO is a popular plugin for WordPress that has now found its way to Drupal. Yoast SEO isn't perfect yet -- as of this writing it's in beta -- but it provides some tips for optimizing your content. Try to get at least an "OK" rating on all pages that you want to rank in the search engines.
  • Install Google Analytics: Google Analytics can provide detailed information about your content's popularity and the demographics of your visitors. Analytics can also be connected to any AdSense or AdWords campaigns you may be running to analyze the effectiveness of keywords or ad placement. Keep in mind that Analytics uses cookies and JavaScript, which can be blocked on the client side and might interfere with caching systems like Varnish. You might also want to exclude your own visits to avoid skewing your numbers.
  • Enable the Statistics module in core Drupal and allow it to track your 404 errors, referrers, and content pages. (Statistics does require some room in your database, so you probably want to clear your Drupal access log with a cron job periodically.) Since Statistics does its counting on the server side, it can provide some additional insights and its numbers will be somewhat different than client-side services like Analytics.
  • Make sure your site speed and download size are optimized by using a tool like Google PageSpeed. Install the Boost module, enable Drupal's blocks caching, and compress JS and CSS files for faster loading. If your host permits it, ensure your web server is performing adequate compression and cache control as well.
  • If you control your web server, deploy all your Drupal sites on a high-performance technology stack.
  • If you control your web server, ensure you're only running secure encryption protocols.
  • Ensure your robots.txt file permits thorough crawling and archiving of your site (the default included with Drupal is pretty solid). Webmaster suites like those of Bing and Google provide some tools for downloading and testing robots.txt.
  • Disable the /node default page if you aren't using it. Not only is /node a potential security hazard, it can hurt SEO by feeding the search engines garbage that you didn't intend them to see. This is easily done by installing the Node Page Disable module, or by using hook_menu_alter():
    function MYTHEME_menu_alter(&$items) {
        $items['node']['page callback'] = 'drupal_not_found';      
    }
    

Final Words

Don't kill yourself trying to rig search engine rankings, because you're not going to beat media companies that have eight-figure advertising and SEO budgets. Focus on updating regularly and providing some interesting content, and watch your access logs for a while to determine what's popular. There's no substitute for providing content that people want to see.

Categories: