When creating a user based wordpress website, it is important to remove all the unnecessary information from the website. Although assigning capabilities does most of the job for you. Actually ‘capabilities’ is the most important part because it makes sure that users don’t access pages that they are not supposed to. But coming back to the article, we will just be hiding unnecessary documents but not stopping them to access those pages.
All the below settings can be done in your functions.php
- Remove wordpress logo from admin bar
12345// remove the wordpress logo from the toolbarfunction nzgo_remove_wp_logo( $wp_admin_bar ) {$wp_admin_bar->remove_node( 'wp-logo' );}add_action( 'admin_bar_menu', 'nzgo_remove_wp_logo', 999 );
- Edit footer that says “Thank you creating with WordPress”
123456789// Custom admin page footerfunction nzgo_edit_footer() {add_filter( 'admin_footer_text', 'nzgo_edit_text', 11 );}// Custom Text Herefunction nzgo_edit_text($content) {return "Thank you for using New Zealand Go Online";}
- Remove widgets from Dashboard
The simplest way to find id of meta box is to use ‘firebug’ kind of tool.
123456789101112function nzgo_remove_dashboard_meta() {remove_meta_box( 'dashboard_incoming_links', 'dashboard', 'normal' );remove_meta_box( 'dashboard_plugins', 'dashboard', 'normal' );remove_meta_box( 'dashboard_primary', 'dashboard', 'normal' );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');}add_action( 'admin_init', 'nzgo_remove_dashboard_meta' ); - After removing all of the widgets, you may like to add your own custom widget
123456789101112131415function nzgo_add_dashboard_widgets() {wp_add_dashboard_widget('nzgo_dashboard_widget', // Widget slug.'New Zealand Go Online', // Title.'nzgo_dashboard_widget_function' // Display function.);}add_action( 'wp_dashboard_setup', 'nzgo_add_dashboard_widgets' );/*** Create the function to output the contents of your Dashboard Widget.*/function nzgo_dashboard_widget_function() {echo "Hello there, Welcome to New Zealand Go Online Dashboard";}
- Add a menu on admin toolbar with Home Link
12345678910function nzgo_add_home_on_admin_bar() {global $wp_admin_bar;$wp_admin_bar->add_node(array('id' => 'home','title' => 'Home','href' => home_url()));}add_action( 'wp_before_admin_bar_render', 'nzgo_add_home_on_admin_bar' );
- Remove unnecessary menu items from admin panel
123456function nzgo_remove_admin_menus() {remove_menu_page ('profile.php');remove_menu_page ('upload.php');remove_menu_page ('tools.php');}add_action("admin_menu", "nzgo_remove_admin_menus");
Let me know if you are looking for any other kind of customization. I’d love to help WordPress Community.