How to remove deprecated widgets from the Genesis Framework

The latest version of Genesis has deprecated two widgets, but they still annoyingly show up in the widgets panel even if you’re not using them. Thankfully it’s easy to remove them using WordPress’s unregister_widget function. Just place the following code in your functions.php:

add_action ('widgets_init', 'emw_remove_deprecated_widgets', 15);

function emw_remove_deprecated_widgets() {
	unregister_widget ('Genesis_Widget_Menu_Categories');
	unregister_widget ('Genesis_Menu_Pages_Widget');