Can I remove a widget area without editing code?

No, is not possible, not in 99% of cases. Widget areas are added with a register_sidebar call in a php file. Until WordPress read that line, the widget area is registered. So, the the easiest and always available way to prevent a widget area is registered is remove (or at least comment out) that line. … Read more

Remove/Unregister or hide a widget added by a plugin

Thanks Stephen for helping me wrap my head around this today. Even though it’s something so small, I absolutely hate when develpers bloat plugins with crap you don’t want. I was very frustrated after WPengine, telling me it can’t be removed and that if I really want to remove it than I need to find … Read more

Too few arguments to function WP_Widget::__construct(),

You’re using an extremely outdated method of creating a widget. You should be using the __construct() function, not a named function, as the constructor, as documented. namespace App; class My_Widget extends \WP_Widget { function __construct() { $widget_ops = [ ‘name’ => ‘My widget’, ‘description’ => ‘My description’ ]; parent::__construct( ‘My_Widget’, ‘My widget’, $widget_ops ); } … Read more

Dynamic Sidebars On Multiple Subpages

More easy & elegant (higher maintainability): <?php // Your sidebar should have the wp_meta action hook wp_meta(); // in ex. your functions.php function my_sidebar_content() { // “About” Page if ( is_page(‘about’) ) { // If some widget is added via Admin > Design > Widgets if ( is_active_sidebar( ‘widgets-sidebar-default’ ) ) { // Display Widgets … Read more

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’ );