---
description: https://developer.wordpress.org/reference/functions/wp_add_dashboard_widget/
---

# How to Customize the WordPress Admin Dashboard Without a Plugin (ok)

### Ex 1

```
/**
 * Add a new dashboard widget.
 */
function wpdocs_add_dashboard_widgets() {
	wp_add_dashboard_widget( 'dashboard_widget', 'Example Dashboard Widget', 'dashboard_widget_function' );
}
add_action( 'wp_dashboard_setup', 'wpdocs_add_dashboard_widgets' );

/**
 * Output the contents of the dashboard widget
 */
function dashboard_widget_function( $post, $callback_args ) {
	esc_html_e( "Hello World, this is my first Dashboard Widget!", "textdomain" );
}
```

<figure><img src="https://1113999984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M84NwP_L_qEsBHOa2xo%2Fuploads%2Fccmm6Wp4I6YfyeaZXdFk%2Fimage.png?alt=media&#x26;token=fdc6bc22-968d-46b8-a56f-bf9be911ab34" alt=""><figcaption></figcaption></figure>

### Ex 2

{% embed url="https://lpagery.io/tutorial/how-to-customize-the-wordpress-admin-dashboard-in-2023/" %}

## How to Customize the WordPress Admin Dashboard Without a Plugin – 2023

* [May 31, 2023](https://lpagery.io/2023/05/31/)

Hey, WordPress enthusiasts! Are you tired of the same old, same old when you log into your website’s admin dashboard? Do you want a custom look that’s all your own? Well, you’ve come to the right place. Today we’re going to learn how to customize the WordPress admin dashboard. Put on your coding hats, and let’s dive in!

### Step 1: Understand the Admin Dashboard

The WordPress Admin Dashboard is the first screen you see when you log into the administration area of your website. It gives an overview of your site’s content and displays several widgets such as ‘At a Glance’, ‘Activity’, ‘Quick Draft’, etc.

### Step 2: Create a Function to Customize Dashboard Widgets

We’ll begin by creating a function to remove some of these default widgets. Let’s say you want to remove the ‘Quick Draft’ widget.

Add the following function to your theme’s `functions.php` file:

```php
function remove_dashboard_widgets() {
    global $wp_meta_boxes;
    unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']);
}
add_action('wp_dashboard_setup', 'remove_dashboard_widgets' );
```

Copy

This function removes the ‘Quick Draft’ widget from the dashboard. You can repeat this code for each widget you wish to remove.

### Step 3: Add Your Own Dashboard Widgets

Now, let’s create a custom widget to display on your dashboard.

Add this function to your `functions.php` file:

```php
function add_custom_dashboard_widget() {
    wp_add_dashboard_widget('custom_dashboard_widget', 'My Custom Dashboard Widget', 'custom_dashboard_widget_content');
}
add_action('wp_dashboard_setup', 'add_custom_dashboard_widget');

function custom_dashboard_widget_content() {
    echo 'Hello, this is my custom dashboard widget!';
}
```

Copy

This will add a new widget titled “My Custom Dashboard Widget” to your admin dashboard, which simply displays the message “Hello, this is my custom dashboard widget!”. You can modify the widget content to display anything you want.

### Step 4: Customize the Admin Footer

Now let’s do something about that footer text.

You can modify the admin footer text by adding this function to your `functions.php` file:

```php
function custom_admin_footer() {
    echo 'Built with love by Your Name';
}
add_filter('admin_footer_text', 'custom_admin_footer');
```

Copy

Replace ‘Your Name’ with your actual name, and voila! Your admin footer text is now personalized.

### Step 5: Style the Admin Dashboard

Lastly, let’s add some custom CSS to change the look of the dashboard.

Add this function to your `functions.php` file:

```php
function custom_admin_css() {
    echo '<style>
        body {background-color: #f1f1f1;}
        h1 {color: #0073aa;}
    </style>';
}
add_action('admin_head', 'custom_admin_css');
```

Copy

This will change the background color of the dashboard and the color of the H1 tags. You can add your own styles as per your needs.

Let’s look at all the code together:

```php
// functions.php

function remove_dashboard_widgets() {
    global $wp_meta_boxes;
    unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']);
}
add_action('wp_dashboard_setup', 'remove_dashboard_widgets' );

function add_custom_dashboard_widget() {
    wp_add_dashboard_widget('custom_dashboard_widget', 'My Custom Dashboard Widget', 'custom_dashboard_widget_content');
}
add_action('wp_dashboard_setup', 'add_custom_dashboard_widget');

function custom_dashboard_widget_content() {
    echo 'Hello, this is my custom dashboard widget!';
}

function custom_admin_footer() {
    echo 'Built with love by Your Name';
}
add_filter('admin_footer_text', 'custom_admin_footer');

function custom_admin_css() {
    echo '<style>
        body {background-color: #f1f1f1;}
        h1 {color: #0073aa;}
    </style>';
}
add_action('admin_head', 'custom_admin_css');
```

Copy

And there you have it! Your very own, custom WordPress admin dashboard. From widgets to footers to styles, you’re now a master of the WordPress admin. Keep tinkering, keep learning, and happy coding! 🚀
