---
title: How do I create a shortcode for a widget?
description: "Widget Options allows you to create and use shortcodes to display widgets and sidebars in other areas of your WordPress site. ## **Installation and Activation** The Shortcode feature is available in **Widget Options Extended**. Start by installing and activating Widget…"
url: "https://widget-options.com/docs/how-do-i-create-a-shortcode-for-a-widget/"
updated: "2026-08-27"
category: "How-To"
---

# How do I create a shortcode for a widget?

Widget Options allows you to create and use shortcodes to display widgets and sidebars in other areas of your WordPress site.

## **Installation and Activation**

The Shortcode feature is available in **Widget Options Extended**. Start by installing and activating Widget Options Extended.

Once activated, go to **Settings > Widget Options** and enable the **Shortcodes** feature.

![Shortcode enabled](https://widget-options.com/wp-content/uploads/2024/05/Shortcode-enabled.png)

To create and copy a widget shortcode, you also need to use the **Classic Widget Editor**.

**Note:** The Shortcode option is not available in the **Block Widget Editor**, even when Widget Options Extended is active. Widgets added through the Block Widget Editor will not display a shortcode option. 

## **Copy Shortcode**

Go to the **Classic Widget Editor** and open the widget for which you want to create a shortcode.

Once the Shortcodes feature is enabled, the shortcode can be found at the bottom of the widget settings.

![Shortcode](https://widget-options.com/wp-content/uploads/2024/05/Shortcode.png)

## **Integration**

Paste the copied shortcode into the desired **post, page, or custom post type** where you want the widget to appear.

![WO Shortcode Integration](https://widget-options.com/wp-content/uploads/2024/05/WO-Shortcode-Integration-1024x350.png)

After adding the shortcode, preview or view the page on the front end to make sure the widget is displayed correctly. 

![WO Shortcode integrated](https://widget-options.com/wp-content/uploads/2024/05/WO-Shortcode-integrated.png)

If you are unsure which values to use, you can check the shortcode displayed below each widget when the feature is enabled. 

#### For sidebars:

```
[do_sidebar name="Primary" container="div" container_id="div_id" container_class="div_class"]
```

**Shortcode Parameters**

**name** : the name or id of the sidebar you want to display.

**container** : *optional* content container for all the contents.

**container_id** : *optional* container id if you have container value.

**container_class** : *optional* container class if you have container value.

#### For widgets:

```
[do_widget id="widget-id" container="div" container_id="div_id" container_class="div_class"]
```

**Shortcode Parameters**

**id** : the id of the widget you want to display.

**container** : *optional* content container for the widget.

**container_id** : *optional* container id if you have container value.

**container_class** : *optional* container class if you have container value.

## **FAQs**

**Can I use the same widget shortcode in multiple places?**

Yes. You can use the same shortcode wherever you want to display the same widget.

**What happens if I delete the widget?**

If the widget is deleted, the shortcode will no longer be able to display it. You will need to update the shortcode if you want to display a different widget.

**Will changes to the widget appear everywhere the shortcode is used?**

Yes. Changes made to the widget are reflected in every location where its shortcode is used.

**Why is my widget not displaying?**

Make sure the widget still exists and that you are using the correct shortcode. If the widget was deleted or its ID changed, copy the current shortcode again and update it where it is being used.
