313: How can I use shortcodes within a WordPress Text widget?
Written by Brad MarkleBy 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.
- Log into your WordPress Dashboard
- Under "Appearance" click "Editor"
- In the list of files on the right of the page, click "functions.php"
- At the bottom of the functions.php file, add the following code:
add_filter( 'widget_text', 'shortcode_unautop');
add_filter( 'widget_text', 'do_shortcode');
Click "Update File" and your shortcodes should now work in your Text widgets!
| Before: | After: |
![]() |
![]() |
Like this Article?
Tweet
Latest Questions
If you need some help, submit your question to our Community!
We guarantee a response within 60 minutes (8am - 9pm EST, Monday - Friday)
Recent QuestionsNeed more Help?
Search
Ask the Community!
Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.
Current Customers
| Chat: | Click to Chat Now | E-mail: | support@InMotionHosting.com |
|---|---|---|---|
| Call: | 888-321-HOST (4678) | Ticket: | Submit a Support Ticket |



