Remove wp_generator the "correct" way


/ Published in: PHP
Save to your folder(s)

Place in your theme's functions.php file. This removes the generator altogether, not just the version....making it more secure than simply removing the filter...


Copy this code and paste it in your HTML
  1. // Remove Generator Completely
  2.  
  3. function remove_wp_generator() {
  4. return '';
  5. }
  6. add_filter('the_generator', 'remove_wp_generator');
  7.  
  8. // if you want your own text to appear rather than removing it...do this:
  9. function my_custom_generator() {
  10. return 'This is my custom text';
  11. }
  12. add_filter('the_generator', 'my_custom_generator');

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.