unregister_widget( string $widget_class )

Unregisters a widget.

Description Description

Unregisters a WP_Widget widget. Useful for un-registering default widgets. Run within a function hooked to the ‘widgets_init’ action.

Parameters Parameters


(string) (Required) The name of a class that extends WP_Widget.

Top ↑

Source Source

File: wp-includes/widgets.php

function unregister_widget($widget_class) {
	global $wp_widget_factory;


Top ↑

Changelog Changelog

Version Description
2.8.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

  1. Skip to note content
    Contributed by Julie @Niackery

    Available parameters (from the Codex):

    WP_Widget_Pages = Pages Widget
    WP_Widget_Calendar = Calendar Widget
    WP_Widget_Archives = Archives Widget
    WP_Widget_Links = Links Widget
    WP_Widget_Meta = Meta Widget
    WP_Widget_Search = Search Widget
    WP_Widget_Text = Text Widget
    WP_Widget_Categories = Categories Widget
    WP_Widget_Recent_Posts = Recent Posts Widget
    WP_Widget_Recent_Comments = Recent Comments Widget
    WP_Widget_RSS = RSS Widget
    WP_Widget_Tag_Cloud = Tag Cloud Widget
    WP_Nav_Menu_Widget = Menus Widget

You must log in before being able to contribute a note or feedback.