管理画面右上のヘルプを非表示にする

WordPress 6.4.3
広告WordPress・PHP を学べる本

Amazonのアソシエイトとして、WordPress functions.phpは適格販売により収入を得ています。

概要説明

管理画面に表示されている標準のヘルプ機能を殆ど使ったことがありません。ヘルプメニューを非表示にするカスタマイズ。

管理画面右上のヘルプを非表示にする

functions.php
/*----------------------------------------------------
 管理画面右上のヘルプを非表示にする
----------------------------------------------------*/
if ( !function_exists( 'remove_contextual_help' ) ){
    function remove_contextual_help() {
        $screen = get_current_screen();
        $screen->remove_help_tabs();
    }
    add_action( 'admin_head', 'remove_contextual_help' );
}
管理画面右上のヘルプを非表示にする

WordPress 3.3 以降は非推奨の記述

functions.php
/*----------------------------------------------------
 管理画面右上のヘルプを非表示にする ( 非推奨 )
----------------------------------------------------*/
add_filter('contextual_help', function($old_help, $id, $screen) {
    $screen->remove_help_tabs();
    $screen->set_help_sidebar('');
    return false;
}, 900, 3);

Deprecated: フック contextual_help は、バージョン 3.3.0 から非推奨になりました ! 代わりに get_current_screen()->add_help_tab(), get_current_screen()->remove_help_tab() を使用してください。

Deprecated: contextual_help is deprecated since version 3.3.0! Use get_current_screen()->add_help_tab(), get_current_screen()->remove_help_tab() instead.

上のようなメッセージが出たら、1 つ目のコード(get_current_screen() を使う形)に替えてください。

WordPress Developer Resources

SiteBeacon(サイトビーコン)

サイトが止まったら、すぐに気づける。

ホームページを 5 分ごとにチェックして、止まったとき・エラーが出たとき・SSL やドメインの期限が近いときに、メールでお知らせします。2 サイトまでは、ずっと無料で使えます。

SiteBeacon を見る サイトを直す相談をする

監視で気づいたあとの直す作業も、同じ担当がお受けします。