Home > CMS Tutorial > WordPress > body text

How to remove WordPress suffix from backend title

藏色散人
Release: 2019-11-26 10:33:02
forward
2036 people have browsed it

The following column WordPress Getting Started 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 from 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 this 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');
}
Copy after login

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');
}
Copy after login

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);
Copy after login

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);
Copy after login

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' );
Copy after login

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

Related labels:
source:zmingcx.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!