When you log into your WordPress admin area, by default you’re greeted by a Welcome Panel on the dashboard. This panel has shortcuts to some of the most common tasks you would perform on your site. However, for many seasoned WordPress users or developers, this panel may be unnecessary or redundant.
This code snippet allows you to remove the Welcome Panel from your WordPress dashboard, simplifying the interface and reducing clutter. It’s a straightforward use of WordPress’s hook system.
The add_action
function is used to add a function to the ‘admin_init’ hook, which is triggered when the admin area is loaded. This function simply uses the remove_action
function to remove the ‘wp_welcome_panel’ function from the ‘welcome_panel’ hook, effectively hiding the Welcome Panel from your dashboard.
There is no customization necessary for this snippet, as it’s designed to simply remove the Welcome Panel. However, remember to use it wisely, as new or inexperienced users may find the Welcome Panel helpful.
add_action(
'admin_init',
function () {
remove_action( 'welcome_panel', 'wp_welcome_panel' );
}
);