How to Customize the WordPress Admin Dashboard

wordpress 4001 Comments

WordPress is one of the best CMSs in its class. It has plenty of handy functionalities and features that make site administration an easy job.

WordPress is a publishing platform with a GUI for creating, editing and managing pages and posts, a comment system, user roles and permissions, handy built-in tools like the "Export" feature to back up your content, and much more.

But how much of the above mentioned features do we really use?

Though, using WordPress is an easy task by default, we might want to tailor the WordPress Admin interface to make it manageable and simpler for its users.

Why Customizing the WordPress Admin Interface is an Essential Task?

Recently, WordPress has reached phenomenally high usage rates with 27% of the total websites on Internet using it as their platform. There are more than twenty-five million publishers who use WordPress, making it a famous publishing platform.

It means that its use in how to make a blog has been extended outside to other types of sites like business sites, portfolios, image galleries, and eCommerce sites.

How to Customize the WordPress Website's Admin Dashboard

But there is a catch to all of that. WordPress offers way more features than what a regular WordPress user would need.

For instance, the "comments" panel. Everyone doesn't need all the moderation privileges it offers. Some websites might not even require commenting capabilities on their posts.

Let's consider a static informational website. The website wouldn't need people to comment on its static pages like their Contact Us or About page.

You can also look at the default WordPress dashboard, which is filled with a lot of features.

For professionals and tech-savvy folks, it's fantastic. But what would an ordinary person feel about it?

He/she won't understand half of the things explained in it. They wouldn't even want to get into the details.

Instead, they just want their post to get published or maybe, editor maybe, deletes it.

The Solution

WordPress is a giant platform, and it surely does have solutions to these little pricks. Luckily, for this issue, the solution is called Hooks knew as "Actions" and "Filters" .

With this, we can "hook" into the WordPress core without changing its files so that we can securely make modifications without settling on the integrity of the installation.

Let's help you removing the functions that you no longer need on your website by using different filters and actions. Also, we'll make some basic changes.

Disable Dashboard Widgets

What's the foremost thing people see when logging into the Admin area? The dashboard!

You can find widgets like "Other WordPress News," "WordPress Blog," and "Incoming Links", which is not interesting for the ordinary users.

We'll use the wp_dashboard_setup "action" to remove all of the above surplus features. We'll use the unset() "function" to remove the Dashboard widgets that we do not want to display.

After this, all we need to do is call add_action() using 'wp_dashboard_setup' as the first parameter. Also, we'll use our function named remove_dashboard_widgets as the second parameter.

The coding:

function remove_dashboard_widgets() {
	global $wp_meta_boxes;

	unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']);
	unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']);
	unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']);
	unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']);
	unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']);
	unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']);
}

add_action('wp_dashboard_setup', 'remove_dashboard_widgets' );

Disable Standard Widgets

WordPress comes with twelve standard widgets. Some of these default widgets include Search (WP_Widget_Search), Calendar (WP_Widget_Calendar) and Recent Comments (WP_Widget_Recent_Comments).

You probably want to disable the widgets not required for your WordPress installation to declutter and simplify your publishing platform.

For instance, you might not need the calendar, or the third-party search service such as Google Custom Search .

For this, we'll use widgets_init action and function as remove_some_wp_widgets. In our function, we'll use WordPress's unregister_widget() using the names of the widgets we don't want to prefer as the parameter.

Now, we'll call add_action. You'll see the third parameter in this code snippet as ('1'), which is the priority of the action. The default priority is 10.

It means if you don't pass a value for this optional parameter, it will take the default value as 10.

The lower the number, the higher is the priority. Therefore at 1, this is one of the top priority functions that will be called first in functions.php, irrespective of its position.

function remove_some_wp_widgets(){
  unregister_widget('WP_Widget_Calendar');
  unregister_widget('WP_Widget_Search');
  unregister_widget('WP_Widget_Recent_Comments');
}

add_action('widgets_init',remove_some_wp_widgets', 1);

WordPress's Functions.php

Open up functions.php in your WordPress theme's directory. It is a file where all of the codes are put in.

In case you don't have one installed, you can create one using the text editor. WordPress automatically checks this file, allowing you to tailor everything before it's furnished on the screen.

Apply the following code:

<php
function testing() {
  echo 'Hi Everyone!';
}

add_action( 'admin_head', 'testing' ); 
?>

The above code should print 'Hi Everyone!' To hook into WordPress core, we use the add_action() function and pass in two parameters. The first one is the name of the action we want to hook into ('admin_head'), and the other is the name of the function you want to run ('testing').

Note: This code will only affect the admin area and remove this code from your functions.php file.

Removing Menu Items

To simplify the interface, you may want to remove some of the menu items.

Using the below code, you can disable items such as "Media," "Posts," "Appearance," and "Tools":

function remove_menu_items() {
  global $menu;
  $restricted = array(__('Links'), __('Comments'), __('Media'),
  __('Plugins'), __('Tools'), __('Users'));
  end ($menu);
  while (prev($menu)){
    $value = explode(' ',$menu[key($menu)][0]);
    if(in_array($value[0] != NULL?$value[0]:"" , $restricted)){
      unset($menu[key($menu)]);}
    }
  }

add_action('admin_menu', 'remove_menu_items');

Remove Items From the Page and Post Columns

Often, WordPress's Admin area has tables to give you an overview of a listing of your content. To delete columns from these kinds of views, you can do following:

We'll use the add_filter() function of WordPress to add a filter rather an action. When filter finds out something that we want to change or delete, it executes the filter first before furnishing the data on your page.

For instance, if we want to delete the comments count from the posts and pages, we can use following code:

function custom_post_columns($defaults) {
  unset($defaults['comments']);
  return $defaults;
}

add_filter('manage_posts_columns', 'custom_post_columns');

function custom_pages_columns($defaults) {
  unset($defaults['comments']);
  return $defaults;
}

add_filter('manage_pages_columns', 'custom_pages_columns');

End-Note

Well, these were only a few snippets of codes that you can use to customize the Admin area's features to make things easier and simpler for you.

Now, as WordPress is a huge platform, there must be a lot other ways by which you are currently customizing your website's Admin area.

Do let us know in the comment section about the methods you use to tailor the admin area of your WordPress website.

elegant themes banner

Related Articles:

You may be interested in:

Catherrine Garcia is a web development expert who works for HostingFacts.com. She is also an enthusiast blogger who loves to share her knowledge with other bloggers.

Would you like to contribute to this site? Get started ยป
Rate this article:
(5.0 rating from 2 votes)

Comments