Remove/Add widgets from/to the Available Widgets pool

You can use the function unregister_widget to remove widgets. E.g. you can remove the Calendar widget with: function my_widgets_init() { unregister_widget( ‘WP_Widget_Calendar’ ); } add_action(‘widgets_init’, ‘my_widgets_init’); To add widgets, use the Widgets API.

Remove the widgets tab from theme customizer

you can create function for theme customizer with all the settings you need: to remove “widgets” we will need to remove the “widgets” panel. put this code in function.php function your_customizer( $wp_customize ) { $wp_customize->remove_panel( ‘widgets’ ); } add_action( ‘customize_register’, ‘your_customizer’ ); or if you have your own function just add: $wp_customize->remove_panel( ‘widgets’ );

Style every second widget?

Use the dynamic_sidebar_params filter. The following code adds classes to say whether the widget is odd or even, what index it is in the sidebar, and what sidebar it’s in. Note: the str_replace(“class=\””, “class=\”$class “, $before_widget); code below depends on your before_widget using double quotes — it probably should be done with a regular expression … Read more

Replace dashboard widgets with banner ad

Check this reference http://www.wpbeginner.com/wp-themes/how-to-add-custom-dashboard-widgets-in-wordpress/ for adding dashboard widget Remove Widgets in Dashboard for removing dashboard widget add_action(‘wp_dashboard_setup’, ‘example_remove_dashboard_widgets’ ); function example_remove_dashboard_widgets() { remove_meta_box( ‘dashboard_quick_press’, ‘dashboard’, ‘side’ ); remove_meta_box( ‘dashboard_recent_drafts’, ‘dashboard’, ‘side’ ); remove_meta_box( ‘dashboard_primary’, ‘dashboard’, ‘side’ ); remove_meta_box( ‘dashboard_secondary’, ‘dashboard’, ‘side’ ); remove_meta_box( ‘dashboard_browser_nag’, ‘dashboard’, ‘normal’ ); remove_meta_box( ‘dashboard_right_now’, ‘dashboard’, ‘normal’ ); remove_meta_box( ‘dashboard_recent_comments’, ‘dashboard’, … Read more