19

I know how to check if a site is built with Drupal, but is there a way to tell if a site is built with Drupal 7?

11 Answers 11

20

Some obvious giveaways to the site being drupal 7:

  • RDF in the <head> section in the HTML
  • Meta tag of <meta name="Generator" content="Drupal 7 (http://drupal.org)" />
  • Executing jQuery.fn.jquery; reveals the jQuery version to be 1.4.4 or 1.5.2 (with jQuery update)
  • Only a single <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - this is a famous drupal 6 bug (it has two in the <head> section
  • HTTP response header of X-Generator: Drupal 7 (http://drupal.org)

Other options include using 'sniffers', my favourite being 'Whatweb' - https://github.com/urbanadventurer/WhatWeb. Whatweb is a (ruby) command line tool that can sniff not only the fact that the site is using drupal, but often the major and minor version as well

6
  • Only two of those points can help to understand if a Drupal site is using Drupal 7; the other two points would still be valid for Drupal 8.
    – apaderno
    Dec 3 '11 at 13:25
  • Luckily no one is running drupal 8 in production at the moment ;)
    – wiifm
    Dec 4 '11 at 1:08
  • I doubt the OP has a real need to understand when the site is using Drupal 7, and not any later version. If he really needs to know when the site is using Drupal 7, then the other methods don't help him. :-)
    – apaderno
    Dec 4 '11 at 1:24
  • The meta tag bug is pretty interesting. Any reason why it wasn't patched?
    – Sam152
    Dec 18 '11 at 5:09
  • It actually was introduced to fix a security hole - read more here drupal.org/node/451304 - there are also workarounds for drupal 6 to reduce this number back to 1
    – wiifm
    Dec 18 '11 at 21:56
6

Unless someone has taken it out, you could look for the tag below

<meta name="generator" content="Drupal 7 (http://drupal.org)" />

Syntactically though, I just too a look for a way to be sure and can't really see anything. Jquery now requires being wrapped

(function ($) {

})(jQuery);

but some older Drupal sites may also do things that way if they had been customised.

I think the answer is that you can't be 100% sure.

2
  • matt v and jimajammas answers are both better than mine :) Dec 1 '11 at 19:10
  • I don't think that their answers are much better than yours. In fact, you might be right that there is no 100% sure method. Dec 1 '11 at 19:59
6

One quick way is to try hitting the http://example.com/CHANGELOG.txt URL, to see what the changelog reports as the version being used. For example, this happens to be true for Drupal.org: http://drupal.org/CHANGELOG.txt.

3
  • 2
    Thanks for mentioning. In fact I did try that on the site I was looking at before asking this question, but they had removed CHANGELOG.txt - just like I always do myself :-) Dec 1 '11 at 20:15
  • Most webserver configurations will block the download of .txt files in the webroot. And I would encourage all webservers serving drupal to do this (to prevent exposing the major and minor version of drupal)
    – wiifm
    Dec 1 '11 at 20:18
  • 1
    @wiifm Sure, but plenty don't.
    – Matt V.
    Dec 1 '11 at 22:43
6

You could also check the HTTP headers (in Drupal 7) for something like "X-Generator Drupal 7." This is a link to a page explaining how to remove that, if anyone would be interested: http://drupal.org/node/982034.

4

Another way is to look a the Javascript Drupal.behaviors object. In Drupal 6, init functions are attached like

Drupal.behaviors.foo = function () {
  // ...
}

In Drupal 7, it is like

Drupal.behaviors.foo = {
  attach: function () {
    // ...
  }
}
2
  • That is also true for Drupal 8, though. There are not sites running Drupal 8, so far, but once they will appear, you cannot anymore use this method.
    – apaderno
    Dec 2 '11 at 1:09
  • Other than the generator header, the same can pretty much be said about all of the answers outlined here.
    – mpdonadio
    Dec 3 '11 at 13:04
2

You could look what css files are loaded. On first glance, Drupal 6 loads modules/system/system.css while Drupal 7 loads modules/system/system.base.css.

3
  • 3
    True, but on a properly configured site (ie. with CSS aggregation enabled) this wouldn't work. Dec 1 '11 at 20:11
  • true, plus the isthissitebuiltwithdrupal.com site isn't correct all the time either, just take a gander at www.jacksonville.com as an example.
    – Jimajamma
    Dec 1 '11 at 20:32
  • Even if they have aggregation on you can hit the URL directly, eg example.com/modules/system/system.base.css = D7
    – cam8001
    May 16 '17 at 17:34
2

Someone in IRC suggested to look at the jQuery version: if it's 1.3.2, you can be pretty sure it's a Drupal 6 site. That said, this method is not infallible either.

2
  • 2
    Just checked Drupal 6.22. misc/jquery.js shows 1.2.6 in the comments and when jQuery.fn.jquery is examined.
    – mpdonadio
    Dec 2 '11 at 1:33
  • 2
    Yes, sorry, you're right. jQuery 1.3.2 is what you get on a D6 site after installing jQuery Update. Dec 2 '11 at 8:04
2

I usually look at the massive "blurp" of javascript in the header in the jQuery.extend(Drupal.settings,...
A typical Drupal 6 has a very small string there while every Drupal 7 have a massive one.

3
  • 1
    It all depends from the number of modules using Drupal JavaScript settings.
    – apaderno
    Dec 2 '11 at 1:07
  • Sure but in D7 it is way bigger than D6 (I'm not sure yet why) but compare the source code of france.fr (D6) and examiner.com (D7), both are big sites. The difference is just striking ;)
    – tostinni
    Dec 2 '11 at 2:02
  • That difference is not set in stone; you could have a Drupal 6 site with a jQuery.extend() section bigger than the one of a Drupal 7 site. It depends also from the number of third-party modules used from both the sites, and which modules those are.
    – apaderno
    Dec 3 '11 at 13:19
2

A Plugin for firefox, named "Wappalyzer", tells you what CMS a site is using. In my opinion the plugin works really good. According to this post on drupal.org there exists a similar plugin for Chrome as well, named chrome sniffer

0

I am always use Wappalyzer to detect the technology of website,The Wappalyzer website also is based on Drupal 7.

Wappalyzer is a browser extension that uncovers the technologies used on websites. It detects content management systems, eCommerce platforms, web servers, JavaScript frameworks, analytics tools and many more.

0

You can find the version information at CHANGELOG.txt file in Drupal folder.

All you need to do is display this file.

1
  • 1
    I hate to break it to you, but someone beat you to this answer by about 6 years ;-) Welcome to Drupal Answers though. Keep asking and answering! Jan 22 '18 at 21:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.