0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Wordpressのダッシュボードを徹底的に削除する

Posted at

機能自体を削除するのは難しいらしいので、
メニューからダッシュボードの項目を削除をし、
ログイン時のURLを変えるといいらしい

functions.php
/*
 *  管理画面から削除
 */
function remove_dashboard_menus()
{
    remove_menu_page('index.php');
}
add_action('admin_menu', 'remove_dashboard_menus');

function redirect_dashiboard()
{
    if ('/wp/wp-admin/index.php' == $_SERVER['SCRIPT_NAME']) {
        wp_redirect(admin_url('edit.php'));//投稿形式post以外でリダイレクトさせたい場合、URLを変える必要がある
    }
}

add_action('admin_init', 'redirect_dashiboard');

参考

[ログイン後にダッシュボードには移動せずに、他ページヘリダイレクトさせる方法]
(https://www.nxworld.net/wordpress/wp-redirect-dashiboard.html)

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?