Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
0
Help us understand the problem. What is going on with this article?
@ayaoriko

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

More than 1 year has passed since last update.

機能自体を削除するのは難しいらしいので、
メニューからダッシュボードの項目を削除をし、
ログイン時の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');

参考

ログイン後にダッシュボードには移動せずに、他ページヘリダイレクトさせる方法

0
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ayaoriko
9割コーダーのWEBデザイナーです。Vue.jsの習得をめざしています。

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
0
Help us understand the problem. What is going on with this article?