WordPress の関数で「 wp_generator 」は、ヘッダーに現在使用している、WordPress のバージョンを、この様なメタタグで表示します。
<!DOCTYPE html>
<html lang="ja">
<head>
<meta name="generator" content="WordPress 4.8.xx" />
</head>
ページコンテンツ
関数 wp_generator()
wp_generator()は、wp_headフックで生成されたXHTMLジェネレータを表示します。

WordPressのバージョン番号 wp_generator
| 3611 | /** |
|---|---|
| 3612 | * Displays the XHTML generator that is generated on the wp_head hook. |
| 3613 | * |
| 3614 | * See {@see 'wp_head'}. |
| 3615 | * |
| 3616 | * @since 2.5.0 |
| 3617 | */ |
| 3618 | function wp_generator() { |
| 3619 | /** |
| 3620 | * Filters the output of the XHTML generator tag. |
| 3621 | * |
| 3622 | * @since 2.5.0 |
| 3623 | * |
| 3624 | * @param string $generator_type The XHTML generator. |
| 3625 | */ |
| 3626 | the_generator( apply_filters( 'wp_generator_type', 'xhtml' ) ); |
| 3627 | } |
実例・使い方
テーマのfunctions.phpまたは、プラグインのPHPファイルに以下を追加してください
現在使用中のWordPressのバージョン番号を表示する方法
Template Files
<p>WordPress <?php bloginfo('version'); ?></p>
<!--出力されるHTMLコード-->
<p>WordPress 4.8</p>
WordPressのバージョン番号を削除したい場合があります。このコードスニペットを関数ファイルに追加するだけです。
Template Files
function wpm_remove_version() {
return '';
}
add_filter('the_generator', 'wpm_remove_version');
//又は
remove_action('wp_head', 'wp_generator');
