InMotion Hosting Support Center

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 40: 313: How can I use shortcodes within a WordPress Text widget?
Section 39: 315: Broken Link Checker Plugin for WordPress
Section 41: 316: Using InMotion Hosting's Memory Viewer WordPress Plugin

Support Center Login

Social Media Login

Social Login Joomla

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,186 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!!


36,928 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 !!! :(

36,928 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


22,952 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

22,952 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,186 Points
2014-12-12 9:56 am
To clarify, are you referring to showing the shortcode content at the end of the post content?
n/a Points
2015-05-24 3:19 pm

Hi Sir,


 its doesn't work for me 

i am using dream theme 7.2

Plz help



9,460 Points
2015-05-26 10:32 pm
Hello Ricky,

What happens when you add the code to your functions.php file? You may need to contact theme forest to see if they have another method for their themes.

Best Regards,
TJ Edens
n/a Points
2016-02-10 4:01 pm

Thanks for your work!In my theme I have an area in the top bar where I can add text only in the customization. Is it possible to insert a shortcode there? 

I use MaxStore in Wordpress with Woocommerce.

Thank you!

32,263 Points
2016-02-10 4:41 pm
Hello Apfelsinchen,

Thanks for the question about the shortcodes in your theme. Typically, shortcodes are only usable in the posts/pages section of WordPress. If you need more information on the customization options for your theme you will need to consult with the theme developer.

If you have any further questions or comments, please let us know.

Arnel C.

Post a Comment

Email Address:
Phone Number:

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

19 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!