iwantcoding.com
🔥 Daily 👥 Rooms 🏆 Top Log in Sign up

Admin Dashboard

The WP dashboard is your operational view: Updates, Site Health, Activity, Quick Draft, and the screen options that let you tame what shows.

WordPress — the dashboard

EXAMPLE
<?php
// The dashboard sits at /wp-admin/. Capability required: 'read'.
// Each user role gets a different default; admins see the most.

// ===== The widgets you will actually use =====
// 1. At a Glance  -- counts of posts, pages, comments; theme + version
// 2. Activity     -- scheduled posts, recent posts, recent comments
// 3. Quick Draft  -- jot a post draft without leaving home
// 4. WordPress Events and News (often the first widget teams hide)
// 5. Site Health Status (linked to Tools -> Site Health)

// ===== Customising the dashboard for your team =====
// Hide widgets you do not want shown:
add_action('wp_dashboard_setup', function () {
    remove_meta_box('dashboard_primary',          'dashboard', 'side');   // WP news
    remove_meta_box('dashboard_quick_press',      'dashboard', 'side');   // Quick draft
    remove_meta_box('dashboard_site_health',      'dashboard', 'normal'); // (keep if your team cares)
});

// Add a custom widget (e.g. deploys, on-call link):
add_action('wp_dashboard_setup', function () {
    wp_add_dashboard_widget(
        'team_links',
        'Team links',
        function () {
            echo '<ul>';
            echo '<li><a href="https://oncall.example.com">On-call rotation</a></li>';
            echo '<li><a href="https://status.example.com">Status page</a></li>';
            echo '</ul>';
        }
    );
});

// Show the widget only to admins:
add_action('wp_dashboard_setup', function () {
    if (!current_user_can('manage_options')) {
        remove_meta_box('team_links', 'dashboard', 'normal');
    }
});

// ===== Screen Options (top right on every admin screen) =====
// Lets the user toggle visibility of columns / widgets, set rows-per-page.
// Per-user; stored in user_meta.

// ===== Admin colour scheme (per user) =====
// Users -> Your Profile -> Admin Color Scheme
// Force a single scheme:
add_filter('get_user_option_admin_color', fn() => 'midnight');

// ===== Custom dashboard greeting (for clients) =====
add_action('admin_notices', function () {
    if (!is_admin() || get_current_screen()->id !== 'dashboard') return;
    echo '<div class="notice notice-info"><p>Need help? Contact ops@example.com.</p></div>';
});

// ===== Site Health (Tools -> Site Health) =====
// Important checks WP runs by itself:
// - PHP version current?
// - HTTPS configured?
// - WP / theme / plugin updates available?
// - Background updates working?
// - Persistent object cache present?
// Resolve red items before they bite during high traffic.

// ===== Multisite note =====
// Network admins get an extra dashboard at /wp-admin/network/.
// Site admins see their per-site dashboard.

// ===== Patterns to internalise =====
// - Tailor the dashboard for the role using it; clients don't need WP news
// - Add team-specific widgets (status page, deploy badge) once; it pays back daily
// - Force a colour scheme in a managed environment so 'broken' is recognisable

// ===== Pitfalls =====
// - Hiding the Site Health widget without monitoring it elsewhere -> incidents go unnoticed
// - Custom dashboard widgets that hit the DB on every load -> slow admin
// - Admin notices that scream on every screen -> users dismiss real ones
// - Forgetting capability checks when adding widgets -> non-admins see admin links

Why it matters

The dashboard is your daily landing pad. Tame the noise, surface what your team actually needs (deploys, on-call, status), and check Site Health weekly. Tiny config tweaks here save more support tickets than any big plugin.

Tip: Tweak the snippet with Try it Yourself », then sit the quiz at the bottom of the page.

Example

Example
// /wp-admin — the editorial control panel.
// Posts, Pages, Media, Plugins, Themes, Users, Settings.
Try it Yourself »

Discussion

Loading…