Upgrade Your Drupal Skills

We trained 1,000+ Drupal Developers over the last decade.

See Advanced Courses NAH, I know Enough
Oct 31 2018
Oct 31

Leveraging Drupal's cache effectively can be challenging at first, but the benefits for your site's performance make it well worth the effort. It all starts with figuring out what sort of rules your site should use to cache its content. The improved page load times that come from properly handling caching rules can help improve SEO and are generally more appealing to those that visit the website. In the right hands, the techniques outlined in this article can get a website into a much more specialized caching system.

I previously covered the fundamentals of how caching works in Drupal 8, including what the two core caching modules do and what cache tags, contexts, and max-age are for. If you're familiar with those things, then this post is for you; otherwise, check out my previous article and get up to speed before we dive into a slightly more in-depth topic: Figuring out how you should set up caching on your site.

If you're using a simple Drupal installation with no custom code and with well-maintained contributed modules, Drupal's Internal Page Cache and Dynamic Internal Page Cache modules will likely cover your caching needs. This article focuses on some more complex and custom scenarios which, nonetheless, come up with some frequency. 

The Guiding Principle

Perhaps the most frequent issue custom code has when it comes to caching is that it doesn't account for caching at all. This isn't ideal if you want to take advantage of Drupal's caching system to optimize your site's speed, and it points to one principle which can be tricky to learn and is critical to master: If you write custom code, always think about its caching implications. Always. 

Often, the implications will be minimal, if there are any at all. It's important not to assume that every bit of custom code will cache perfectly on its own - that's a mistake that could lead to something being cached either for too long or not at all. 

When to Disable the Cache 

Most everything Drupal renders as output (to a web browser, to a RESTful web service, etc.) can be cached. However, sometimes the development time to ensure that your custom code handles caching precisely outweighs the performance benefits that caching might provide. So the first question when you're writing custom code is, should this be cached at all?

Ready to get the most out of Drupal?  Schedule a free consultation with an Ashday Drupal Expert. 

If you're building something like an administrative page that only a few users with special permissions will ever see, it may not be worth the time and effort to make sure it is cached perfectly, especially if the rules for doing so would be complicated. For these scenarios, Drupal has a "page cache kill switch" that can be triggered in code:


Calling the kill switch will stop both the page cache and the dynamic page cache from doing any caching on that page.

This should be used with caution though, and only as a last resort in situations where figuring out proper caching logic isn't worth the time. It should never be used on a page which is expected to be viewed by a large number of your website's visitors.

Rules for Cache Contexts

You should consider using a cache context if your content should look different when displayed in different situations. Let's look at a couple scenarios that benefit from using a cache context:

Say you have a site which can be accessed from two different domains and you want to display something a little different depending on which domain someone is looking at. Perhaps the site's logo and tagline change a little. In this case, the block containing the logo and tagline should be given the url.site context. With this context in place, Drupal will cache a separate version of the block for each domain and will show each domain's visitors the appropriate one.

Or, perhaps a block contains a bit of information about which content the currently logged-in user has permission to edit. This sounds like an excellent case for using the user.permissions context to indicate to Drupal that the block is different for each possible combination of permissions that a user might have. If two users have the same permission, the same cached version can be used for both of them.

There are many other contexts are available as well; take a look at the full list to see if one or more of them is applicable to your code.

Rules for Cache Tags 

Cache tags are probably the most important caching mechanism available to custom code. Drupal includes countless cache tags which can be used to invalidate a cache entry when something about your site changes, and it is also very easy to create your own cache tags (which we'll get to in a minute). For now, I'm going to focus on some of the cache tags Drupal has by default.

Say you're creating a page which shows the top five most recently published articles on your site. Now, Drupal sites can often make use of the Views module for this sort of thing, but depending on your exact requirements Views may not be the best approach – for instance, maybe part of the content has to come from a remote service that Views can't readily integrate with. The most obvious tags needed for this page are the tags for the specific pieces of content that are being shown, which are tags in the format of node:<nid>, for instance, node:5 and node:38. With these tags in place, whenever the content gets updated, the cache entry for your page gets invalidated, and the page will be built from scratch with the update information the next time somebody views it.

But that's not all there is to think about. Perhaps this page also shows what categories (using a taxonomy structure) each article is in. Now, the articles each have an entity reference field to their categories, so if a user changes what categories the article is in, the relevant node:<nid> tags already added to your page will get cleared. Easy enough. But what if somebody changes the name of the category? That involves editing a taxonomy term, not the article node, so it won't clear any node:<nid> tags. To handle this situation, you'd want to have appropriate taxonomy_term:<id> tags. If an article with ID 6 has terms with IDs 14 and 17, the tags you'd want are node:6, taxonomy_term:14, and taxonomy_term:17, and you'll want to do this for every article shown on your page.

Fortunately, most of the time, you don't need to worry about the specific tag names. Nodes, terms, and other cacheable objects have a getCacheTags() method that gets exactly whatever tags you should use for that object.

These are all simple entity-based tags, but there are many more available as well. There are tags for when various aspects of Drupal configuration changes as well as for things such as when certain theme settings get changed. Unfortunately, since the available cache tags vary from site to site, there isn't a ready-made list of them available for you to use as a reference. You can, however, look at the "cachetags" table in your Drupal database to see a list of all the tags that have been invalidated at least once on the site. This will be pretty minimal if your site is brand-new, but as people use the site it will start filling up.

The basic idea of tags is this: If you render something on a page, and there's a chance that something displayed on it might change in the future, there should be an appropriate tag in place to watch for that change.

Up Next

This is a big topic, but it looks like we're out of time for today. Next time, we'll delve a bit deeper into cache tags by seeing how to create custom ones that perfectly fit your site's needs and will also cover how to use max-age, including one important gotcha that makes them more complicated than they look. You can check that one out here.

Offer for a free consultation with an Ashday expert

Sep 13 2018
Sep 13

The marketing landscape is vastly different than it was when Drupal 7 was released in 2011. Since then, there has been a shift, placing the marketing team in the driver’s seat more often and almost always involved in the CMS decision. In this post, we’ll outline some of the ways you can up your SEO game with Drupal 8.

Traditional SEO is dead.

No longer will well-placed keywords alone get you to the top of the SERP ranks. Content is still King in the world of marketing and it’s what helps you improve your SEO.

Every algorithm change Google has made has one thing in common: it aims to provide the best content based on what it "thinks" the user is trying to find. In other words, - what is the users intent. If you want your rankings to stick past the next update, don't try to cheat the system. Attract your prospects with informative, entertaining pieces that they can use to take action. And avoid no value posts that are keyword stuffed with your industry and the word "best" 100 times. Google can see through it and so can all of your users.

That said, there are a few other factors that are critical to keeping your rankings high that can’t be ignored including quick load times and mobile-friendliness. Drupal 8 is built with several of these factors in mind to help us make needed improvements quickly and effectively.

Mobile First Mentality

Drupal 8 is created with responsive design capabilities built in, so you can begin to address any problems immediately. That’s not to say all of your responsive problems will be solved. Content editors will still need to think through their content and imagery, themers will still need to do configuration to establish things like breakpoints, etc. but Drupal 8 will set you on the right path, giving you and your team many of the tools you need.

You’ll also have the option to choose different images and content for desktop and mobile versions right from the WYSIWYG editor, making it easier to see the differences for every piece of content when you add it and before you publish. This means a solid visual of both versions in real-time for faster publishing and peace of mind knowing exactly what your users experience on any device. 

The Need for Speed

Another big factor that could affect your rankings is speed on both desktop and mobile. Google places such high importance that they’ve given you a PageSpeed Insights test to show where and how your website is slowing visitors down. Drupal 8 is “smart” in that it caches all entities and doesn’t load JavaScript unless it has to. This means the same content won’t be reloaded over and over and instead can be loaded quickly from the cache.

Drupal 8 also uses industry-leading caching technology to allow updated content to be served fresh to a client, while preserving the cache on content that hasn’t changed. So, after your visitors come to your website once, they won’t have to wait for all content to load each time, making load times much faster.
Another way Drupal 8 improves speed is through feature velocity. Because so much new functionality is built into Drupal 8 core, creating and publishing new dynamic content experiences is significantly faster than in Drupal 7. A blog post that features dynamically updated data, relevant to and powered by your content can be built in the UI in Drupal 8, something that in Drupal 7 would have taken custom development and several modules.

Responsive design is a must-have in today’s digital landscape and speeding up your website on both desktop and mobile is a surprisingly effective way to contribute to your SEO efforts. In short, if you’re marketing team is focused (as you should be) on top rankings, Drupal 8 provides many of the tools to make that happen. 

Accessibility = Key for Search

The release of D8 marked a big push toward improving web accessibility, including: 

  • Overall community commitment to accessibility 
  • Technical features for improved accessibility like controlled tab order and aural alerts 
  • All features conform with the World Wide Web Consortium (W3C) guidelines

This is important because, as we know, the relationship between web accessibility and SEO is closely intertwined.

Drupal 8 SEO Modules

Here are some top Drupal 8 SEO Modules to use when optimizing your site. 

  1. Pathauto - helps save you time from manually having to create URL path/aliases.
  2. Metatag - allows you to automatically provide structured metadata, aka "meta tags", about a website.
  3. Sitemap - provides a site map that gives visitors an overview of your site. It can also display the RSS feeds for all blogs and categories.
  4. Redirect - Almost every new site needs to incorporate 301 redirects for old page URLs. This gives site admins an easy interface for creating those redirects in Drupal.
  5. Google Analytics - This simple module allows site admins the ability to easily configure Google Analytics in Drupal.
  6. Easy Breadcrumbs - uses the current URL (path alias) and the current page's title to automatically extract the breadcrumb's segments and its respective links. 
  7. SEO Checklist - uses best practices to check your website for proper search engine optimization. It eliminates guesswork by creating a functional to-do list of modules and tasks that remain. 


Drupal’s content management system is perfectly structured for search optimization and its core features support many of the critical SEO elements. But, SEO is only part of the story. In the next post, we’ll explore some of the do’s and don’ts and things to keep in mind once you’re on Drupal 8. 

Feb 27 2018
Feb 27

The ability to create and maintain redirects on a website is vital for long-term success.

Once your site has a lot of content, you may need to do a content audit. This will require merging or deleting pages which are no longer important. To maintain the traffic from these deleted or merged pages, you’ll need to create URL redirects. Now I understand this isn’t the most exciting part of site building but it’s important to get it right.

The module which will handle all of this is perfectly named; Redirect.

The Redirect module lets you create and manage redirects using a simple user interface. Just define a source and destination and you’re good to go. You can also track 404 errors, using a sub-module, so if you have a page indexed in Google with a broken path then it’ll be logged and a redirect can be easily created.

In this tutorial, you’ll learn how to:

  1. Create a redirect
  2. Track broken paths
  3. Add domain level redirections
  4. Import redirects via a CSV

Learn how to automate the generation of URL aliases using Pathauto in Drupal 8.

Getting Started

Before we begin, make sure you download and install the Redirect module.

If you use Composer, run the following:

$ composer require drupal/redirect

Or Drush,

$ drush dl redirect

Create a Redirect

Once you have installed the module creating a redirect is very easy.

1. Go to Configuration and click on “URL redirects”.

2. Click on “Add redirect”, enter in a Path (old path) and then select a To (new path).

The To field is an autocomplete field which you can use to lookup content on the site. But you can also add an external URL into the field.

3. From the “Redirect status” drop-down box, you can select which status will be used. Most of the time it’ll be a 301 or 302. Once you’re finished click on Save.

4. You’ll be redirected back to the Redirect page where you can manage existing redirects and create new ones.

Track Broken Paths

The Redirect module ships with a handy sub-module called Redirect 404.

The sub-module logs all the 404s and displays them all with a count in the “Fix 404 pages” page in “URL redirects”. When dealing with redirects, half the battle is figuring out which paths need to be redirected. This sub-module will log all 404s and add a button called “Add redirect” which you can use to create the redirect.

This sub-module could cause performance issues if your site gets a lot of traffic so test accordingly.

Domain Level Redirects

Another sub-module, which Redirect comes with is called “Redirect Domain”, it allows you to create domain level redirects.

A good use of this is when you want to redirect a whole domain, i.e., old-domain.com to new-domain.com. You can create a rule which will redirect anything from old-domain.com/* to new-domain.com, without manually creating redirects.

Import Redirects

Creating redirects manually won’t cut it if you need to add more than 20. If you have a spreadsheet full of redirects then it’s best to look at using Path redirect import.

The module lets you import redirects using a CSV file. All you need to do is prepare everything in a spreadsheet then once you’re ready, export the sheet as a CSV and import it into Drupal using the module.

The format of the CSV is pretty simple:


From and To are the only required columns. Redirect and Language are optional.

Run CSV Import

Once you’ve installed Path redirect import, go to Configuration, “URL Redirects” and click on the Import tab.

Select a file using the CSV File upload field and click on Import. Once the import is complete you’ll see a message telling you which redirects imported and which didn’t.

The reason the redirects in the above image were bypassed (not imported) is because the page did not exist. When preparing your CSV file make sure the paths and nodes actually exist. For example, if you’re creating a redirect to node/123 and that page doesn’t exist then the module won’t import it in.

Update Existing Redirects

When importing, if you want to update existing redirects then all you need to do is check the “Override existing sources” checkbox when importing.

Global Redirect merged into Redirect Module

The functionality of the Global Redirect module has been merged into Redirect for Drupal 8.  This is great because it means there’s one less module to install.

The Global Redirect settings can be configured by going to the Settings page with “URL redirects”.


Redirect is one of the must-have modules which is installed on most Drupal sites. But you can use it for more than just managing historical links. Another good use-case is to create vanity URLs. For example, you could create a redirect path domain.com/d8, that’ll redirect to another page within your site. This is especially useful when adding URLs into a presentation, the shorter the URL the more memorable it is.

Ivan Zugec

About Ivan Zugec

Ivan is the founder of Web Wash and spends most of his time consulting and writing about Drupal. He's been working with Drupal for 10 years and has successfully completed several large Drupal projects in Australia.

Jan 18 2018
Jan 18

During the redesign process of a website, there are many small changes that can ultimately affect the traffic of the new site. The key is to identify any changes that might break SEO, or changes that might affect the way the site looks to search engine spiders ahead of time to avoid traffic drops. In the end, we want the site to look fresh and new while still getting the same traffic, or more, as the old design. 

At Zivtech, we look at many factors in the planning phase of a website redesign project and try to identify those that could cause drops in traffic after the new design is launched. Once these have been identified, we ensure all of these tasks have been completed before launch. Let’s take a look at some of these factors and how to avoid traffic drops on your next website redesign project.

Meta Tags

We typically build sites with Drupal, so the Metatag module handles much of the meta tag configuration and display on the site. If you aren’t using Drupal though, there could be some changes to your front-end design that could affect your meta tags and confuse search engine spiders. You’ll need to make sure that all of your pages have meta tags and that there aren’t any duplicates. 

Broken Links

Broken links are a huge problem during website redesigns. This could be a result of changes in the menu structure or in path structures for content types. Broken links mean that users and search engines can’t find the pages they’re looking for, which can really wreak havoc on your site traffic statistics. 

To avoid broken links in Drupal, we can use the Link checker module, but there are also third party tools that can be used for non-Drupal sites. Google Search Console provides some additional tools to identify broken links and 404 pages too.

404 page

URL Redirects

Broken redirects or missing redirects to new URLs are also a big problem on site redesigns. These typically happen due to changes in URL patterns or menu structures. The Redirect module in Drupal provides an interface to add redirects for your pages without any coding experience. Non-Drupal sites can use .htaccess files or redirect statements in their web server configuration to ensure that all URLs that are changing have proper 301 redirects.

XML Sitemap

As URLs are changed on your site during a redesign, you’ll want to ensure that the XML sitemap has updated URLs that match the new ones. The XML sitemap module handles this for us on a Drupal site. 

If you aren’t running Drupal, a plugin for your CMS may handle this, or you’ll need to generate a new sitemap using third party tools. Once this has been completed, you can log in to Google Search Console and resubmit your sitemap for indexing.

Google Analytics

If you forget to place your Google Analytics tracking code in your new site’s markup before launch, you can end up in the dark when it comes to traffic fluctuations. The Google Analytics module handles the placement of this tracking code on a Drupal website, and even provides a status warning on the Drupal status page if the tracking ID has not been configured yet. 

Those who aren’t using Drupal should follow the instructions provided by Google Analytics to place the code snippet in their site’s markup, or use a plugin provided by their CMS of choice. With the Google Analytics tracking code in place, your organization can get a much better overview of how your site performs after the redesign launches. It’s much easier to track your successes or failures in your redesign if you were already running Google Analytics, but a relaunch is a great time to start using it too. 

While the factors in this post are some of the most important that we look at during a site redesign project at Zivtech, each project is unique and could require additional changes to your site to ensure you avoid traffic drops after launching your new design. 

Overall, you want to identify any changes that could affect URLs, meta data, and even content structure that search engine spiders or your visitors might be confused about. Even small changes or a missing meta tag can affect your search engine rankings, which can lead to traffic drops. Do your future self a favor and make a list of the individual factors that could affect your site. Then ensure that list is completed before calling your next website redesign a success.

Sep 18 2017
Sep 18

So…. Drupal 8 got released! Congrats everybody! The end of life of Drupal 6 is then final. In addition, the 16th of november it was announced that Drupal.org is now serving its content and files via Fastly; which is giving a significant performance boost, well done!

Furthermore, what I noticed last month on module updates:

1) Scroll to destination anchors

This module modifies the behaviour of an ‘anchor’ within a page. So the page will not jump down but fluently scroll down. We have installed this module here.


2) Spider Slap

There are a lot of ‘evil spiders’ active on the internet. These are web crawlers that don’t respect what is written in your robots.txt. This can cause unnecessary load on your server and uncover information that you don’t want to see in a search engine.
 This module is solving this problem. It will block the IP when a spider does not behave, with as a result that it will no longer have access.


3) Bounce Convert

Do you want to make an announcement in the last moment before a visitor is closing your Drupal website? Then this module can be useful. It functions like Exit monitor or Bounce Exchange.

Introduction video.

!) Note that it is currently an alpha module, so not yet suitable for live Drupal sites.


4) Database Email Encryption

Do you want to maximise the security of the email addresses of your registered users? This is possible with this module. It encrypts the addresses in the database. Should the database end up in the wrong hands, then the email addresses cannot be read. Encryption is done using AES.


5) Unique field

A popular module existing since Drupal 5, but I never noticed it before. It is performing a check on entered fields (e.g. title field) and checks whether the entered title is unique. This will prevent the use of double titles which is good for, among others, SEO.

6) Login History

By default Drupal is not creating a login archive. This module will do this for you: it creates an archive in which the history of logins will be stored.

https://www.drupal.org/project/login_history Similar:



7) Sitemap

Generates a sitemap for your Drupal 8 website and can also create RSS feeds for example for your blog. This is the Drupal 8 version for the popular Drupal 7 module Sitemap.


8) D8 Editor File Upload

Easily place files in content. This Drupal 8 module adds a new button to the editor, which will make it easy to upload and place files.


9) Client side Validation

Validating a form in your Drupal website without refreshing the page. This widely used module now offers a Release Candidate for Drupal 8.


10) App Link

Probably you recognize this one: the message above a website on your Smartphone that you can view the page in a native app. If you built and linked an app (e.g. via DrupalGap) then you can generate this ‘app message’ on your Drupal website using this module.


11) OpenLucius News

An own module that has to be mentioned;). This module extends Drupal social intranet OpenLucius with a ‘news tab’ on the homepage. News about the organization can be placed here.


12) Simple XML sitemap

The title of this Drupal 8 module says it all: it provides an XML sitemap that you can upload to search engines, so you can see the indexation of all your site links in the relevant search engine.
 The module also has a few configuration options like setting ‘priority’.


13) Session Limit

Tighten the security of your Drupal system by limiting the number of sessions with which a user is logged in. You can for example set that somebody can be logged in once; if somebody is logging in on his/her Smartphone then he/she will be automatically logged out on the work computer.


14) Login Security

Provide additional security when logging in, it is for example possible to:

  • Set how many times a user can attempt to log in before the account is blocked.
  • Deny access based on IP, temporarily or permanently.

The module can also send emails (or a log to Nagios) to alert the Drupal administrator that something is going on:

  • It seems that passwords and accounts are guessed.
  • bruteforce attacks or other inappropriate behaviour when logging in.


15) OpenLucius LDAP

Another own module, that should be mentioned as well ;-). This module extends Drupal social intranet OpenLucius with a LDAP connection, so that users can login to OpenLucius with their existing LDAP account.


16) Protected node

Gives additional protection to a certain page (node). A password can be set when creating the node. If somebody then wants to look at the node, the password must be entered to get access.


17) Code per Node

It is common to ‘deploy’ Drupal code (PHP, JS, CSS) via GIT within an OTAP street to a live Drupal server. Usually with the use of a Continuous Integration tool.

[edit] As Eelke mentioned in the comments below: OTAP has to be DTAP for English audience. [/edit]

But with this module you can perform quick fixes per page without the whole operation. It offers the opportunity to add additional CSS; per node, content type, block or global.

Not how we would do it, but I can imagine that this could be a handy tool for Drupal site builders. This is probably also the reason why it is so popular.


18) Admin Toolbar

A handy toolbar for Drupal 8


Wrap up

Alright, these are the modules for this month. In December we will introduce again new ‘cool Drupal modules’, so stay tuned!

Sep 18 2017
Sep 18

Search engine optimisation (SEO) has always been important, but in recent years its importance seems to have increased significantly. We were more often dealing with Drupal SEO implementations than in previous years. Many of the implementations contained overlapping components. Below we will discuss the most important ones:

1. Speed

Google Page Speed is a good indicator of how speed is experienced by end users and therefore by Google. Google attaches great importance to speed because end users are simply doing the same.

An example of a test of the front page of this site:

As you can see we can further optimize mobile and desktop by following the instructions provided. Although on our Dutch blog we have a Node.js frontend (and a headless Drupal 8 backend) a Drupal frontend can be tested as well with the Google Page Speed tool. The tool is testing, among others, the following:

  • JS and CSS aggregation and minimize (minify)
  • GZIP / browser caching
  • Optimized images
  • Landing page redirects
  • Prioritize visible content
  • User experience issues, for example the use of non generic plug-ins.

2. Schema.org

Schema.org is a collaboration between Google, Yahoo! and Bing to standardize the way data is structured in web pages. By using these standards these search engines are ‘snapping’ the content of your web page better, resulting in a significant SEO boost.

The schema.org library contains descriptive tags for content like films, persons, organizations, events, locations, etc. The purpose of the search engine is to make search results more clear, allowing people to easily find the right web pages.

3. Mobile compatible / responsiveness

2015 brought us mobilegeddon: if your website is not mobile ready then Google will appoint you penalties resulting in a lower ranking. And rightly so, a large part of the website visitors are using internet on their mobiles; and you would like to give them a good experience. You can test here if your website is mobile compatible.

4. Google Webmaster Tools / Search console

Essential SEO tool, sign in here and register your website. Then it is important to upload a XML sitemap. The Drupal module XML sitemap will help you with this. Once you have done that, you will be able to see how your website is ranking in the organic results of Google:

  • Which keywords enable your pages to be found in the search results.
  • What are people really clicking so that they land on your website.
  • Errors on your website.
  • Links that are not correct.
  • Links that are not accessible.
  • Schema.org implementation: how is Google treating the enriched html pages.

See below for example the dashboard of this website, with links unfolded and all the insights you can find here:

5. Write good, long content

Apparently Google is rating your Drupal website higher when you are publishing long and good quality content. Long and good pieces of content are also adding to the acquisition of new clients:

  • You have something valuable to promote on social media.
  • You have an excuse to reach out to your potential customers.
  • Visitors are staying longer on your website.
  • You are creating authority.

Read here more details about the how and why.

Areas of importance when writing content

  • Backlinks, make sure you get links on other websites that are highly rated.
  • Limit the number of relevant internal and external links, so that Google (and the — visitor) can better understand the context of your article.
  • Analyze the (successful) competitors: discover where they are, what they link and how they dominate social media.
  • Make sure your blog website is coherent, not a website with islands where non-cohesive content is separated from one another.
  • Update regularly: check for example once every month your articles and improve where appropriate: cohesiveness, spelling mistakes, new insights, etc.
  • Allow visitors to place comments using Disquss that has become a social media platform where you can attract inbound links.

Useful Drupal SEO modules

6. Page title

By default Drupal has one field to enter the title of an article. This title is used for both the page title as the ‘html title’:

The html title is important for SEO; usually you would like to define it differently than the readable title of the article (as the visitor is viewing it). This module is solving this problem and allows you to manage two titles individually.

You can also give the HTML title a particular predefined format so that it is created depending on the content type. For example “Blog Lucius | 18 Drupal SEO modules and tools for better findability in Google”. Where ‘Blog Lucius’ is always automatically stated in the beginning of the title with a pipe (‘|’) in between.

Download and more info on Page Title — (Drupal 7 — Drupal 8 info)

7. Metatags

Years ago meta keywords were one of the most important elements used to be found. But not anymore, Google is finding your Drupal site mainly with content and links to your pages. The meta keywords are still important but mainly for:

Indicating snippets
 The (summary) text about your page that will appear in the search engine:

Open Graph implementation
 Rapidly emerging technology, important for previewing your page on social media and now also in for example Gmail:

Download and more info on Metatag — (Drupal 7 & Drupal 8)

8. Pathauto & Subpathauto

Pathauto is a widely used Drupal module: it converts standard Drupal (/node/123) links to readable links (/news/this-is-a-news-item). Useful for your visitors and thus for Google.

Download and more info on Pathauto — (Drupal 7 & Drupal 8 dev)

Subpathauto is an extension of Pathauto: it recognizes sub-paths and automatically generates associated paths.

Download and more info on Sub-Pathauto — (Drupal 7)

9. Pathauto persistent state

The popular Drupal module Pathauto is useful for automatically creating nice URL’s. It is also possible to exclude particular content from an ‘automatic alias’ and then manually enter the URL.

Pathauto sometimes ‘forgets’ that the URL of certain articles was manually set, and creates them again automatically. As a result the URL of your page could change without you realizing it, not handy..

This Drupal module is solving this problem: it makes sure that Pathauto remembers for which articles you have turned off ‘automatic alias’.

Download and more info on Pathauto persistent state

10. Global redirect

Avoid duplicate content. Ensures for example that ‘node/123’ is no longer available, but only the search engine friendly URL. It also checks if clean URL’s are enabled and checks whether visitors have access before performing a redirect.

Download and more info on Global Redirect — (Drupal 7 — Drupal 8)

11. Redirect

It can happen that the title of an article needs to be changed, usually the URL is changing then as well. This module creates a 301 — Permanent redirect so that the users from an old URL are automatically redirected to the new path. This way Google also knows that the new URL needs to be indexed and that the old one can be removed.

Download and more info on Redirect — (Drupal 7 — Drupal 8 info)

12. XML sitemap

Necessary for an insight into your Drupal pages in Google’s Search console, see ‘Google Webmaster Tools / Search console’ above for more information.

Download and more info on XML sitemap (Drupal 7, Drupal 8 info).

13. HTML Purifier

Can clean the HTML of content so that it continues to comply with the W3C standards.

Download and more info on HTML Purifier — (Drupal 7, Drupal 8 info ).

14. Search 404

A standard 404 page (‘page not found’) is providing rather brief information for your visitor. This popular module is changing this: it does not show a static page, but will search in your Drupal system and will show visitors results of pages they might have been searching for.
 This feature will also have a positive influence on the SEO of your Drupal system.

Download and more info on Search 404 (Drupal 7 & Drupal 8)

15. Site verify

Useful mini module to verify your site in Google’s webmaster tools.

Download and more info on Site verify — (Drupal 7, Drupal 8 info).

16. Link checker

Analyse your content and detect dead links, important to fix them for your visitors and thus for Google.

Download and more info on Link checker — (Drupal 7, Drupal 8 info).

17. Taxonomy Title

Similar to the previously mentioned ‘Page title’, using this module you can among others change the (html) page title per term / tag.

Download and more info on Taxonomy Title — (Drupal 7)

18. Menu attributes

Add html elements to menu links: id, name, class, style and rel. This allows you to add among others ‘rel=nofollow’ to design the flow of links in your website better.

Download and more info on Menu attributes — (Drupal 7, Drupal 8 info).

Wrap up

Ok, enough SEO for now, hopefully you are not immediately conquering our ranking in Google ;-) Questions or feedback? Let me know in the comments.

Jan 18 2017
Jan 18

Magnifying glass over Google search bar

A few tweaks and modules later, Drupal has easy to build SEO friendly websites. To achieve it, there are two sides involved:

  • Developers and designers will apply technical enhancements (making a good use of the core and contributing modules, write semantic and valid HTML prototypes).
  • Clients create good content.

Below are a few things you can do to improve SEO on your website just by working with content (texts, images, files).

Text content


When you create a page on a website, the page title you decide on is used in several different places so it’s important to get it right and make sure it’s clear and useful.

Page title will appear:

  • On the page (usually as h1 heading)
  • In the main menu
  • In the url page
  • On listings linking to the page (from your site and also from social media sources)

All of above are picked up by search engines, so it’s important to include relevant keywords in your titles.

Page titles should be clear and descriptive. If titles are too long to fit into a menu, or if you want to have a different menu link then the page title you could use the ‘menu link title’ field to display.

Drupal has a feature that allows you to specify a ‘menu link title’, you can find this at the bottom of the edit page form in the “menu settings” tab > “Menu link title”.

Please note, spaces in titles will be converted into dashes in the url, so do not use  dashes in titles. Maybe you could replace dashes with a colon to avoid “double dashed” urls.

Meta description tag

The meta description is the excerpt that displays under the page title and site name on the search engine’s results page. If it’s not filled in, the body copy will be used instead. This may lead to a cut off excerpt, but you could manually fill the ‘meta description’, or use the ‘summary’ field to avoid it.

In Drupal, the body text field on a page is accompanied by a summary field. It is important to fill this in. Sometimes, it’s used on the site as a teaser to promote users to click the page and read the full copy.  Remember, it will be picked up as the meta description for the page if no meta description was manually added.


When adding or editing content to the Body, in the WYSIWYG toolbar at the top of the text field, you’ll see a dropdown with a few headings options. Commonly, you will have a choice of heading 2, heading 3, heading 4, and normal/paragraph.

When starting a new section on a page, use one of the headings defined in the dropdown. Headings are picked up by search engines and will contribute to your search rank.

Besides helping out with SEO, headings are designed to draw the reader’s eye so that they are able to find what they were looking for much easier. They are also useful for good content structure if the copy is long.

For SEO purposes you should only have the h1 tag used once on a page. H1 is commonly the page title.

Anchor Texts

This is the text that links to something else. For example, if I would like to point you to the about us page, then the anchor text is the (commonly) blue text you see.

Search engines compare the text written in the anchor to the link “behind” it. So if they anchor text includes keywords or phrases that will add value over time.

Anchor text is read by screen readers so it plays an important role in complain with accessibility requirements.

Please make sure that your anchor text is also descriptive.


As a general rule the copy should be as long as it needs to be. Online content is not read in the same way as printed content, so keep things concise, clear and straightforward bearing in mind the user experience, not only the SEO.

As a reference, some SEO advisers recommend around 200 words as a minimum for page copy.

Files (Images, documents)


Filenames should follow the following convention to eliminate technical problems and to improve SEO.

  • Use full words
  • Replace spaces with dashes
  • Do not use special characters, just letters, numbers and dashes.

Filenames should be also descriptive.

Some good examples are: mobomo-logo-red.jpg, partnership-agreement-2017.pdf

Reference: https://support.google.com/webmasters/answer/114016?hl=en

Alt Text

This is a descriptive text that appears if an image cannot be loaded and is also used by screen readers. So here SEO is directly implicated with Accessibility. It’s especially important if the image also acts as a link.

This text should clearly describe the image.


Main thing you should know about files in web: Large file sizes slow down page load.

Users tends to abandon pages if the load time is greater than 3 seconds. So search engines “don’t like” to direct users to slow sites.

So, you can help to keep the page speed to a minimum by making sure the files you add are light.

A general rule is to try to keep images filesize below 70k, this sometimes is hard especially with large images (banners for example), so let’s say images should not ever be larger than 600k.  


All images should be saved in jpeg format.

Documents should be saved as pdf or doc (for editable documents).


404 and 403 pages

We are going to set up these pages for you, but it’s important that you fill them with accurate content given your audience. For example, you could add a link to your Homepage here or to an Archive / Search page to help your audience finding what they were looking for.

Please note these points listed above are changes you can apply without any tech support, they are just Content edits you can apply by yourself when adding / updating content for your website.

Here’s a few SEO related Drupal modules that makes developers lives easier.

Jul 15 2015
Jul 15

Regardless of industry, staff size, and budget, many of today’s organizations have one thing in common: they’re demanding the best content management systems (CMS) to build their websites on. With requirement lists that can range from 10 to 100 features, an already short list of “best CMS options” shrinks even further once “user-friendly”, “rapidly-deployable”, and “cost-effective” are added to the list.

There is one CMS, though, that not only meets the core criteria of ease-of-use, reasonable pricing, and flexibility, but a long list of other valuable features, too: Drupal.

With Drupal, both developers and non-developer admins can deploy a long list of robust functionalities right out-of-the-box. This powerful, open source CMS allows for easy content creation and editing, as well as seamless integration with numerous 3rd party platforms (including social media and e-commerce). Drupal is highly scalable, cloud-friendly, and highly intuitive. Did we mention it’s effectively-priced, too?

In our “Why Drupal?” 3-part series, we’ll highlight some features (many which you know you need, and others which you may not have even considered) that make Drupal a clear front-runner in the CMS market.

For a personalized synopsis of how your organization’s site can be built on or migrated to Drupal with amazing results, grab a free ticket to Drupal GovCon 2015 where you can speak with one of our site migration experts for free, or contact us through our website.


SEO + Social Networking:

Unlike other content software, Drupal does not get in the way of SEO or social networking. By using a properly built theme–as well as add-on modules–a highly optimized site can be created. There are even modules that will provide an SEO checklist and monitor the site’s SEO performance. The Metatags module ensures continued support for the latest metatags used by various social networking sites when content is shared from Drupal.

SEO Search Engine Optimization, Ranking algorithm


Drupal Commerce is an excellent e-commerce platform that uses Drupal’s native information architecture features. One can easily add desired fields to products and orders without having to write any code. There are numerous add-on modules for reports, order workflows, shipping calculators, payment processors, and other commerce-based tools.



Drupal’s native search functionality is strong. There is also a Search API module that allows site managers to build custom search widgets with layered search capabilities. Additionally, there are modules that enable integration of third-party search engines, such as Google Search Appliance and Apache Solr.

Third-Party Integration:

Drupal not only allows for the integration of search engines, but a long list of other tools, too. The Feeds module allows Drupal to consume structured data (for example, .xml and .json) from various sources. The consumed content can be manipulated and presented just like content that is created natively in Drupal. Content can also be exposed through a RESTful API using the Services module. The format and structure of the exposed content is also highly configurable, and requires no programming.

Taxonomy + Tagging:

Taxonomy and tagging are core Drupal features. The ability to create categories (dubbed “vocabularies” by Drupal) and then create unlimited terms within that vocabulary is connected to the platform’s robust information architecture. To make taxonomy even easier, Drupal even provides a drag-n-drop interface to organize the terms into a hierarchy, if needed. Content managers are able to use vocabularies for various functions, eliminating the need to replicate efforts. For example, a vocabulary could be used for both content tagging and making complex drop-down lists and user groups, or even building a menu structure.



There are a few contributor modules that provide workflow functionality in Drupal. They all provide common functionality along with unique features for various use cases. The most popular options are Maestro and Workbench.


Drupal has a dedicated security team that is very quick to react to vulnerabilities that are found in Drupal core as well as contributed modules. If a security issue is found within a contrib module, the security team will notify the module maintainer and give them a deadline to fix it. If the module does not get fixed by the deadline, the security team will issue an advisory recommending that the module be disabled, and will also classify the module as unsupported.

Cloud, Scalability, and Performance:

Drupal’s architecture makes it incredibly “cloud friendly”. It is easy to create a Drupal site that can be setup to auto-scale (i.e., add more servers during peak traffic times and shut them down when not needed). Some modules integrate with cloud storage such as S3. Further, Drupal is built for caching. By default, Drupal caches content in the database for quick delivery; support for other caching mechanisms (such as Memcache) can be added to make the caching lightning fast.


Multi-Site Deployments:

Drupal is architected to allow for multiple sites to share a single codebase. This feature is built-in and, unlike WordPress, it does not require any cumbersome add-ons. This can be a tremendous benefit for customers who want to have multiple sites that share similar functionality. There are few–if any–limitations to a multi-site configuration. Each site can have its own modules and themes that are completely separate from the customer’s other sites.

Want to know other amazing functionalities that Drupal has to offer? Stay tuned for the final installment of our 3-part “Why Drupal?” series!

Mar 10 2013
Mar 10

Episode Number: 


The Drupal 7 RobotsTxt module makes it easy to control your Drupal site's robots.txt file from the Drupal admin. This is especially useful for multisite Drupal installations in which a different robots.txt file is needed on each site.

In this module you will learn:

  • How to install and configure the robots.txt file on a Drupal multisite installation

Thanks to Drupalize.me for sponsoring this episode of the Daily Dose of Drupal.

DDoD Video: 

Nov 29 2012
Nov 29

Last Monday 200 plus of the brightest minds in search marketing from Texas and across the country got together for the annual State of Search Conference. A lot of topics were covered. But one was missing that should concern every Drupaler. Drupal was missing, totally and completely.

The day kicked off with the always entertaining and insightful Chris Brogan. The best-selling author and top 5 AdAge blogger was hitting the highlights of his latest book, The Impact Equation; currently the #1 book on Amazon for web marketing. He was espousing how you need to build your home base, e.g. your own website. His recommendation: "WordPress is the best tool for this." Note he was not talking about just a blog, but a CMS for your whole website.

The second session I attended was titled Link Building, but really turned into a discussion about content strategies - then using that content to build links. Several tools were mentioned to facilitate the process - all WordPress plug-ins.

This theme continued all day long. In five of the six session I attended, WordPress got promoted as the weapon of choice for content strategy and online marketing. (The sixth session was about YouTube) Even in the closing keynote from Bing Webmaster Tools evangelist Duane Forester, WordPress got shout outs. From a Microsoft guy? Really?

How many times was Drupal mentioned? Not once all day.

Pish Posh; Marketers

Now it might be easy to blow off this demographic. After all, us Drupaler's; we are developers. We are engineers doing real work and heavy lifting. We are building big, complex sites for some very important people.

But the marketers at the State of Search are not your usual collection of campers. Many are seasoned PR, marketing and tech vets. Their clients are not a bunch of local small businesses and mommy bloggers. They are a list of the who's who of big brands. And while they might not always be building the websites, they have the ears of the decision makers who are – and they are demanding the tools they are familiar with.

After all the marketers are the people making money for these brands. Us developers are just seen as cost centers. I think is wrong, but it's true.

Tough love

I love the Drupal project and the community. I am a developer first and a marketer second - with a little bit of a competitive streak. Hands down Drupal is a superior technical platform. But, it was very concerning to hear such an influential group of marketers in lock step about their weapon of choice, WordPress.

I have seen too many times where enterprise class leaders have been crept up on and beaten by seemingly lesser, lighter solutions. It happened with voice response and databases in the early 2000. Drupal has done it by capturing much of the commercial eCMS market. Will WordPress creep up and take the enterprise space from Drupal?

As a community, we are not focused on Drupal solutions for marketers. For example, at DrupalCon Denver, there were zero sessions about marketing or for marketers. Just like we have evolved our theming and design in the last few years, we need to work on making Drupal a better marketing platform.

Josh Koenig in his keynote, Drupal's Destiny, at Dallas DrupalCamp shared his vision for Drupal to run 20%+ of the web. I love that vision.

We have the technology. We have the developers. We have worked hard to get the designers. Now we need to work on getting the marketers. I think it's critical for Drupal to reach its destiny.

Doing the Drupal thing? What do you think? How do we get to running 20% of the web?

Nov 12 2012
Nov 12

Let’s say you have a mixed content-type view like an e-commerce site with different product types shown on the homepage, or a general ‘front page’ kind of view, and the client is adding content to the site prior to launch. Typically they will add one type of content to the site at a time. If the feed is ordered in descending date order, this leads to a monotonous display of one type of content followed by another.

There are many ways to get around this issue, with varying degrees of time involvement and success. At one end would be working out new dates and editing nodes one a time. This is easy if you only have half a dozen pieces of content, but it is obviously not going to work for larger numbers.

When, years ago, I first came up against an issue like this, creating photo galleries in Gallery2, I either set the order of photos to manual and readjusted them laboriously or set them to random. You can do the same in Drupal too, making a new “sort order” field and filling it with numbers manually or via a script.

You can also set content to sort by global:random – this is desirable for content that should be rotated when the page reloads, like testimonials, ads, or featured content. But it is very confusing for visitors trying to browse a feed sorted randomly as except for caching, there is no persistence to what they see. I have seen others use the Cache Actions module to partly get around this, forcing the same cached random view result to be used until a new node is added or another similar event.

It was one such particular case where I decided all these inelegant solutions just weren’t going to cut it and worked on a dedicated solution. It would also work well in cases of sites wishing to appear to have been established longer or more regularly active than reality.

The Script:

  • Changes the created and changed dates of nodes to fall with a random distribution between two given dates $date1 and $date2
  • Works on one specified content type at a time but can be set to do all content on the site at once by uncommenting one line


  1. Create a blank file, paste in the script and save as myscript.php. Then upload to a web accessible directory on your webserver.
  2. To run the script, visit myserver.com/myscript.php with your web browser.

Author: Miles Carter http://www.milesjcarter.co.uk/blog/

// 1. Edit your Drupal database details:
$db_drupal = mysqli_connect('localhost', 'db_user', 'db_pass', 'db_name');

// 2. Edit "WHERE node.type='article'" to the content type you wish to randomize

$query = "SELECT node.nid, created, changed, type FROM node
LEFT JOIN node_revision ON 'node.nid'='node_revsion.nid' WHERE node.type='article'"

// - OR: Uncomment below line to update all content rather than just one content type at a time

#$query = "SELECT node.nid, created, changed, type FROM node LEFT JOIN node_revision ON 'node.nid'='node_revsion.nid'";

$results = mysqli_query($db_drupal, $query);
if (!$results) {
echo '

Error doing script: '

         mysqli_error($db_drupal) . '';
while ($row = mysqli_fetch_assoc($results)) {
$theid = $row['nid'];
$type = $row['type'];

/* 3. Edit below dates to suit, typical usage shown as example
   $date1 = The earliest possible date that content may be set to
   $date2 = The latest possible date */

$date1 = strtotime('2012-01-01');
$date2 = strtotime('now');

$rand_date = mt_rand($date1, $date2);

// Update DB
 $query_insert = "UPDATE node SET created='$rand_date', changed='$rand_date' WHERE nid='$theid'";
if (!mysqli_query($db_drupal, $query_insert)) {

echo '

Error doing script: '

         mysqli_error($db_drupal) . '';
else {  
echo "Record change attempted: $type $theid $rand_date
;  }


Oct 22 2012
Oct 22

Anyone who's ever talked shop about Search Engine Optimization has heard of meta tags. Those bits of extra data jammed in an HTML document's HEAD section provide search engines, browsers, and other software with important information about a document's contents, related links and media, and more. There are quite a few ways to jam meta tags into a Drupal site, and there are even APIs to set the contents of a page's meta tags yourself, if you're a module developer. Thankfully, you don't have to sling code thanks to the excellent Meta Tags module.

Screenshot of administration screen

Maintained by prolific Drupal developer Dave Reid, Meta Tags provides a centralized configuration screen where common meta tags can be edited sitewide, for specific types of pages, and even for pages belonging to specific entity bundles. Need one set of tags for photo galleries and another for user profile pages? No sweat. Meta Tags uses standard Drupal tokens to build the contents of its tags, and the configuration options themselves can be exported and saved in Feature modules for easier deployment.

Screenshot of advanced options

Third-party modules can add new meta tags to the mix, and add new types of URL paths that need to receive custom tags. The Panels Meta Tags and Views Meta Tags projects, for example, allow each view and panel to have custom, token-driven meta tags just like nodes, users, and so on. Meta Tags is already a popular solution to the thorny problem of sitewide meta tag customization -- check it out if you need more than Drupal core's auto-generated ones.

Aug 14 2012
Aug 14

Posted Aug 14, 2012 // 3 comments

With the right preparation and foresight, launching your new CMS, or relaunching your CMS in Drupal, can be a smooth process. Anticipating the future and looking at the big picture of your companies' goals is integral to the success of this process. Here are the top 5 mistakes that you should avoid:

1. Spending huge focus, time, and capital assuming only today's problems, instead of tomorrow's

Quick exercise: Look at your current digital endeavor and think back to July 2010. What were you focused on then? How much of it matters now? How much of what you did is still in effect on your current platform and providing ROI now? In my experience it's about half. If it's 60-80% you are an excellent and disciplined strategist. (If you say 100% you are probably suffering from selective memory loss.)

The way to correct this mistake is to embrace agility within the context of your big migration and launch, and (this is the kicker) throughout the lifespan of your new Drupal site. Regardless of your specific endeavor, you must cope with a digital landscape that shifts every three to six months. You must meet the challenges of digital, while simultaneously delivering digital products on-time, on-budget and on-scope. Fifty percent of your project should focus on assumptions of "now", and the other half should assume the unknown. Looking to the future also allows you to let go of some of the aging products or content on your site and not get mired in the minute of a digital product that should be left behind. You will likely be forced to kill/change/revamp/ignore half the site within two years. New challenges will emerge, even within the timeline of the project itself. You cannot prepare for everything so set yourself up for success by assuming iteration. Build solutions that can easily change. Don't lock yourself into solutions based on a set of assumptions about digital that are likely to change. It may sound crazy, but after five years of helping businesses and enterprises reach their digital goals I know you should weigh your investments carefully with this in mind: Don't build a thing you wouldn't be okay with breaking in six months. I'm not the first person to propose such an approach for dealing with an uncertain future. Not embracing agility in your build and your ongoing strategy, could leave you without a future to face.

2. Assuming a sign-off on designs means the work of designing is done

Seeing is [not] believing: there is a false security that comes with the almighty "design sign off" on mocks, PSDs or design comps. Once everyone works through comps and decides on "The Design We Want," teams tend to gather everyone in a room and throw a static image of your new homepage up on a projector. "This is our New Site." Everyone nods, ohs and ahas, but know that many steps remain between that moment and the end of the design process. That first exposure achieves something, but it's not your team's or your organization's full understanding and acceptance of the design. The team will return to design again and again. The greatest challenge is to retain the fundamental successes of the original design effort, but eliminate the mistakes that reveal themselves through incremental development. In order to leave space for this to happen you can't fall victim to mistake #2, and if you try to retain the original projector image with rigid enforcement your new site will suffer for it. See number #3 on how to handle the on-going changes to not only design but all other aspects of your site.

3. Listening to your Users Too much, or Too Little

There's a sweet spot with user feedback and how it can fit into your agile process. You need to 1. Create an efficient way for users to give you feedback and 2. Understand how your stakeholders - every stakeholder - will engage with the new site. Agile is grounded in a basic assumption that guides number one: your stakeholders will change their mind… a lot. To actually meet their needs you must listen to and keep a focus on all stakeholders but that can be challenging given their inevitably shifting requirements. How can you stay efficient while managing your project schedule with time-boxed iterations and listen to all your stakeholders who always change their mind? You must find a way to incorporate continuous user feedback into the process of building your new CMS - it's the agile way. Don't unintentionally ignore some users who aren't internal to your organization: customers/readers/audience. For them you should use proxies or people with in-depth user knowledge. Proxies can be anyone from technical service folks to site architects and UX specialists to the patient saint who fields phone calls and emails from users complaining they can't do "X" on your site. Also plan for the fact that a disconnect will always exist between what internal stakeholders *think* people come to the site for, and what they actually do. Check your analytics and present data to confirm/counter assumptions and make that check part of your iterative feedback process. This leads to my final point: understand your stakeholders. Do all your research before the project starts and work to create a definition of all stakeholders involved: roles, goals, tasks and create user stories. Then schedule check-ins against those definitions and user stories within your feedback cycles.

4. Trying to be an SEO expert overnight (or even within the lifespan of your rebuild)

You can achieve solid Search Engine Optimization with your new build, but you cannot know everything you will need to know when you launch. I've seen serious scope creep on projects with people who were convinced they could crack google's algorithm. They build requirements around their Master SEO Plan for their site's global dominance in all search ranking. You will make mistakes and miss things in how you optimize your site for search. Instead, build-in pre and post-launch check lists for search optimization best-practices for content, redirects and performance. Then move on to the rest of your new site. Also know about "the most powerful Drupal module that does nothing."

5. If we build it, they will come

It used to be a big deal to launch a website. It's not anymore. Simply launching a site isn't the traffic boost it used to be. You need a PR and social strategy in place before day one. If you want to leverage your site launch to make a big splash don't ignore PR. Craft your media blitz with nuance. Have a social strategy in place to refine messaging to your own users, including messaging in the first few hours, days and weeks after launch. Talk with your technologists about highlights of innovation. Don't depend solely on your traditional audience. Work with your partners in technology, business and content to promote the site in all sectors, not just your own. Everyone should get a space to brag. Make sure you build something worth bragging about.

Kellye Rogers is a Project Manager at Phase2 Technology. She is passionate about listening and communicating with clients, developers and designers to create the best Drupal products possible. She lives for streamlined, innovative solutions ...

Jun 21 2012
Jun 21

Increasingly our web pages are being bookmarked on iOS devices.  This is a good thing, however we had traditionally been using long titles on our pages and these were clumsy for end users when trying to store bookmarks.  Like 90,000 other websites we have chosen Page Title to solve this issue.  It works well with Tokens and Views and is probably one of those modules you should just install.

Here’s your 1:30 video http://www.youtube.com/watch?v=DMvXVJ2mbGQ

and a couple of screen shots for the really curious types.  It’s a simple module to install and use. Made by several of Drupal giants robertDouglass, JohnAlbin, and nicholasThompson.

Turn on page titles in the content type area

Turn on page titles in the content type area

Enjoy refreshing page titles independent of your content title

Enjoy refreshing page titles independent of your content title

Jun 21 2012
Jun 21

By now everybody who has a website should know that search engine optimization and social media marketing is essential for online success. But knowing and doing are two different things.

Optimizing site content for search engines is mystical voodoo to most authors. How do we integrate social media into our site so we can build our tribe and get them sharing the good word?

In the last segment of our Results Oriented Web Quickstart, we peel back the mystery and show you how to streamline your SEO and social media site integration. We reveal a novel suite of tools that enable anybody to start optimizing their site to drive search engine traffic and a dirt simple way to transform your site into a follower building, content sharing hub of your social media universe.

Let us know if these videos are helpful in the comments below!

Get Drupal help when you need it most! Find hundreds of great tutorials. Track, rate, comment and more. Create Account
May 29 2012
May 29

Being able to set custom page titles and Meta descriptions is an important part of SEO for many sites, vital to establishing topical relevancy and therefore rankings in the case of the former, and clickthrough rates from search results in the latter.


Drupal 7 does not support custom page titles or Meta descriptions out of the box and I have found this script to be extremely useful on a number of sites and still find it to be a more robust alternative than using multiple modules. It works with Panel pages which has continued to be an issue with the page_title module. If no custom page title is found, it falls back on a basic “drupal title | site name” scheme. The script could be edited to support other patterns.

At the end of last year I was working on adding multilingual functionality to a Drupal 7 site and needed to get this script to work with multiple languages. It now allows the setting of field-based custom titles and Meta descriptions for different languages, with each node translation being able to have it’s own unique title and Meta description.

It works on single/undefined language sites too so this replaces the old version of the script entirely.


Simply create new fields for your content type(s) called “title” and “meta_desc”, then paste the following code into your THEME_preprocess_html function in template.php:

 * Ver: 1.05
 * By Miles J Carter
 * http://www.milesjcarter.co.uk/blog
 * Tested with Drupal versions 7.3, 7.4, 7.8, 7.9, 7.12, 7.14
 * licensed under the GPL license:
 * http://www.gnu.org/licenses/gpl.html
 * Works with all content types that have
 * text fields created named "title" and "meta_desc".
 * Insert into THEME_preprocess_html function in template.php

// Extract language value for multilingual sites
global  $language;
        $lang = $language->language;

// Find Node ID

$node = $vars['page']['content']['system_main'];

if (isset($node['nodes'])) {  
        $node = $node['nodes'];
        // Extract key value for node ID
  if (list($key, $val) = each($node))  {
    // Node object variable
    $node = ($node[$key]['#node']);            
        // Assign page title field content variable, if set            
        if (isset($node->field_title)) {
          $node_title = $node->field_title;
                if (isset($node_title[$lang]['0']['value'])) {
                  $seo_title = $node_title[$lang]['0']['value'];
                // Fall back on undefined language if nothing set for this language
                        elseif (isset($node_title['und']['0']['value'])) {
                          $seo_title = $node_title['und']['0']['value'];
  // If manual field title for SEO has been set, set the title to [seo-title] | [site-name]
        if (isset($seo_title)) {
          if (strlen($seo_title)65) {        
  $vars['head_title'] = implode(' | ', array($seo_title, variable_get('site_name', ''),  ));
          else {        
  $vars['head_title'] = $seo_title;
// If SEO title field not set, use an automatic [current-page-title] | [site-name] scheme
        else {  
  $vars['head_title'] = implode(' | ', array(drupal_get_title(), variable_get('site_name', ''), ));  
// Uncomment to set custom pattern for non-node content
#       else {  
#  $vars['head_title'] = implode(' | ', array(drupal_get_title(), variable_get('site_name', ''), ));  
#       }

// ----- Custom Meta Description (uses $node variable from previous code) -----

// Assign meta_desc field content variable, if set
if (isset($node->field_meta_desc)) {
  $node_desc = $node->field_meta_desc;

        if (isset($node_desc[$lang]['0']['value'])) {
            $seo_desc = $node_desc[$lang]['0']['value'];
                 elseif (isset($node_desc['und']['0']['value'])) {
                        $seo_desc = $node_desc['und']['0']['value'];

if (isset($seo_desc)) {
// Create meta description element array for insertion into head
    $element = array(
      '#tag' => 'meta',
      '#attributes' => array(
        'name' => 'description',
        'content' => "$seo_desc",
    // Insert element into (if field has a value)
    drupal_add_html_head($element, 'meta_description');

// ------- END SEO CODE ---------

If nothing changes, flush your caches.

I hope this is useful to other SEOs and Drupal developers – follow me on Twitter to stay tuned for updates (I may see if it’s possible to turn this into a module). Please report any bugs in the comments.


1.03 – 30/5/2012 – Minor tidying of code and comments, fall-back pattern now applies to nodes with no title set rather than non-node content (moved a parenthesis to where it should have been)

1.04 – 31/5/2012 – Addition of optional custom pattern for non-node content (commented out by default)

1.05 – 24/7/2012 – Only shows ” | sitename” on the end of the custom title if the custom title is less than 65 characters in length (to help prevent title overflow in search results) – let me know if you think this is not improved functionality.

Feb 08 2012
Feb 08

A client that has a lot of physical locations asked me how to improve search engine optimization (SEO) for those locations. They have web pages for each of their locations and were concerned about making sure all those individual location pages are getting ranked well. This doesn't seem to be a very well documented subject, but I found a number of ways to make sure that Google and other search engines know more about the physical locations that are related to a web site.

Google, in particular, has been making locative information more important than ever. If Google has any information about where I am located (and it usually does), it will push results in my location to the top of the search results list for any term I search for. For instance, if I search for 'Coffee' into a normal Google search, I get results like this, even though I didn't add anything about my location in my search terms. This makes it clear that having accurate location information in my web site must be very important.

Create a Location Page for Each Location

The obvious starting point is to have at least a page, and perhaps a section of your site, devoted to each location. Each location page should include as much information as possible about the location.

Add Microformats/RDF information

The next thing you can do is to make sure all the location pages (and for that matter, the other pages on the site) have been marked up with as much structured information as possible. There are various ways to do that, RDF, microformats, rich snippets. But the new method preferred by Google and other key search engines is to use the Schema.org standards.

I wrote an article about how to incorporate structured data into Drupal 7: How Does RDF Work in Drupal 7? In short, you need to enable the core RDF module along with the contributed Schema.org module, and set your locations up to comply with the right Schema.org standards. I believe you want to use the Organization standard for the main headquarters page and the LocalBusiness standard for the branch pages.

More information about Schema.org specifications is at:

Create a Geositemap

The next thing you can do is to create a geositemap and post it on the site. This is a specific form of XML sitemap that contains the geographic information for all your locations. There's not much written about this and it seems to be kind of a sleeper topic. But it makes sense, and it can't hurt.

A geositemap looks like the following:

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"

More information about geositemaps is at:

Claim Your Google Places Listings

Google is hot at work trying to make all its searches more localized, and it is trying to create a comprehensive database of Places. Sites that have good Places information will rank better in Google than sites that do not.

So another task is to work with the Google Places information, which actually has nothing to do with the web site. To see what Google is presenting to users for your physical locations, go to Google Maps, select a city where you have a location and do a search for that location.

When you find it, click on the name in the dialog box.

That should turn up a Google Place file. It might look like the following. You can see from this example that that the owner has not claimed this site, it has not been verified, and anyone can edit it. It has pictures they didn't put there and a list of categories that may or may not make any sense.

The difference between claimed and unclaimed sites is that the unclaimed sites say "Business owner?" and provide a form where you can claim the listing, and the claimed sites say "Owner-verified listing."

You should find and claim all your locations in Google. There are some bulk upload programs available, but some of the articles I read said you can't rely on them and that it is better to have someone manually make sure each individual Place has been claimed and is accurate and representative.

See Google Places' Personalized Dashboard for more ideas on optimizing those listings.

Some articles that explain this in more detail include:

Create Custom Maps

There is some speculation that creating a custom Google maps may help SEO (for example, see Google Custom Maps: A Goldmine For Local Businesses, which says that pages created with custom maps are displayed prominently in Google results). As with everything about SEO, it's hard to separate the speculation from the reality, so who knows if, or how much, this will help your search results, but it makes sense to add a map to any article that talks about locations.

In Summary

None of the tasks in this list are especially difficult to do, but it certainly seems that it is worth taking the time to do them. If you, or your clients, have physical locations, make sure the search engines know as much about them as possible!

Jul 28 2011
Jul 28

This script has been updated to work with multilingual sites too! See http://www.milesjcarter.co.uk/blog/web-design-development/drupal-7-seo-page-titles-meta-elements-theme-layer-multilingual/. All further development will be with the new version

Drupal 6 was great for manual control of page titles, either with the page_title module, or with control at the theme layer.

In Drupal 6, I used a small snippet of code like this in the page.tpl.php to set a custom page title, simply because it was simple and sufficient for most sites:


if ( arg(0) == 'node' && is_numeric(arg(1)) ) {
  $node = node_load(arg(1));
  if ( $node->type == 'page' && !empty($node->field_title[0]) ) {
    // Output CCK Title
print content_format('field_title', $node->field_title[0]);
else {
print $head_title;


field_title being a field called “title” I added with CCK to the ‘page’ content type or any other content type that should have hand-written page titles. A similar snippet also did the trick for the Meta description.

However, Drupal 7 makes this a lot trickier – whereas the title and other head elements are declared individually in page.tpl.php in Drupal 6, the replacement for Drupal 7 is:

<?php print render($page['header']); ?>;

In Drupal 7, anything to be inserted into the head at the theme layer (by my understanding) has to be done through preprocess functions in template.php.

As an aside, notice in the previous the use of the render() function to output the header – this is a common source of confusion amongst those new to Drupal 7 theme development, where just print is needed to output regions in Drupal 6.

This is made doubly tricky by node variables not being directly available in template.php as they are in page.tpl.php.

I tried out the page_title module for Drupal 7, and this does work to an extent, but it breaks completely with panel pages. You could, according to a post on drupal.org use panels as a template to display nodes, but for a single page usage (as in a homepage only use) this seems like something not straighforward. It’s also another module to keep maintained, and with field tokens currently broken and not much progress being made the page_title module is a lot less useful than it was in Drupal 6.

A Drupal 7 Solution:

I was inspired by this post by Sivaji Ganesh, containing this line:

$vars['head_title'] = implode(' | ', array(drupal_get_title(), variable_get('site_name', ''), variable_get('site_slogan', '')));

For setting a title at the theme layer as “title (as in the h1 title) | site_name | site_slogan”

This gave me a base to work from. The code I finally came up with (after about 8hr of perserverance) was this:

 * Ver: 0.9c
 * By Miles J Carter
 * http://www.milesjcarter.co.uk/blog
 * Tested with Drupal versions 7.3, 7.4, 7.7
 * licensed under the GPL license:
 * http://www.gnu.org/licenses/gpl.html
 * Works for content types that have text fields created
 * named "title" and "meta_desc".
 * function THEME_preprocess_html(&$vars) {
 * in template.php

// Find Node ID
$node = $vars['page']['content']['system_main'];

if (isset($node['nodes'])) {
        $node = $node['nodes'];
        // Extract key value for node ID
  if (list($key, $val) = each($node))  {
    // Create node object variable
    $node = ($node[$key]['#node']);    
                // Creat page title field content variable, if set             
                if (isset($node->field_title)) {
      $node_title = $node->field_title;
                if (isset($node_title['und']['0']['value'])) {
        $seo_title = $node_title['und']['0']['value'];
  // If manual field title for SEO has been set, set the title to [seo-title] | [site-name]
  if (isset($seo_title)){
                 $vars['head_title'] = implode(' | ', array($seo_title, variable_get('site_name', ''),  ));

/* If SEO title field not set, or content type not page,
use an automatic [current-page-title] | [site-name] scheme */

else { 
  $vars['head_title'] = implode(' | ', array(drupal_get_title(), variable_get('site_name', ''), ));  

// ----- Custom Meta Description -----

// Create meta_desc field content variable, if set
if (isset($node->field_meta_desc)) {
  $node_desc = $node->field_meta_desc;
        if (isset($node_desc['und']['0']['value'])) {
                $seo_desc = $node_desc['und']['0']['value'];

    // Create meta description element array for insertion into head
    $element = array(
      '#tag' => 'meta',
      '#attributes' => array(
        'name' => 'description',
        'content' => "$seo_desc",
    // Insert element into (if field has a value)
    drupal_add_html_head($element, 'meta_description');


// ------- END SEO CODE ---------

This allows a field created called “title” to manually set the page title. If this field is not set, or the page is a view or  any other non-node page, the title will be “get_title() | site_name”, with get_title() the h1 title. Other fields could easily be incorporated into the script by minor modification.

Once the title was figured out, it was pretty easy to set up a field based meta description too.

As this issue had been holding me up from developing with Drupal 7, I hope the above code is useful to other SEOs and developers.

Dec 20 2010
Dec 20

Here's a quick tip which will influence your performance and SEO. It's just about uncommenting 2 lines of code in the .htaccess file that ships with Drupal (and replacing some text), but I've seen a lot of sites that tend to forget this.

Suppose your domain is something like yourdomain.com. Check now if you can access your site by prefixing your domain with www. and by not doing it. So check if http://www.yourdomain.com is accessible and if http://yourdomain.com is (without redirection to one of the two). If so, this article is for you.

The problem

If you have Drupal's page cache enabled, 2 cache entries will be generated for your page if you visit the same page on http://www.yourdomain.com and http://yourdomain.com. This is because the cache key Drupal generates is based on the full url (well, actually the cache key is the full url). This means your cache hit rate will be lower and the performance gain you'd get from caching will be not as high.

Another issue with this is that this will have some impact on your search engine results ranking. Suppose half of the people use the www-less domain, and the other half will use the www-having domain, then the score of your page for search engines will be shared between the two pages.

The solution

How can you solve this? Easy. Open your Drupal installation's .htaccess file and look for the following part.

  # If your site can be accessed both with and without the 'www.' prefix, you
  # can use one of the following settings to redirect users to your preferred
  # URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option:
  # 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]
  # 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]

If you read the comments in this part, you'll know what to do. Just uncomment the 2 lines that apply to your case (would you like to use the www-having or the www-les urls?).

For example, suppose my domain is mydomain.com and I would like to redirect all my urls to the www-having domain I would do the following:

RewriteCond %{HTTP_HOST} ^mydomain\.com$ [NC]
RewriteRule ^(.*)$ http://www.mydomain.com/$1 [L,R=301]


Just a little caveat. If you update your Drupal installation, the .htaccess file will be overriden (unless you don't explicitly don't overwrite it). In case you override your .htaccess file when updating, just make sure you redo these modifications.

Oct 04 2010
Oct 04

Following on from previous post about VCL tweaks to improve hitrate; there are occasions when a website should not be served from both www.foobar.com and http://foobar.com. In some instances Google will deem the content to be duplicate copy of each other and a website can suffer from dupe content penalty.

In such cases, it is often best to redirect (301) the incoming request to either automatically add or remove www to the domain name. So, if a request comes in for http://foo.com, you can get Apache to redirect to http://www.foo.com. Something like:

Apache redirect example

<IfModule mod_rewrite.c>
   Options +FollowSymLinks
   Options +Indexes
   RewriteEngine On
   RewriteBase /
   RewriteCond %{HTTP_HOST} ^foo\.com$
   RewriteRule ^(.*)$ http://www.foo.com/$1 [R=301,L]

This works great BUT it requires a redirect at the Apache level, wasting precious Apache resources. Wouldnt it be great if Varnish could do the redirect instead and lookup the requested page in cache without waking Apache? Here is how:

Concept is simple:
- varnish checks incoming request.
- match criteria for host
- throw an error
- catch the error
- redirect

Varnish 301 Redirect VCL example

sub vcl_recv {
  // rediercts for subdomain, add www
  if (req.http.host == "foo.com") {
    error 301;
  // rediercts for subdomain, remove www
  if (req.http.host == "www.barbaz.com") {
    #set req.http.host = "barbaz.com";
    error 301;
sub vcl_error {
  // 301 if the domain does not contain www
  if (obj.status == 301 && req.http.host == "foo.com") {
    set obj.http.Location = "http://www.foo.com" req.url;
    set obj.status = 301;
  // 301 redirect if domain contains www
  if (obj.status == 301 && req.http.host == "www.barbaz.com") {
    set obj.http.Location = "http://barbaz.com" req.url;
    set obj.status = 301;

Related blog posts: 

Bookmark and Share
Sep 23 2010
Sep 23

A few posts back, I wrote about creating a list of articles that link to some other article, i.e. a list of "backlinks". That post back then was focused on Drupal 7.

I'm a bit shocked though, that nobody noticed or mentioned that this feature already exists in Drupal 6. I had no idea either. So this heads up here is to make things right.

When you have the core Search module enabled and have Views installed and enabled, you should get a default view called "backlinks".


Sorry for my bad researching skills!

Aug 22 2010
Aug 22

A popular feature request for sites that deal with a lot of content, is to see for each page what other pages are linking back to it. This can be helpful when doing some SEO or cleaning up and rewriting old content.

In Drupal 7 this is easily done. It exists where you wouldn't immediately expect it though: the core search module. Kind of mimicking how search bots like Google's indexer works, Drupal 7's search module now takes the amount of nodes linking back to another node to calculate the score for some result.

To keep track of which nodes (and other) link to which other ones, the search indexer stores all links in a table called search_node_links. This table is only used internally by the search module though, but if you enable the Views module, you can enable a default view called "Backlinks".

The Backlinks view has 2 displays: a block and a page. The block you can put wherever you want, the page is added as an extra tab on each node next to "view" and "edit".

You can also choose to create your own views using the "Search: Links to" and "Search: Links from" argument and filter.

Let me finish this quick tip by mentioning that this feature works fine with url aliases too.


Note: It appears this was already possible in Drupal 6. Check out the update.

Aug 11 2010
Aug 11

the burbank entertainment giant has been acquiring family-focused websites in recent years, as its struggling disney interactive media group seeks to build out its online offerings for parents.


disney declined to comment. babble did not immediately respond to a request for an interview.

disney has been assembling its own collection of mom-focused websites for years, to bolster its network of family-oriented internet offerings. it acquired iparenting media's collection of websites in late 2007, and two years later paid $23.3 million to buy kaboose inc., a canadian family-focused media group.

"disney is all about moms and kids. it's a great place for them to 'play,'" said mike vorhaus,The United States a serial killer charged with 10 counts of murder victims may h, president of magid advisors consulting group.

walt disney co. has acquired new york-based babble media inc., a parenting site that features advice about pregnancy, child development and related topics from some 200 mommy bloggers.

babble,lancel, launched in 2006 by husband-and-wife team rufus griscom and alisa volkman,gucci borse, attracts about 2.1 million monthly visitors -- about 483,burberry borse,000 of whom are women with children ages 2 to 17, according to nielsen.

major media companies have been in hot pursuit of mothers. nickelodeon plans to launch nickmom,cheap price burberry tote bag sale,fashion desginer burberry pilgrim tote bag,on,?sac lancel, a nightly block of programs aimed at parents,sac vuitton, late next year. it will be accompanied by a website, nickelodeon's parentsconnect.com,louis vuitton valigia, to dispense parenting advice.

"this is an audience where there's a lot of loyal, faithful readers," said debra aho williamson, an online analyst for emarketer who wrote an october 2010 report about moms who blog. "people tend to gravitate towards certain bloggers ... and comment regularly on what they're reading. it's a very tight-knit community." 

the latest deal,louis vuitton, for which terms were not disclosed,sac hermes pas cher, disney gains a site that was named one of the 50 best of 2010 by time magazine. its stable of bloggers write on a range of parenting topics. recent contributions include "i'm jealous of my nanny," "20 sleepover party recipes" and "how to buy and use a family camera." 

"with more than 3.9 million mom blogs in the u.s. alone, disney interactive recognizes and values the important and powerful role moms have taken on in new media,burberry borse prezzi," brooke chaffin, senior vice president of moms and family for the company's interactive media group,Married men want a divorce because his wife refused to lose fertility,louis vuitton outlet, said in a statement.

blogs have become a vital source of information for women with children. the research firm emarketer estimates that 54% of the 32 million mothers who go online in the u.s. every month visit blogs.

Mar 04 2010
Mar 04

Ever wanted to implement or alter meta tags on a custom page or a view? As most of you would have already heard of the excellent nodewords 6.x-1.11 (module which allows users to define their own meta tags for nodes and much more), we will use some of the very useful API functions of this module.

You can actually use the nodewords API to alter, inject and define your own meta data on virtually any page.

Say you have a view and you want to dynamically set the meta tags for that view? easy..

Step 1: Implement the hook_nodewords_tags_alter() hook

Write your own module or add to your existing custom module a new function like this. This is an implementation of hook_nodewords_tags_alter()

function mymodule_nodewords_tags_alter(&$tags, $parameters) {
  $args = explode('/', $_GET['q']);
  // define your own logic to make it url specific
  if($args[0] == 'foo' and $args[1] == 'bar'){ // we have a valid url
    //if you are using alternative logic to dynamically 
    //load up the meta data, implement that here
    //finally set the tags
    $tags['description'] = "this is my custom meta description";
    $tags['keywords'] = "this is my custom meta keywords";

Note: if you are using an older version of Nodewords module (without the API), please check http://janaksingh.com/blog/adding-meta-tags-taxonomyterm-override-view-p...

Related blog posts: 

Bookmark and Share
Feb 12 2010
Feb 12

Thu, 02/11/2010 - 22:03

The global redirect module is a must have for SEO on a Drupal site.  It does a great job helping with drupals "duplicate content" issues and redirecting urls around your drupal install. 

For example by default, drupal shows the same content for a both a url ending in a slash "/" or not ending with a slash:

  • mysite.com/node/36/
  • mysite.com/node/36

To drupal this is the same page, but to a search engine, these might be very different pages.

Here are the settings I've found to work well with the search engines.

  • Deslash: ON
  • Non-clean to Clean: ON
  • Remove Trailing Zero Argument: Enabled for taxonomy term pages only
    • I've only really had issues w/ trailing zero's showing up in search engines with taxonomy term/vocab pages.  That is why I only turn this on.
  • Menu Access Checking: Dissabled
  • Case Sensitive URL Checking: Enabled

Global redirect module along with a good robots.txt file will help you get rid of alot of the duplicate content on your site that may hurt your SERP rankings.

Feb 11 2010
Feb 11

The nodewords module allows you easily set the meta tags on your site.  Some features of this module are (quoted directly out of the documentation):

  • The current supported meta tags are ABSTRACT, CANONICAL, COPYRIGHT, GEO.POSITION, DESCRIPTION, ICBM, KEYWORDS, PICS-LABEL, REVISIT-AFTER, ROBOTS and the site verification meta tags used by Google Webmaster Tools, Microsoft Bing Webmaster Center, Yahoo! Site Explorer.
  • You can tell "nodewords" to add all terms of some specified vocabularies to the KEYWORDS meta tag.
  • You can specify a default meta tag ROBOTS value to use for all pages. You can override it on each page.
  • On taxonomy pages, the term description is used as the DESCRIPTION tag. The term itself is added to the list of KEYWORDS. You can override the description to use if you wish.
  • You can seperately specify the meta tags to show on some specific pages of your site (in example, the front page, the error 403 page, the error 404 page, the tracker page), or to use in specific situations (in example, when the site is offline).
  • The support for Views, and Panels has been removed from Nodewords 6.x-1.x on August 15, 2009; successive versions for Drupal 6 replaced it with a more generic support for third-party module pages.
  • You can select which of these tags you want to output on each page. You can also remove the edit box for these tags from the node edit page if you don't like using it.
  • All text of the DESCRIPTION and KEYWORDS meta tags are added to the search system so they are searchable too; other meta tags could be added to the search system too (depending on the code implemented from the module).

So basically, nodewords does a lot of stuff, most of which you may not ever use (i know I don't use a lot of it), but its nice to know the functionality is there just in case you start using it.

How I use it

Many of different meta tags out there are often ignored or influence your SERP rankings very little.  As such I don't worry about most of them.  On every page I use mainly KEYWORDS and DESCRIPTION.

I spend maybe 10 seconds on the keywords tag and spend a good amount of time on the description meta tag (if I remember to do it).  I will also do a robots = noindex for pages that are used as thank you pages for newsletter sign-ups or just pages that I really dont want/need on the search engines.  Other than that, I really dont use much else... maybe canonical url tags but I try to setup drupal so I don't have a lot of duplicate content to worry about.

The Keywords tag - These don't really have much pull any more since they can be abused so easily.  They are also easy for the competition to very simply check what you have in the tag.  I used it because I believe it is still considered by search engines but I don't put in my exact keywords I might be trying to target.  If I'm targeting "dog training for fat dogs" I would put in "fat, dog, training"... something like that.

The Description tag - This is very important.  Maybe not so much for SEO (search engines still consider it though) but for selling your link.  If you have a 2nd or 3rd place spot for a search term, but your description is just a bunch random of text automatically pulled from the page ... you're going to loose clicks.  Keep this less than about 150 characters

The description tag should contain the keywords your trying to target, but feel like a normal description of your content.  It should try to pull in people from the SERPs.

The Google Webmaster Tools verification code

This is used with, yep, you guessed it, google webmaster tools (shocker hu...).  I only add my verification code to the front page.  Seems kinda silly to be able to add the code to every page... but whatever.

Settings Tab

Other than that, I only other things I have set are:

Maximum meta tags length: *

With those settings, you should get a collapsable meta tags settings for each node on your site.  That way you can set each and every node (wooohoo.. that will be fun if you have several thousand nodes to do).

Default and Specific Meta Tags Tab

Under this tab, I basically only set the frontpage meta tags and meta tags for any views I have (via "other pages").

I do not use the "Default Values" as I want everything to be different, and this also forces me to do it right and fill it out.

There you have it.  Nodewords does a pretty good job and makes it easy to add meta tags to each page.  It is a vital tool for doing SEO with drupal.

Nov 17 2009
Nov 17
Cover: Drupal 6 Search Engine Optimization

Cover: Drupal 6 Search Engine Optimization

I don't get asked to review books often, so I was delighted when I got asked to review Drupal 6 Search Engine Optimization by Ben Finklea, it being top of my list of Drupal books to buy. Search Engine Optimization, or SEO, is all about improving your site's position in search results. It's part science, part art, and involves a lot of small, but simple, improvements to your website. An important SEO skill is knowing what keywords to use for your site and how to avoid common mistakes that could have a detrimental effect on your site's ranking. This book does an excellent job at explaining just that and includes great advice and step by step instructions.

The book assumes you're a Drupal newbie, which I was a bit surprised by at first. I wasn't really expecting to see instructions on how to install a Drupal module, but this approach is used throughout the book and is a strong selling point. It takes the magic out of SEO so everyone, regardless of skill level or familiarity with Drupal, can achieve the most from their site.

It includes a long list of SEO related Drupal modules, some of which I already knew about but some of which, like Taxonomy Title, I didn't. It has some great advice on choosing keywords for your site and tips on writing good content. It also covers the top 10 most common SEO errors and how to fix them.

I already knew a fair bit of what the book covered, and I did find myself quickly scanning or skimming through some sections of the book. However I did still learn new stuff. Not only did I learn about some Drupal modules I was previously unaware of, but also keyword research tools such as Google Trends and Keyword Discovery, and a few other hidden gems.

Given that the book assumes the reader has no knowledge of SEO, I was expecting a small section or paragraph on what exactly SEO is and why you should care about it. I was also disappointed that it didn't really cover how to optimize URL paths. For example, how long is too long? When should they include the date? What's the recommended maximum depth or number of directories?

Admittedly, the book is aimed at beginners, and you may know some of the material already. However, regardless of your Drupal expertise or skill level, you probably will get something out of it. If nothing else, it should increase your awareness of SEO concerns when building websites or developing Drupal modules - it certainly has for me. Overall it's a decent book, and it would make a good addition to any Drupal bookshelf.

Title: Drupal 6 Search Engine Optimization
Author: Ben Finklea
Link: http://www.packtpub.com/drupal-6-search-engine-optimization-seo/book?utm...

Oct 02 2009
Oct 02

Play Video

Movie link (right-click to download) Problem with this video? Contact me

SEO is one of the more critical aspects for any web site - at least if you want to be found in the search engines. The fact that Drupal is capable of being super SEO friendly is a great benefit. However, it doesn't do you much good to simply know that Drupal is SEO friendly. With modules like SEO Checklist from Volacci you can certainly walk through the myriad of possible SEO options.

In this video, I simply walk through one of the more powerful Drupal SEO modules. The Nodewords module is what allows you to communicate, to your prospective visitors, what your content actually is and why they should visit your site - specfically, via the Description meta tag. If you only get two things from this video; 1) know that you absolutely need to use the Description meta tag and probably Keywords too and 2) use Nodewords to make it happen!

Feb 11 2009
Feb 11

According to their project page, it's deprecated since the functionality has been rolled into the newer version of nodewords:

"Starting from version 1.2, nodewords module has full support for canonical URLs. I strongly encourage everyone to use nodewords module instead of standalone canonical_url.
After release of nodewords 6.x-1.2, canonical_url is considered deprecated module and will be shut down after reasonable period of time."


Jan 08 2009
Jan 08

The logo of a Web site is not only important for branding but also as a navigational element, that many users expect to link to the home page. According to usability guru Jakob Nielsen the first of Ten Good Deeds in Web Design you can do is link your logo to the home page except you are on the home page.

Mr. Nielsen conducted many usability studies and has written groundbreaking articles and books on Web usability. Good reason for me to trust him when it comes to this topic, especially when it sounds completely plausible.

Why Linking with JavaScript?

There are many parallels between creating a usable and creating a search engine friendly Web site, but often enough you need to take subtleties into account. According to Rand Fishkin — let me call him the Jakob Nielsen of SEO — only the first anchor text counts for Google and he is not the only SEO expert who observed this.

On Linux-Netbook.com, a Drupal site I created a few months ago, the site logo did not link to the home page in favor of the site name, which appears later in the HTML source. I have no evidence and not tested whether anchor text is more important than ALT text, but that was my reasoning.

To fix this usability crime without sacrificing my SEO efforts, I added the following 5 lines of jQuery code to the theme's script.js file:

  if (document.location.pathname != Drupal.settings.basePath) {
    jQuery('#logo').wrap('<a href="http://www.seo-expert-blog.com/blog/linking-the-logo-to-the-home-page-with-javascript/' + Drupal.settings.basePath + '"></a>');

This code links the image with the ID logo to the home page unless we are on the home page, provided the user agent interprets JavaScript.

I assume that Google's engineers are smart enough to make Googlebot understand this JavaScript snippet, but I guess it does not play a role in the which link comes first game. In case it does, the ALT text contains the site name as well.

Jan 03 2009
Jan 03

The Drupal pathauto module is great but be careful how you configure it. The recommended settings are already chosen by default but let's review them below. To get to the Drupal pathauto URL aliases settings, go to: Administer > Site Building > URL Aliases (admin/build/path/pathauto).

1) General Settings

a) Verbose - good idea to keep this on so you know if the alias was created properly

b) Separator - dash is pretty standard and readable though I've seen people use underscores

c) Character case - looks cleaner to stick with all lowercase (but when creating browser titles (page titles) for your nodes, it's good to use mixed case for better readability)

d) Maximum alias length - keep to 100 or less so your urls won't be too long

e) Maximum component length - although the recommended number is 100, I don't imagine you are going to have a word that long, so something much shorter seems more realistic. Perhaps 30.

f) Maximum number of objects to alias in a bulk update - doesn't matter if you aren't doing bulk updates. If your site isn't live yet, the number can be high since it won't matter that it takes a long time to do.

g) Update action - this is a tricky one. If you are only in development mode (site isn't live) and plan changing node titles and/or autonodetitle rules regularly, then I would stick with:

"Create new alias. Delete old alias"

Note that if you are hand-coding links to nodes within other nodes, the safest way in this case would be to only ever use the node/xxx for the href but then that causes problems with SEO since you really always want to use the same link throughout the site. One solution to this is the pathfilter module.

If the site is live and you are careful about creating your node titles, then you can use:

"Do nothing. Leave the old alias intact."

This is so that your node urls don't change even if you later change the node titles.

If you prefer that your urls *always* reflect the node title, then you should choose:

"Create a new alias. Redirect from old alias."

This will ensure that Google, etc. will find your new URL by getting redirected from the old one.

The only other option is:

"Create a new alias. Leave the existing alias functioning."

which is very dangerous since it could end up generating tons of "duplicate content" on your site. You should never have two URLs that show the same exact content. Redirecting from one URL to the other is fine though the best is to only have one URL for each page on the site.

It would be nice to have finer control over this behavior so that you could have it regenerate the alias for a particular node without having to change the default settings. Or perhaps, for unpublished nodes, it could continue to change the url since it's not live.

h) Transliterate prior to creating alias - I had trouble with this one previously but maybe it's working properly now. The idea is if you have special characters in your node title, that these will be replaced with a non-special character equivalent (e.g. n with tilda becomes just n). When I tried this out, it didn't work and ended up putting the node I tried it with in some weird state and generating errors. It could have been since I created the node first and then turned on this feature. Maybe I'll try to reproduce this later on for another article.

i) Reduce strings to letters and numbers from ASCII-96 - same idea as (h) but more restrictive

j) Strings to remove - add whatever makes sense to you

2) Punctuation settings - I use all the defaults

3) Other path settings (e.g. node path settings) - these should be set based on how you want your urls to look like on your site. If you want all blog posts to start with "blogs" and include the user id and title, you could use:


If you create a special content type and what that to be part of the url, you can do that as well, e.g.


Simply look at the "replacement patterns" and decide what pieces you want to use in your URLs for different content types. You can create your own replacement patterns using tokens.

It is good idea to try to think through your Drupal pathauto URL aliases settings before creating a bunch of content so you don't have to worry about the aliases changing due to changing your rules and patterns.

Oct 07 2008
Oct 07

One of the great improvements in Views 2 is the ability to create various page and block displays for one view. Block views can be linked to a page display when the More link option in the block's settings is enabled.

If there are one or more page displays set up in the view, the page to be linked can be chosen after clicking on the link next to the Page display option. See the screenshot below for an example:

Views 2 Block settings: Link display optionViews 2 Block settings: Link display option

The default anchor text of more links in block views is more which comes with the benefit to be pretty generic but is not good from an SEO point of view.

Anchor texts are very important for search engine rankings as the number one search result for click here demonstrates. Neither the words click nor here actually occur on the Adobe Reader download page, but it is linked with this anchor text very often.

To replace the default anchor text for more links with the title of the linked page, which is hopefully more meaningful, you can override the views-more.tpl.php template file by taking the following steps:

  1. Copy views-more.tpl.php from PATH_TO_VIEWS_MODULE/theme/ to your theme directory
  2. Replace the content of views-more.tpl.php in your theme directory with the code below.
  3. Clear the theme cache. You can achieve this by clicking on Clear cached data at the bottom of the Performance settings form on the admin/settings/performance page. This will clear all cached data, which should be avoided on high traffic sites. Alternatively you can call drupal_rebuild_theme_registry() in your template.php file once after you copied and edited the views-more.tpl.php file or by executing this SQL query
    DELETE FROM `cache` WHERE cid LIKE 'theme_registry%';

Code in views-more.tpl.php

= strlen(base_path());
$path = substr($more_url, $offset);
$menu_item = menu_get_item( $path );
$title = check_plain($menu_item['title']);

<div class="more-link">
  <a href="http://www.seo-expert-blog.com/tutorial/how-to-optimize-views-2-more-links-anchor-texts/<?php print $more_url; ?>">
    <?php print $title; ?>

The $more_url variable is made available by the views module in the views-more.tpl.php template file. It contains the absolute path to the linked page view. To get the title of the linked page, the internal Drupal path is extracted from $more_url using PHP's substr() function.

The internal Drupal path is needed to call menu_get_item(), which returns a menu router item that in turn contains the page title in the value for the title array key.

Actually, I am not sure whether calling check_plain() on the title is necessary here, since I assume that this taken care of before the router item is written to the database. Any insight on that is greatly appreciated.

The remainder of the code in the template file consists of the mark up of the more link with the linked page title as the anchor text.

That's it. A simple yet effective method of optimizing the anchor texts of more links in Views 2 blocks. A demonstration of this code in use can be seen in various blocks on linux-netbook.com.

The screenshot of the views settings page and the annotations are done with the awesome Firefox extension FireShot, that I just discoverd today. There is great software outside the Drupal universe ;-)

Aug 13 2008
Aug 13

Google Webmaster Tools includes a tool called content analysis that you find in the Diagnostics section. The content analysis tool reported a suboptimal number of duplicate title tags and meta descriptions for some Drupal sites that I monitor with these tools.

Getting rid of duplicate title tags and meta descriptions caused by the pager is actually quite simple. When using the Meta Tags module with the setting ALL=INDEX,FOLLOW for Default robots meta tag: you can adjust the robots Meta tag in your theme, so that pages that contain the page parameter in the URL are not indexed using the following code snippet in the head section of your page.tpl.php template file.

if (isset($_GET['page'])) {
$head = str_replace('<meta name="robots" content="index,follow" />',
'<meta name="robots" content="noindex,follow" />', $head);

If you do not use the Meta tags module or another solution to add Meta tags to the head section of your HTML, the robots Meta tag is not contained in your page source. In this case you can simply append this tag to your head variable like that.

if (isset($_GET['page'])) {
$head .= '<meta name="robots" content="noindex,follow" />';

Setting the robots Meta tag to noindex,follow tells search engine crawlers that care about the robots Meta tag and the robots exclusion standard to not index these pages, i.e. they won't appear in search engine results but linked pages will be crawled, provided they are not linked with rel="nofollow".

Adding this code to your theme is a quick hack and not the optimal solution, because it is not easily reusable. Since I want to get rid of this in my theme sometime in the future, I added a feature request to the Meta tags module with a patch that resolves issues with duplicate title tags and meta descriptions on pages generated by Drupal's pager.

The fact that Google displays such issues in the diagnostics section of their webmaster tools indicates that they play a role in evaluating the quality of your site. It is not likely that your site will be considered spam and get banned because of these issues, but it is certainly better to get rid of them.

Mar 26 2008
Mar 26

Today I’m just demonstrating a few simple theme adjustments to comments. Comments in Drupal 5 are “not sexy”, out of the box, so in this short post I’m going to illustrate how to:

  • change the text on “submitted” lines in comments (just a little)
  • add nofollow to username links – unless you’re feeling generous
  • remove the “not verified” marker from anonymous users

// change the "submitted by" text to "posted by"
// note that you can alter the date display too, by changing the way
// format_date() is called - see http://api.drupal.org/api/function/format_date/5
$vars['submitted'] = t('Posted by !a on @b.',
'!a' => theme('username', $vars['comment']),
'@b' => format_date($vars['comment']->timestamp)));

This first snippet belongs in the ‘comment’ section of your _phptemplate_variables function in template.php; I have an example of this here.

Moving on to that “not verified” business, and the question of holding on to your link juice, adding an overridden theme_username() function is the way to go. Here’s some code, which you can also place in your template.php file in your theme. Remember, if you don’t have that file in your theme, you can just create it yourself. I personally recommend Zen as a starting point for theming.

// we can't use phptemplate_username as this is already declared in that engine
function mytheme_username($object) { // rename according to your theme

  // this basically means "if the user has an account"

if ($object->uid && $object->name) {
// Shorten the name when it is too long or it will break many tables.
if (drupal_strlen($object->name) > 20) {  // obviously you could change this value
$name = drupal_substr($object->name, 0, 15) .'...';
    else {
$name = $object->name;

    if (

user_access('access user prosites/default/files')) {
// we could nofollow the internal links too (authenticated user's pages)
      // but there's not really any point - my site doesn't use membership,
      // so usernames are not highlighted -
      // commented line below would do that, though.
      // $output = l($name, 'user/'. $object->uid,
      //     array('title' => t('View user profile.'), 'rel' => 'nofollow'));
$output = l($name, 'user/'. $object->uid,
'title' => t('View user profile.')));
    else {
$output = check_plain($name);
// if we're entering this func, the user is anon (i.e. we want to nofollow them)
else if ($object->name) {
    if (
$object->homepage) {
// this is where we're nofollow-ing the external links to comment authors' pages
      // we don't really need to use t() here, as rel=nofollow is language independent
$output = l($object->name, $object->homepage, array('rel' => 'nofollow'));
    else {
$output = check_plain($object->name);
// commenting out this line prevents "teh ugly" in the $submitted text
    // $output .= ' ('. t('not verified') .')';
  else {
$output = variable_get('anonymous', t('Anonymous'));

If you’ve got any other simple tips like these, let me know, so I can use & share those too!

Update: This code works fine under Drupal 6 as well – but don’t forget to clear your theme registry when you’ve modified things in your theme!

Feb 18 2008
Feb 18

In this short video Search Engine Marketer Brian Chappell recommends some basic SEO measures for a Drupal site. Since Drupal is very search engine friendly out of the box, there are not many things you need to do.

Brian recommends to activate the core path module and to additionally install the Page Title, Global Redirect, and Meta Tags modules. In his accompanying blog post are also some notes on the .htaccess and robots.txt files.

I haven't used the Page Title module yet, but agree that Path, Global Redirect, and Meta Tags (nodewords) should be installed and activated, and also the XML Sitemap module.

Last year I wrote about SEO modules for Drupal and other CMS with some more modules that are worth taking a look at. There is also the SEO Checklist module by Ben Finklea to help you make your Drupal site even more search engine friendly.

One hint from me. Make your site friendly for yourself and your users first. Then take care of the bots, if you feel like doing so.


I lost some comments on this post, that were mistakenly classified as spam by the spam protection I am using. Greg Knaddison, a.k.a. greggles, pointed to his free Drupal SEO video-course, where he covers the most important Drupal core settings and contributed modules for optimizing your site. Check it out!

About Drupal Sun

Drupal Sun is an Evolving Web project. It allows you to:

  • Do full-text search on all the articles in Drupal Planet (thanks to Apache Solr)
  • Facet based on tags, author, or feed
  • Flip through articles quickly (with j/k or arrow keys) to find what you're interested in
  • View the entire article text inline, or in the context of the site where it was created

See the blog post at Evolving Web

Evolving Web