A lightweight, single-function WordPress plugin that allows you to hide parent and child admin menus on a per-user basis, with automatic direct URL access blocking.
ユーザーごとに管理画面の親・子メニューを個別に非表示にし、URLの直打ち(強制アクセス)も自動でブロックする軽量・単一機能のWordPressプラグインです。クライアントワークや複数ユーザーでの運用時に、不要なメニューをサクッと隠して管理画面をスリム化・安全化します。
- Per-User Configuration: Select any user via a dropdown menu and customize their visible admin panel layout individually.
- Dynamic Menu Detection: Automatically scans all registered menus—including those generated by third-party plugins—by utilizing a late-priority hook execution.
- Granular Control (Parent/Child): Hide entire main menus or isolate specific sub-menus (e.g., allow post editing but hide category management).
- Hard Access Control: Automatically intercepts unauthorized direct URL entries to hidden menus and triggers a 403 Access Denied error.
- Ultra-Lightweight: Built as a pure, single-file plugin with zero external library bloat and optimal performance.
- ユーザー個別のメニュー設定: ドロップダウンからユーザーを選択し、それぞれのユーザー専用の非表示メニューを個別にカスタマイズ可能。
- 他プラグインのメニュー自動検出: 優先度を極限まで下げてメニューを取得するため、サードパーティ製プラグインが生成した独自のメニューも自動で検出して一覧化。
- 親・子メニューの細かな制御: メニュー全体を隠すだけでなく、「投稿は許可するが、カテゴリー編集(子メニュー)だけを隠す」といった柔軟な制御に対応。
- URL直打ちの強力なブロック: メニューから非表示にするだけでなく、URLを直接入力してアクセスしようとした場合も自動的に検知して403(Access Denied)でシャットアウト。
- 超軽量・単一機能: 外部ライブラリを一切使用せず、わずか1ファイルで完結する質実剛健でクリーンな設計。
- Interactive target user switcher / 設定対象ユーザーのシームレスな切り替え
- Dynamic multi-user setting retention / 別ユーザーの設定を壊さない安全なデータ保持構造
- Self-hiding prevention / 自分自身のプラグイン設定画面を隠して迷子になるのを防ぐセーフティ設計
remove_menu_page&remove_submenu_pageintegration / コア関数に準拠したクリーンなメニュー削除admin_page_access_deniedhook redirection / 権限エラーフックを捉えたスマートな403強制終了
- Upload the plugin folder to your
/wp-content/plugins/directory. (wp-content/plugins/ディレクトリにプラグインフォルダをアップロードします) - Activate the plugin through the 'Plugins' menu in WordPress. (管理画面の「プラグイン」メニューから有効化してください)
- Navigate to Settings > Admin Menu Ghost in your WordPress dashboard. (管理画面の「設定 > Admin Menu Ghost」へ移動します)
- Select a target user from the dropdown, check the menus you want to hide, and click "Save". (ドロップダウンから対象ユーザーを選択し、隠したいメニューにチェックを入れて保存します)
add_action( 'admin_menu', ..., 9999 );
Ensures compatibility with WooCommerce, Contact Form 7, and other heavy plugins by running after all standard menus have been registered.
- Direct file access prevention (
ABSPATHcheck) - Capabilities enforcement (
manage_optionsrequired for the settings page) - Non-destructive option updates using hidden input fields for inactive user data
- Role-based configuration (Apply settings to 'Editor' or 'Author' roles at once)
- Safe-mode override link via emergency bypass parameter
- Export/Import settings for easier staging-to-production deployment
- Author: masato shibuya (Image-box Co., Ltd.)
- GitHub: https://github.com/ms13th-cyber/
- License: MIT License