How to Remove Easy Digital Downloads Sales Summary Widget from Your WordPress Dashboard

Home » Snippets » How to Remove Easy Digital Downloads Sales Summary Widget from Your WordPress Dashboard
0

Created with:

Visibility: 

public

Creator: WPTurbo Team

Customize with WPTurbo AI
X

Add Snippet To Project

New Project
Add To Existing Project

Is the Sales Summary dashboard widget from Easy Digital Downloads cluttering your WordPress interface? Many users find this widget unnecessary, particularly if they’re not regularly monitoring their digital product sales. Fortunately, removal is a relatively straightforward process. In this article, we’ll guide you step-by-step on how to remove the Easy Digital Downloads Sales Summary widget, streamlining your dashboard for a more efficient WordPress experience.

					function wpturbo_remove_edd_dashboard_widget() {
   remove_meta_box('edd_dashboard_sales', 'dashboard', 'core');
}

add_action('wp_dashboard_setup', 'wpturbo_remove_edd_dashboard_widget' );
				

In the provided code snippet, we aim to remove the "Sales Summary" widget, which is automatically added to the Dashboard by the Easy Digital Downloads (EDD) plugin in WordPress.

Firstly, we define a function named wpturbo_remove_edd_dashboard_widget(). This is the function responsible for the removal of the widget.

Within this function, we call the remove_meta_box() function, a built-in WordPress function specifically designed to remove meta boxes (In WordPress, widgets inside the dashboard are known as meta boxes).

The remove_meta_box() function takes three parameters:

  1. Id of the meta box: In this case it’s edd_dashboard_sales. This is the default Id assigned to the "Sales Summary" widget by the EDD plugin.
  2. Screen: This is where the meta box is displayed. Here it’s set to dashboard which means the widget is located in the WordPress dashboard.
  3. Context: This is the area of the page where the meta box should be shown (‘normal’, ‘advanced’, or ‘side’). In our case, it is in the core context of the dashboard.

So, the function call remove_meta_box('edd_dashboard_sales', 'dashboard', 'core'); tells WordPress to remove the "Sales Summary" widget (which has an Id of edd_dashboard_sales) from the dashboard.

Lastly, we make use of the WordPress action hook wp_dashboard_setup using the add_action() function. wp_dashboard_setup is an action hook that fires after all default WordPress dashboard widgets have been registered. This hook is commonly used to add, remove, or reorder dashboard widgets. By adding our custom function wpturbo_remove_edd_dashboard_widget() to this hook, we are ensuring that our function executes when the dashboard widgets are being set up, effectively removing the EDD Sales Summary widget from the dashboard.

Register an account to save your snippets or go Pro to get more features.