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 37: 313: How can I use shortcodes within a WordPress Text widget?
Section 36: 315: Broken Link Checker Plugin for WordPress
Section 38: 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
Name

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

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"]

Staff
9,162 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!!

 

Staff
19,557 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 !!! :(

Staff
19,557 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

thnx

Staff
9,684 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,

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

It's working...Thank you very much

Post a Comment

Name:
Email Address:
Phone Number:
Comment:
Submit

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

11 Questions & Comments

Post a comment

Back to first comment | top

Need 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

Not a Customer?

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