{"id":46625,"date":"2026-10-10T17:17:37","date_gmt":"2026-10-10T17:17:37","guid":{"rendered":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/?p=46625"},"modified":"2026-10-10T17:17:37","modified_gmt":"2026-10-10T17:17:37","slug":"restore-classic-widgets-wordpress","status":"publish","type":"post","link":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/restore-classic-widgets-wordpress\/","title":{"rendered":"Restore Classic Widgets in WordPress Without a Plugin"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Since WordPress 5.8, <strong>Appearance \u2192 Widgets<\/strong> and the Customizer&#8217;s widget panel use the block editor. If your theme, your widget code or your clients rely on classic widgets, you can restore classic widgets in WordPress without a plugin. It takes one filter, the same one the official Classic Widgets plugin adds.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This is useful on classic themes with sidebars and footer widget areas, where the block-based screen is slower to load and makes simple widgets like a menu or a text box harder to manage.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The snippet<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">&lt;?php\n\/**\n * Classic widgets in Appearance \u2192 Widgets and the Customizer.\n *\/\nadd_filter( 'use_widgets_block_editor', '__return_false', 100 );<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">How it works<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>wp_use_widgets_block_editor()<\/code> decides which widget editor WordPress loads. It starts from the theme&#8217;s <code>widgets-block-editor<\/code> support and passes the result through the <code>use_widgets_block_editor<\/code> filter. Returning <code>false<\/code> loads the classic screens in Appearance \u2192 Widgets and in the Customizer.<\/li>\n\n\n<li>The older One-Click Import version also filtered <code>gutenberg_use_widgets_block_editor<\/code>. That name only mattered for the Gutenberg plugin before the feature moved into core; current Gutenberg uses the core filter, so the line is gone.<\/li>\n\n\n<li>Priority <code>100<\/code> beats a theme or plugin that turns the block editor back on at the default priority.<\/li>\n\n\n<li>The filter changes nothing that is stored. Your sidebars, widgets and their settings stay as they are; only the editing screen changes.<\/li>\n\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Add it with Scripts Organizer<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In <a href=\"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/dplugins.com\/downloads\/scripts-organizer\/\">Scripts Organizer<\/a> go to <strong>Code Blocks \u2192 Add New<\/strong> and give the block a name. Set <strong>Trigger location<\/strong> to <strong>Everywhere<\/strong>, tick <strong>PHP<\/strong> under <strong>Script location<\/strong>, paste the code into the PHP editor and publish. Leave <strong>Action\/Hook<\/strong> empty. <strong>Admin only<\/strong> would cover Appearance \u2192 Widgets, but the Customizer&#8217;s preview frame is a front-end request, so Everywhere is the choice that keeps both editors in the same mode. The cost is one <code>add_filter()<\/code> call per request.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The same code also works unchanged in a small plugin or an mu-plugin.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Customise it<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Only for one theme: hook a function instead of <code>__return_false<\/code> and return <code>'my-theme' !== get_stylesheet()<\/code>, so the block editor stays on for other themes.<\/li>\n\n\n<li>Keep it for administrators only: return <code>! current_user_can( 'manage_options' )<\/code> from that function, so other roles get classic widgets and admins keep blocks.<\/li>\n\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Once the classic screen is back, these work with classic widgets: <a href=\"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/remove-widget-title-conditionally\/\">Remove Widget Title Conditionally<\/a> and <a href=\"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/widget-title-change-h2-to-h4\/\">Widget Title change h2 to h4<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Gotchas<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Widgets you already built as blocks don&#8217;t disappear. The classic screen lists each one as a &#8220;Block&#8221; widget with its block markup in a text field; edit or replace them there.<\/li>\n\n\n<li>Block themes have no widget areas, so there is nothing to restore. The snippet only matters for themes that register sidebars.<\/li>\n\n\n<li>The post and page editor is not affected. Switching that off is a different filter, <code>use_block_editor_for_post<\/code>.<\/li>\n\n<\/ul>\n\n","protected":false},"excerpt":{"rendered":"<p>Restore the classic widgets screen in WordPress without the Classic Widgets plugin: one filter turns off the block-based widget editor.<\/p>\n","protected":false},"author":1,"featured_media":46626,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"slim_seo":{"title":"Restore Classic Widgets in WordPress Without a Plugin","description":"Restore the classic widgets screen in WordPress without the Classic Widgets plugin: one filter turns off the block-based widget editor."},"_slim_seo_primary_term_category":0,"_slim_seo_primary_term_post_tag":0,"footnotes":""},"categories":[90,3],"tags":[159,172,166,171],"dpc_library":[204],"class_list":["post-46625","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-gutenberg","category-wordpress","tag-block-editor","tag-classic-themes","tag-scripts-organizer","tag-widgets"],"_links":{"self":[{"href":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/wp-json\/wp\/v2\/posts\/46625","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/wp-json\/wp\/v2\/comments?post=46625"}],"version-history":[{"count":1,"href":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/wp-json\/wp\/v2\/posts\/46625\/revisions"}],"predecessor-version":[{"id":46667,"href":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/wp-json\/wp\/v2\/posts\/46625\/revisions\/46667"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/wp-json\/wp\/v2\/media\/46626"}],"wp:attachment":[{"href":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/wp-json\/wp\/v2\/media?parent=46625"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/wp-json\/wp\/v2\/categories?post=46625"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/wp-json\/wp\/v2\/tags?post=46625"},{"taxonomy":"dpc_library","embeddable":true,"href":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/wp-json\/wp\/v2\/dpc_library?post=46625"}],"curies":[{"name":"wp","href":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/api.w.org\/{rel}","templated":true}]}}