Is there a way to hide just the version number, but leave the generator tag?

StackOverflow https://stackoverflow.com/questions/23319715

  •  10-07-2023
  •  | 
  •  

سؤال

Is there a way to hide the version of WordPress being used, but only the version number? Specifically, I'd prefer the tag read

<meta name="generator" content="WordPress" />

instead of

<meta name="generator" content="WordPress 3.9" />

I know of the correct way to remove it altogether, but I'd rather not do that.

هل كانت مفيدة؟

المحلول

Why not use the correct way to remove it altogether and then add a new generator tag?

remove_action('wp_head', 'wp_generator');
add_action('wp_head', 'my_wp_generator');
function my_wp_generator() {
    echo '<meta name="generator" content="WordPress" />';
}
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top