---
title: "How to Use Shortcodes in a WordPress Text Widget"
description: "By default, WordPress shortcodes do not work within Text widgets. If you need this functionality, it is quite easy to accomplish, simply follow the steps below. Using Shortcodes in a WordPress Text..."
url: https://www.inmotionhosting.com/support/edu/wordpress/use-shortcodes-in-text-widget/
date: 2011-11-10
modified: 2024-03-22
author: "Brad Markle"
categories: ["WordPress Tutorials"]
type: post
lang: en
---

# How to Use Shortcodes in a WordPress Text Widget

By default, WordPress shortcodes do not work within Text widgets. If you need this functionality, it is quite easy to accomplish, simply follow the steps below.

## Using Shortcodes in a WordPress Text Widget

1. [Log into your WordPress Dashboard](/support/edu/wordpress/logging-into-wordpress-dashboard/)
2. Under “Appearance” click “Editor”
3. In the list of files on the right of the page, click “functions.php”
4. At the bottom of the functions.php file, add the following code: add_filter( ‘widget_text’, ‘shortcode_unautop’); add_filter( ‘widget_text’, ‘do_shortcode’); [![editing your themes functions.php file](https://www.inmotionhosting.com/support/wp-content/uploads/2011/11/WP_use-shortcodes-in-text-widgit_editing_shortcodes.gif)](/support/wp-content/uploads/2011/11/WP_use-shortcodes-in-text-widgit_editing_shortcodes.gif)
5. Click “Update File” and your shortcodes should now work in your Text widgets!

| **Before:** | **After:** |
| --- | --- |
| [![before shortcodes could be used in text widgit](https://www.inmotionhosting.com/support/wp-content/uploads/2011/11/WP_use-shortcodes-in-text-widgit_before_shortcodes.gif)](/support/wp-content/uploads/2011/11/WP_use-shortcodes-in-text-widgit_before_shortcodes.gif) | [![after shortcodes can be used in a wordpress text widgit](https://www.inmotionhosting.com/support/wp-content/uploads/2011/11/WP_use-shortcodes-in-text-widgit_after_shortcodes.gif)](/support/wp-content/uploads/2011/11/WP_use-shortcodes-in-text-widgit_after_shortcodes.gif) |

Changes made to these files may get overwritten after theme updates. It is always recommended to make these kinds of modifications in a [child theme](https://codex.wordpress.org/Child_Themes).

Looking for more guides? We have over 400 [WordPress How To Articles](https://www.inmotionhosting.com/support/edu/wordpress/wordpress-how-to-articles/) to help you!
