I found this thread whilst searching for a way to completely remove widgets for certain pages.
I ended up creating a workaround on my own. It’s probably not a very good one, but it worked for what I wanted to do (remove all of the widgets for two special pages on the website)
I don’t claim to know what I am doing when it comes to PHP so take my workaround with a grain of salt.
I deleted most of the sidebar.php file and placed this:
<div id="l_sidebar">
<ul class="sidebar_list">
<?php if (is_page(array('drapes','upholstery')))echo "<div style='height: 1800px; background-color:#69ABE4;'> </div>";
elseif (!function_exists('dynamic_sidebar') || !dynamic_sidebar(1)) ; ?>
</ul>
</div>
so,
<?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar(1)) : ?>
becomes:
<?php if (is_page(array('drapes','upholstery')))echo "<div style='height: 1800px; background-color:#69ABE4;'> </div>";
elseif (!function_exists('dynamic_sidebar') || !dynamic_sidebar(1)) ; ?>
This,
(is_page(array('drapes','upholstery')
, is a conditional tag
and the pages (drapes, and upholstery) are the ones that I don’t want widgets on.