In a previous question I already got clarified how exactly did <jdoc:include type=head> work. Now I have a new question about it.

Basically, any extension can add a call to new scripts, css files or tags that will be "catched" by the jdoc:include and injected in the <head> of the template.

The question is: is there a way to debug where each line loaded in the <head> by the include comes from?

For example, I had to work in a project where someone else provided a custom component with some custom modules, and I was seeing some strange stuff loaded in my <head>... so I had to inspect all view files one by one until I found which one was making the call that loaded those lines... is there a way to know where are these calls coming from? Hope it makes sense.

2 Answers 2


Not sure if this will answer your query but the first thing I would do is look here:


In terms of modules adding 'strange' stuff; well they could for instance use JFactory::getDocument()->addScript(); to add their own module JS, so I would check the module code for that.

  • Thanks for your reply. i know that, and that's actually the kind of stuff I searched. I just wondered if there was any "flag" or something like that I could add to debugging so that I could know where exactly are those calls coming from in a debug view (maybe even in core's debug). Thanks anyway. Dec 5, 2014 at 17:59

In my experience, the best way to find out which component/module/plugin causes a particular head include is to use grep on the entire joomla installation. Of course, this assumes that you know which resource URL to search for and that it shows up unobfuscated somewhere in the source code.

I needed to search for the plugin that caused font-awesome to be loaded from cloudflare's CDN, even though we already host and include a local version. To determine the culprit, I used the following command:

grep -rnw /path/to/joomla/directory -e 'cdnjs\.cloudflare\.com/ajax/libs/font-awesome'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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