In the past, we showed you how to add and use widgets on WordPress. One of the most asked questions we get related to widgets is: how to use the shortcodes on these?

By default, shortcodes don't work on sidebar widgets.

In this tutorial, we will show you how to easily use shortcodes on the widgets of your WordPress blog.

But before you start, take the time to take a look at How to install a WordPress themeHow many plugins to install on WordPress.

Then let's get to work!

How to use shortcodes on Wordpress wigs

Why do shortcodes only work in widgets?

On WordPress, shortcodes provide an easier way add features in the text boxes like in the article editor when you write a.

Often newbies think that because there is a text widget then the shortcodes will work automatically. By default, any text defined in the text widget goes through WordPress filters which do not allow shortcodes to run.

How to use wordpress blogpascher widget shortcodes 1

Instead of seeing the end result, you'll see the shortcode itself as plain text. It's very easy to change that, and we'll show you how to easily enable running shortcodes on the WordPress text widget.

Also take the trouble to read How to easily add code to WordPress without breaking your website

Method 1: By adding a WordPress plugin

In this method, we will use a simple plugin. This method is recommended for beginners who do not want to add code manually.

The first thing you need to do is install and activate the WordPress Shortcode Widget plugin. For more details, check out our step by step guide on how to install a WordPress plugin.

After activation, you must visit the interface " Appearance> Widgets ". You will find a shortcode widget in the list of available widgets.

Just add the shortcode widget to a sidebar, then add your shortcode in the content area. Don't forget to click on the button Save to save the widget settings.

How to use wordpress blogpascher widget shortcodes 2

This shortcode widget is similar to the default text widget on WordPress. The only difference is that you can add shortcodes inside.

See also: How to add a widget to the header of your WordPress blog

2 Method: Enabling the Running of Shortcodes in the Text Widget

If you are comfortable with codes then you can enable execution of shortcodes in the WordPress text widget.

Just add this code to your WordPress plugin.

// Activate shortcodes in a text widget add_filter ('widget_text', 'do_shortcode');

This code simply adds a new filter that lets you run the shortcodes inside the text widget.

How to add a widget at the bottom of articles on WordPress is to discover absolutely.

You can now visit the interface " Appearance> Widgets », And add a text widget to a sidebar. Paste the shortcode in the content area and click on the button Save.

final result use shortcode widget text

Here is ! It is done. Visit your website to see how the shortcode runs.

Discover also some premium WordPress plugins  

You can use other WordPress plugins to give a modern appearance and to optimize the handling of your blog or website.

We offer you here some premium WordPress plugins that will help you do that.

1. Supreme Widgets

Supreme Widgets is a premium WordPress plugin designed to enhance your website with more than useful marketing and social features. He sets up pretty icons for Facebook, Twitter and other networks. Likewise you have a Contact form with Captcha, and a responsive integration of Google Ads et Google Maps.Supreme Widgets

This plugin works perfectly with Visual Composer. If the latter is already installed, you can insert any widget into your page or article directly from its "Add an item" feature.

Download | Demo | Web hosting

2. Flex-Register

Flex-Register is a premium WordPress plugin that allows you to add a registration or login form in a lightbox. A refresh of the page will not be necessary and it will work immediately after installation. No configuration will therefore be necessary.

Flex register bootstrap 3 lightbox for register wordpress plugin

He will also take care of matching your form with the style of the WordPress theme active on your website.

See also our How to control the stock of your WooCommerce online store

As functionality, it offers among other things: a clean design and a well commented code, its fully customizable appearance, compatibility with the majority of DS WordPress themes popular, cross-browser support and more.

Download | Demo | Web hosting

3. QuadMenu

QuadMenu is a recently released WordPress menu plugin with a lot of useful features. Thanks to an interface that supports drag and drop, this WordPress plugin will offer the possibility for everyone to create drop-down menus on their WordPress website.

Quadmenu themes developer mega menu

No coding skill is required because its menu builder has a fully visual interface accessible through your dashboard. You will also have the option to create an unlimited number of menus for your website, before assigning them to different areas of your website as well as to individual pages.

Read also our article on How to Add a CSS Code Safely to WordPress

This feature ensures that your menus and their content will be highly relevant to the content displayed, allowing you to display links that your visitors are more likely to click. New features should be added to QuadMenu soon. Its development team is also open to suggestions.

Download | Demo | Web hosting

Recommended Resources

Find out about other recommended resources to help you build and manage your website.

Conclusion

Here ! That's it for this tutorial, I hope it will allow you to enable the execution of shortcode in the text widget of your WordPress blog. Do not hesitate to share with your friends on your favorite social networks

However, you can also consult our resources, if you need more elements to carry out your projects of creation of Internet sites, by consulting our guide on WordPress blog creation.

If you have suggestions or remarks, leave them in our section Comments.

...