Home  >  Article  >  CMS Tutorial  >  How to remove WordPress suffix in backend title

How to remove WordPress suffix in backend title

藏色散人
藏色散人forward
2019-11-19 14:37:212455browse

The following column WordPress Tutorial will introduce to you how to delete the WordPress suffix in the background title. I hope it will be helpful to friends in need!

How to remove WordPress suffix in backend title

The WordPress background title (title) default suffix is ​​displayed - WordPress. If you want to hide this suffix, you can add the following code to the current theme functions.php to delete it. Suffix:

Remove "- WordPress" in the background title

// 去除后台标题中的“—— WordPress”
add_filter('admin_title', 'zm_custom_admin_title', 10, 2);
function zm_custom_admin_title($admin_title, $title){
    return $title.' ‹ '.get_bloginfo('name');
}

Remove "- WordPress" in the login title

// 隐藏后台标题中的“WordPress”
add_filter('login_title', 'zm_custom_login_title', 10, 2);
    function zm_custom_login_title($login_title, $title){
        return $title.' ‹ '.get_bloginfo('name');
}

Attachment: Hide other background information that are obviously related to WordPress Words and icons

Hide the WordPress logo in the upper left corner of the backend

// 隐藏左上角WordPress标志
function hidden_admin_bar_remove() {
    global $wp_admin_bar;
        $wp_admin_bar->remove_menu('wp-logo');
}
add_action('wp_before_admin_bar_render', 'hidden_admin_bar_remove', 0);

Shield the backend footer WordPress version information

// 屏蔽后台页脚WordPress版本信息
function change_footer_admin () {return '';}
add_filter('admin_footer_text', 'change_footer_admin', 9999);
function change_footer_version() {return '';}
add_filter( 'update_footer', 'change_footer_version', 9999);

Remove items in the WordPress dashboard

function remove_dashboard_meta() {
    remove_meta_box( 'dashboard_incoming_links', 'dashboard', 'normal' );
    remove_meta_box( 'dashboard_plugins', 'dashboard', 'normal' );
    remove_meta_box( 'dashboard_primary', 'dashboard', 'side' );
    remove_meta_box( 'dashboard_secondary', 'dashboard', 'normal' );
    remove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' );
    remove_meta_box( 'dashboard_recent_drafts', 'dashboard', 'side' );
    remove_meta_box( 'dashboard_recent_comments', 'dashboard', 'normal' );
    remove_meta_box( 'dashboard_right_now', 'dashboard', 'normal' );
    remove_meta_box( 'dashboard_activity', 'dashboard', 'normal');//since 3.8
}
add_action( 'admin_init', 'remove_dashboard_meta' );

The above is the detailed content of How to remove WordPress suffix in backend title. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:zmingcx.com. If there is any infringement, please contact admin@php.cn delete