Widget Menu not Appearing in WordPress Dashboard

Widget menu usually appear under the appearance tab. Widget are used to add the fixed content on WordPress pages and posts, means you can add a widget that will display on all pages or you can add a widget that will show recent posts in all single post pages of a blog site.

Steps to add Widget menu

  1. Go to your theme directory
  2. Open function.php file
  3. copy & paste the code
  4. Reload Dashboard and look for widgets under Appearance Tab

As I said widget tab is under the appearance tab. I was working on a client website, I needed to add a sidebar but widget menu was not showing under appearance at all, it is just not there. The reason is that your theme doesn’t have sidebar functionality added yet. It has not yet initiated the widget  function. In simple words no sidebar has been created yet and that is the reason the widget menu is not appearing in WordPress dashboard.

It is easy to initiate widget menu and register a sidebar. You will need to go to your theme directory and open function.php file. You can go to theme directory using FileZilla or File Manager from Cpanel of your hosting.


function desktop_register_widgets_init() {
    register_sidebar( array(
        'name'          => __( 'Main Sidebar', 'textdomain' ),
        'id'            => 'sidebar-1',
        'description'   => __( 'Widgets in this area will be shown on all posts and pages.', 'textdomain' ),
        'before_widget' => '<li id="%1$s" class="widget %2$s">',
        'after_widget'  => '</li>',
        'before_title'  => '<h2 class="widgettitle">',
        'after_title'   => '</h2>',
    ) );
}
add_action( 'widgets_init', 'desktop_register_widgets_init' );

You should have a widget menu under appearance tab. Click on widget menu and you will have the sidebar we just created with register_sidebar() function.
We initiated the widget functionality by creating a sidebar. Now you can add widgets to that sidebar.