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.

  1. Log into your 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

Click "Update File" and your shortcodes should now work in your Text widgets!

Before: After:
before shortcodes could be used in text widgit after shortcodes can be used in a wordpress text widgit
Continued Education in Course WordPress
You are viewing Section 36: 313: How can I use shortcodes within a WordPress Text widget?
Section 35: 315: Broken Link Checker Plugin for WordPress
Section 37: 316: Using InMotion Hosting's Memory Viewer WordPress Plugin
Did you find this article helpful?

We value your feedback!

Why was this article not helpful? (Check all that apply)
The article is too difficult or too technical to follow.
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
How did you find this article?
Please tell us how we can improve this article:
Email Address

new! - Enter your name and email address above and we will post your feedback in the comments on this page!

Support Center Login

Social Media Login

Related Questions

Here are a few questions related to this article that our customers have asked:
Ooops! It looks like there are no questions about this page.
Would you like to ask a question about this page? If so, click the button below!
Ask a Question
2013-09-06 6:49 am
its awesome man!
thanks a lot man
its working awesomely
n/a Points
2014-04-22 5:00 am

How can I enable contact form shortcode in HTML area( Where only allow html tag ) .

[contact-form-7 id="2358" title="Contact Form 1"]

11,156 Points
2014-04-22 7:57 am
If it's an HTML-only area, shortcodes cannot be added. You would need to use a normal location or create the form using HTML instead.
n/a Points
2014-04-27 10:01 am

wow!!!!!! you are awesome dude!!!this is what I've looking for!!


24,054 Points
2014-04-28 1:11 am
Hello Dimas,

Thank you! We are glad to help!

Kindest Regards,
Scott M
n/a Points
2014-06-25 5:36 am

It does't work for me !!! :(

24,054 Points
2014-06-25 9:18 am
Hello Husnain,

Sorry to hear you tried it and it did not work. What theme are you using? What version of WordPress are you using? Which shortcode did you test with to see if it worked?

Kindest Regards,
Scott M
n/a Points
2014-06-27 3:55 am

i used LPN theme for wordpress ... and the latest version of wordpress .. and the shortcode is [indeedsearchform] ... anyways i found solution .. the shortcode works on pages, so i make a page and run this shortcode on that page and than parse it to the index page ... 

n/a Points
2014-07-08 9:01 am

Do you have the same code for excerpt text area


13,760 Points
2014-07-08 9:44 am
Hello Boris,

Thank you for your question. I found a similar question in the Official Wordpress forums, where they present several ways to enable shortcodes in excerpts.

If you have any further questions, feel free to post them below.
Thank you,

n/a Points
2014-08-10 10:18 am

It's working...Thank you very much

n/a Points
2014-12-11 4:02 am

Hi i create a plugin i am getting shortcode also but i have to display shortcode after the plugin content

13,760 Points
2014-12-11 10:42 am
Hello dileep,

Thank you for contacting us. We are happy to help, but I am not sure what you are asking.

Please provide more information, so we can better assist you.

Thank you,
n/a Points
2014-12-12 12:06 am

function hs_shortcode()




return ob_get_clean();





hi this is my shortcode function now i have to display shortcode after the plugin content

11,156 Points
2014-12-12 9:56 am
To clarify, are you referring to showing the shortcode content at the end of the post content?

Post a Comment

Email Address:
Phone Number:

Please note: Your name and comment will be displayed, but we will not show your email address.

15 Questions & Comments

Post a comment

Back to first comment | top

Need more Help?


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:
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!