{"id":2698,"date":"2007-11-27T23:35:28","date_gmt":"2007-11-27T18:05:28","guid":{"rendered":"https:\/\/www.quickonlinetips.com\/archives\/2007\/11\/how-to-create-multiple-dynamic-sidebars-for-wordpress-widgets\/"},"modified":"2026-10-07T19:58:06","modified_gmt":"2026-10-07T14:28:06","slug":"how-to-create-multiple-dynamic-sidebars-for-wordpress-widgets","status":"publish","type":"post","link":"https:\/\/www.quickonlinetips.com\/archives\/2007\/11\/how-to-create-multiple-dynamic-sidebars-for-wordpress-widgets\/","title":{"rendered":"How to Create Multiple Sidebars in WordPress (Widget Areas Guide)"},"content":{"rendered":"<p>Want different widgets on different parts of your site? Learning to <strong>create multiple sidebars in WordPress<\/strong> lets you show one set of widgets on posts, another on pages, and more in the header or footer. We first wrote this tutorial in 2007, when we ran six dynamic sidebars on QuickOnlineTips, and it followed our guide on how to <a href=\"https:\/\/www.quickonlinetips.com\/archives\/2007\/11\/how-to-widget-enable-wordpress-themes-in-3-easy-steps\/\">widget-enable WordPress themes<\/a>. The core function is still <code>register_sidebar()<\/code>, but the code is cleaner today, and block themes handle it differently. Here is the 2026 version.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-63512\" src=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/multiple-sidebars-wordpress.webp\" alt=\"How to create multiple sidebars in WordPress\" width=\"1200\" height=\"630\" srcset=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/multiple-sidebars-wordpress.webp 1200w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/multiple-sidebars-wordpress-300x158.webp 300w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/multiple-sidebars-wordpress-1024x538.webp 1024w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/multiple-sidebars-wordpress-150x79.webp 150w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/multiple-sidebars-wordpress-768x403.webp 768w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/p>\n<p><strong>Quick answer:<\/strong> In a classic theme, register each widget area in your child theme&#8217;s functions.php with <code>register_sidebar()<\/code> inside a function hooked to <code>widgets_init<\/code>, giving each a unique id. Then display each one in your templates with <code>dynamic_sidebar( 'your-id' )<\/code>. Add widgets in Appearance, then Widgets. Block themes use template parts in the Site Editor instead.<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_88 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6accc4ad79539\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"ez-toc-cssicon\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #1a202c;color:#1a202c\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #1a202c;color:#1a202c\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6accc4ad79539\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2007\/11\/how-to-create-multiple-dynamic-sidebars-for-wordpress-widgets\/#Step_1_Register_multiple_sidebars\" >Step 1: Register multiple sidebars<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2007\/11\/how-to-create-multiple-dynamic-sidebars-for-wordpress-widgets\/#Step_2_Display_each_sidebar_in_your_templates\" >Step 2: Display each sidebar in your templates<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2007\/11\/how-to-create-multiple-dynamic-sidebars-for-wordpress-widgets\/#Step_3_Show_different_sidebars_on_different_pages\" >Step 3: Show different sidebars on different pages<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2007\/11\/how-to-create-multiple-dynamic-sidebars-for-wordpress-widgets\/#Step_4_Add_widgets\" >Step 4: Add widgets<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2007\/11\/how-to-create-multiple-dynamic-sidebars-for-wordpress-widgets\/#Block_themes_use_template_parts_instead\" >Block themes: use template parts instead<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2007\/11\/how-to-create-multiple-dynamic-sidebars-for-wordpress-widgets\/#Easier_options_without_code\" >Easier options without code<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2007\/11\/how-to-create-multiple-dynamic-sidebars-for-wordpress-widgets\/#Ideas_for_extra_widget_areas\" >Ideas for extra widget areas<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2007\/11\/how-to-create-multiple-dynamic-sidebars-for-wordpress-widgets\/#FAQ\" >FAQ<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2007\/11\/how-to-create-multiple-dynamic-sidebars-for-wordpress-widgets\/#How_many_sidebars_can_WordPress_have\" >How many sidebars can WordPress have?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2007\/11\/how-to-create-multiple-dynamic-sidebars-for-wordpress-widgets\/#Why_does_my_new_sidebar_not_appear\" >Why does my new sidebar not appear?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2007\/11\/how-to-create-multiple-dynamic-sidebars-for-wordpress-widgets\/#Will_theme_updates_remove_my_sidebars\" >Will theme updates remove my sidebars?<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Step_1_Register_multiple_sidebars\"><\/span>Step 1: Register multiple sidebars<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Add this to your <strong>child theme&#8217;s<\/strong> functions.php, so theme updates do not erase it:<\/p>\n<pre><code>function qot_register_sidebars() {\r\n    $common = array(\r\n        'before_widget' =&gt; '&lt;section id=\"%1$s\" class=\"widget %2$s\"&gt;',\r\n        'after_widget'  =&gt; '&lt;\/section&gt;',\r\n        'before_title'  =&gt; '&lt;h4 class=\"widget-title\"&gt;',\r\n        'after_title'   =&gt; '&lt;\/h4&gt;',\r\n    );\r\n    register_sidebar( array_merge( $common, array(\r\n        'name' =&gt; 'Post Sidebar',\r\n        'id'   =&gt; 'post-sidebar',\r\n        'description' =&gt; 'Widgets shown beside single posts.',\r\n    ) ) );\r\n    register_sidebar( array_merge( $common, array(\r\n        'name' =&gt; 'Page Sidebar',\r\n        'id'   =&gt; 'page-sidebar',\r\n    ) ) );\r\n    register_sidebar( array_merge( $common, array(\r\n        'name' =&gt; 'Footer Widgets',\r\n        'id'   =&gt; 'footer-widgets',\r\n    ) ) );\r\n}\r\nadd_action( 'widgets_init', 'qot_register_sidebars' );<\/code><\/pre>\n<p>In 2007 we wrapped this in <code>if ( function_exists('register_sidebar') )<\/code> and named sidebars &#8220;sidebar1&#8221;, &#8220;sidebar2&#8221; and so on. Always give each sidebar a unique, lowercase <strong>id<\/strong>; WordPress shows a notice if you leave it out, and widgets can get mixed up when you add more sidebars later.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Step_2_Display_each_sidebar_in_your_templates\"><\/span>Step 2: Display each sidebar in your templates<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Place this where the widget area should appear, for example in sidebar.php, single.php or footer.php:<\/p>\n<pre><code>&lt;?php if ( is_active_sidebar( 'post-sidebar' ) ) : ?&gt;\r\n    &lt;aside class=\"post-sidebar\"&gt;\r\n        &lt;?php dynamic_sidebar( 'post-sidebar' ); ?&gt;\r\n    &lt;\/aside&gt;\r\n&lt;?php endif; ?&gt;<\/code><\/pre>\n<p><code>is_active_sidebar()<\/code> skips empty sidebars, so no blank boxes appear.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Step_3_Show_different_sidebars_on_different_pages\"><\/span>Step 3: Show different sidebars on different pages<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<pre><code>&lt;?php\r\nif ( is_single() ) {\r\n    dynamic_sidebar( 'post-sidebar' );\r\n} elseif ( is_page() ) {\r\n    dynamic_sidebar( 'page-sidebar' );\r\n}\r\n?&gt;<\/code><\/pre>\n<p>WordPress conditional tags like <code>is_front_page()<\/code>, <code>is_category()<\/code> and <code>is_search()<\/code> let you target any page type.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Step_4_Add_widgets\"><\/span>Step 4: Add widgets<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Go to <strong>Appearance &gt; Widgets<\/strong> (or Appearance &gt; Customize &gt; Widgets). Your new areas appear by name. Since WordPress 5.8 this screen uses blocks, so you can add any block, such as Latest Posts, Search or Custom HTML, to each sidebar. Here is how our six sidebars looked in the old admin:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/dynamic-sidebars.jpg\" alt=\"multiple dynamic widget sidebars in WordPress admin\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Block_themes_use_template_parts_instead\"><\/span>Block themes: use template parts instead<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Block themes such as Twenty Twenty-Five have no widgets screen. Open <strong>Appearance &gt; Editor<\/strong>, create a template part (for example &#8220;Post sidebar&#8221;), add blocks to it, and insert it into the templates that need it. No code is required.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Easier_options_without_code\"><\/span>Easier options without code<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ul>\n<li><strong>Theme options:<\/strong> themes like <a href=\"https:\/\/www.kadencewp.com\/\" target=\"_blank\" rel=\"noopener\">Kadence<\/a> and <a href=\"https:\/\/generatepress.com\/\" target=\"_blank\" rel=\"noopener\">GeneratePress<\/a> already include several widget areas and let you pick a different sidebar per page.<\/li>\n<li><strong>Widget visibility plugins:<\/strong> show or hide individual widgets on chosen pages instead of creating new sidebars.<\/li>\n<\/ul>\n<p>Keep sidebars light, as heavy widgets slow pages; check with <a href=\"https:\/\/www.quickonlinetips.com\/archives\/2009\/06\/faster-sites-with-google-page-speed\/\">Google PageSpeed Insights<\/a>.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Ideas_for_extra_widget_areas\"><\/span>Ideas for extra widget areas<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Beyond the classic right-hand sidebar, extra widget areas are useful in many places: a slim bar above the header for announcements, a box after each post for related links or a newsletter signup, a separate shop sidebar on product pages, and three or four footer columns for contact details, popular posts and social links. Each one is just another <code>register_sidebar()<\/code> call and a matching <code>dynamic_sidebar()<\/code> in the right template. Name them clearly, because your widget screen gets crowded quickly once you have five or six areas.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"FAQ\"><\/span>FAQ<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"How_many_sidebars_can_WordPress_have\"><\/span>How many sidebars can WordPress have?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>There is no fixed limit. Register as many as your design needs, but more widgets mean slower pages.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Why_does_my_new_sidebar_not_appear\"><\/span>Why does my new sidebar not appear?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Check that the id in <code>dynamic_sidebar()<\/code> matches the id in <code>register_sidebar()<\/code>, and that the sidebar has at least one widget.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Will_theme_updates_remove_my_sidebars\"><\/span>Will theme updates remove my sidebars?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Not if you add the code to a child theme.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Want different widgets on different parts of your site? Learning to create multiple sidebars in WordPress lets you show one&#8230;<\/p>\n","protected":false},"author":4,"featured_media":63512,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"default","_kad_post_title":"default","_kad_post_layout":"default","_kad_post_sidebar_id":"","_kad_post_content_style":"default","_kad_post_vertical_padding":"default","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[6],"tags":[49,17],"class_list":["post-2698","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blogging","tag-tutorials","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/2698","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/comments?post=2698"}],"version-history":[{"count":1,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/2698\/revisions"}],"predecessor-version":[{"id":63513,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/2698\/revisions\/63513"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/media\/63512"}],"wp:attachment":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/media?parent=2698"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/categories?post=2698"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/tags?post=2698"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}