Where can we find the_generator or get_the_generator Function in WordPress?

I saw on the internet that hiding the version of wordpress that we are using for our sites is good for the security. That is why I have made few changes in all my WordPress based sites: these changes were the removal of version information from all pages.

Anyway, for this reason, I needed to find the the_generator function. I had checked files like functions.php etc but had no luck in finding this function.

After searching quite few files, I finally found this function.

In “wp-includes” directory: search for this file:

general-templates.php

Open this file and scroll down till the end. Here you can see both these functions:

the_generator

and

get_the_generator

If you are also trying to remove the version information from your WordPress blogs like me, then you will have to make small changes in “get_the_generator” function.

Update: You can use a plugin to hide Version info: but it will not hide the version info from RSS and other areas.

  1. WordPress Plugin: Send an Email Notification ONLY IF Someone Replies to My Comment
  2. WordPress: How to remove Elements from the Head Section: Via Editing the Core Files?
  3. How to Remove CleverPlugins Advertisement/News from WordPress Dashboard
  4. WordPress: Cannot get rid of All
  5. WordPress: How to remove the Index, Start, Next, Prev Link Elements

*