Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By madeinjapan on
Using 7.0-beta3 with default setting. Want to remove following line.
<meta name="Generator" content="Drupal 7 (http://drupal.org)" />
How can I remove it?
Comments
Wow just saw that meta tag,
Wow just saw that meta tag, not sure why they are forcing users to have a generator tag. I'll be removing that for sure.
It's in includes/common.inc line 320-328
Here's what I did, not sure if it's the correct way but it worked.
removed these two lines by putting //
And then removed ['#attributes']['content'] from this line.
It's work fine.
espirates, Thanks a lot. I hope above idea will help many Drupal lovers who do not want a generator tag in Druapl 7.
I like Drupal 6 because of it's simple (clean) coding. So, I was expecting more cleaned and small sized Drupal 7. But Drupal 7 beta is very very slow in test environment (WAMP).
Here's a better way
Put inside your theme template.php, this way you don't have to mess with core files.
Thanks. I think it is a
Thanks.
I think it is a really bad idea to be listing the generator like that without an easy way to turn it off.
I will be using this code in every theme I use for D7.
Your solution works out
Using template.php solution worked out great. Thank you!
theme
template.php solution is not working with every theme!!
Their should be a easier way
Their should be a easier way to remove this generator tag... I guess somewhere in configuration menu. And you need to put inside a clean template.php - if u have just make one:
end of course this solution as is written above is not working with every theme...
(:
perfect.
You can also do it through
You can also do it through your Apache configuration. Just put this directive in your .htaccess file (or httpd.conf):
I also generally remove X-Drupal-Cache, to avoid further announcements that this is Drupal, and also X-Powered-By so that people don't look for PHP vulnerabilities. If you have access to your own php.ini file, you can do this globally by adding the setting:
expose_php = Off
If you want to get even fancier, you can hide a lot of apache information with these other options:
That will ensure that you don't broadcast your version of Apache. None of these make you super secure, but they do avoid scripts that go through headers looking for vulnerable versions of Apache, Drupal or whatever.
Besrt answer. Thanks
Best answer. Thanks
Thanks
Much appreciated.
Great Answer
This answer worked great. Thanks!
Drupal Security
@iNik, it's a really helpful post. Saves me lot of time.
Thanks
why?
Can someone share with me why it is such a bad idea to include the meta tag for generator and attribute it to Drupal?
A list of some of the Drupal sites I have designed and/or developed can be viewed at motioncity.com
A typical reason might be to
A typical reason might be to not let spambots know what cms you are using.
Another reason might be simply, because we just don't want it. I think certain things should be left up to the user to decide if they want to add or not. Personally I prefer as clean a source code as possible and don't want it.
Another item that should be removed is Drupal.settings or be changed to site.settings. Some stuff should be taken out, it's not necessary to have it there. There's so much gunk printed, very messy. I like modx cms for that reason, it keeps the code clean and also separates it from the design.
One of these days I'm going to gut it all out.
Can someone share with me why it is such a bad idea to include the meta tag for generator and attribute it to Drupal?
meta generator vor visibility
When looking for ways to remove the meta generator I came by this discussion about adding the meta generator. The developers choose not to include a setting since it would add complexity to the user interface. Since it is easy to delete the meta generator it becomes a choice for themers to delete it.
http://drupal.org/node/275092
Remove Generator META tag
There is a module. Remove Generator META tag.
http://drupal.org/project/remove_generator
Blog post
How do i remove from Blog post
I tried all the solution but not able remove from blog post when try to create new blog i see the same
"meta name="generator" content="Drupal 7 (http://drupal.org)"
Pls help..
Metatag Module
You could try the Metatag Module,
http://drupal.org/project/metatag
Leaving it blank makes the metatag dissapear.
This should also remove it from other pages.
Unset metatag_generator not system_meta_generator
I think you are looking to unset the metatag_generator based upon dpm.
This worked for me...system_meta_generator did not.
Unset 'system_meta_generator'
You can do this in the template.php a module
The example in the previous comment includes a call to dpm() which requires the devel module and will error if you don't have that enabled.
George Boobyer
www.blue-bag.com
What is the exact solution for remove generator meta tag in Drup
After removed generator meta tags, always it displays generator meta. This is only works after clear cache and also for few minutes. Then it has been showed. What is the exact solution for remove generator meta tag in Drupal?
http://www.phponwebsites.com/
Did you enabled metatag
Did you enabled metatag module? In that case you can configure it from the metatag settings page.
--
by FiNeX
FiNeX.org
Siti Web Vicenza
Exists a Module
Exists a module : http://drupal.org/project/remove_generator
Thank you
Worked great.
Drupal 8 Fix
I understand that this particular question is regarding D7, however, I searched for the same technique for D8 and came up short.
Here is the D8 way to accomplish this for those who find themselves looking for the answer to no avail.
In the "THEMENAME.theme" file of in the base of your theme put this:
Obviously change THEME to match your theme name.
* D8 may have some proper way of removing it but I'm barely 3 months into learning Drupal and only on version 8.
** Please be gentle if I've not place this in a correct place as this is my first time posting on here.
Hopefully this helps some future reader.
Metatag global settings
Come-on guys what so bad and difficult about it? It can easily be removed by the following settings, no need of any custom module or script.
Go Config > metatags > global edit > advance > Generator.
Just empty text in generator input box and the generator meta tag will completely disappear from the header, because once the string is empty the Drupal will not output the whole meta tag at all.
Use following function in
Use following function in your theme/template.php file
It will not generate
in web page.
For me 'system_meta_generator
For me 'system_meta_generator' didn't work. "metatag_generator_0" worked after I printed $head_elements in watchdog
Cheers,
TechNikh
In 30 seconds set up Automated Visual testing of your website. Zero coding. https://drupal.org/project/drulenium
Ever dreamed of styling your view, We have a solution for you. https://drupal.org/project/views_stylizer
Working As Per
Thanks all for this useful
Thanks all for this useful discussion on removing the meta generator tag.
The suggestion to also unset X-Drupal-Cache header leaves me a bit confused. Isn't this needed for drupal cache to work and for vanish to work?
use the metatag module
If you use the metatag module you can overwrite the generator metatag with whatever you want very easily, as you add in all the other metatags you'll want to maximize your SEO.
Go the the the metatag module settings to got - global metatags - advanced tags. The generator tag is there.
spritefully yours
Technical assistance provided to the Drupal community on my own time ...
Thank yous appreciated ...
Metatag Module Dosen't remove
Metatag Module Dosen't remove Generater tags for drupal 8.
must have addition ...
Surely the D8 version of the metatag module will catch up to the D7 version, eventually, just as so many other aspects of D8 are far behind the current overall status of D7.
spritefully yours
Technical assistance provided to the Drupal community on my own time ...
Thank yous appreciated ...