{"id":2325,"date":"2011-11-10T14:46:43","date_gmt":"2011-11-10T14:46:43","guid":{"rendered":"https:\/\/www.inmotionhosting.com\/support\/2011\/11\/10\/313-use-shortcodes-within-text-widgit\/"},"modified":"2024-03-22T15:57:41","modified_gmt":"2024-03-22T19:57:41","slug":"use-shortcodes-in-text-widget","status":"publish","type":"post","link":"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/use-shortcodes-in-text-widget\/","title":{"rendered":"How to Use Shortcodes in a WordPress Text Widget"},"content":{"rendered":"<p>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.<\/p>\n<h2>Using Shortcodes in a WordPress Text Widget<\/h2>\n<ol class=\"article_list\">\n<li><a href=\"\/support\/edu\/wordpress\/logging-into-wordpress-dashboard\/\">Log into your WordPress Dashboard<\/a><\/li>\n<li>Under \u201cAppearance\u201d click \u201cEditor\u201d<\/li>\n<li>In the list of files on the right of the page, click \u201cfunctions.php\u201d<\/li>\n<li>At the bottom of the functions.php file, add the following code:\n<div class=\"code_block\" style=\"margin-top: 10px; margin-bottom: 10px;\">add_filter( \u2018widget_text\u2019, \u2018shortcode_unautop\u2019);<br>\nadd_filter( \u2018widget_text\u2019, \u2018do_shortcode\u2019);<\/div>\n<p><a href=\"\/support\/wp-content\/uploads\/2011\/11\/WP_use-shortcodes-in-text-widgit_editing_shortcodes.gif\" rel=\"lightbox-0\"><img decoding=\"async\" width=\"820\" height=\"608\" src=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2011\/11\/WP_use-shortcodes-in-text-widgit_editing_shortcodes.gif\" class=\"optimized-lcp-image\" alt=\"editing your themes functions.php file\" loading=\"eager\" fetchpriority=\"high\" sizes=\"(max-width: 768px) 100vw, 768px\"><\/a><\/p>\n<div style=\"clear: both;\"><\/div>\n<\/li>\n<li>Click \u201cUpdate File\u201d and your shortcodes should now work in your Text widgets!<\/li>\n<\/ol>\n<table border=\"0\" cellspacing=\"4\" cellpadding=\"4\">\n<tbody>\n<tr>\n<td><strong>Before:<\/strong><\/td>\n<td><strong>After:<\/strong><\/td>\n<\/tr>\n<tr>\n<td><a href=\"\/support\/wp-content\/uploads\/2011\/11\/WP_use-shortcodes-in-text-widgit_before_shortcodes.gif\" rel=\"lightbox-0\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-10885\" src=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2011\/11\/WP_use-shortcodes-in-text-widgit_before_shortcodes.gif\" alt=\"before shortcodes could be used in text widgit\" width=\"1002\" height=\"390\"><\/a>\n<div style=\"clear: both;\"><\/div>\n<\/td>\n<td><a href=\"\/support\/wp-content\/uploads\/2011\/11\/WP_use-shortcodes-in-text-widgit_after_shortcodes.gif\" rel=\"lightbox-0\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-10886\" src=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2011\/11\/WP_use-shortcodes-in-text-widgit_after_shortcodes.gif\" alt=\"after shortcodes can be used in a wordpress text widgit\" width=\"1060\" height=\"382\"><\/a>\n<div style=\"clear: both;\"><\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Changes made to these files may get overwritten after theme updates. It is always recommended to make these kinds of modifications in a <a href=\"https:\/\/codex.wordpress.org\/Child_Themes\" target=\"_blank\" rel=\"noopener\">child theme<\/a>.<\/p>\n\n<p>Looking for more guides? We have over 400 <a href=\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wordpress-how-to-articles\/\">WordPress How To Articles<\/a> to help you!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 Log into your WordPress Dashboard Under \u201cAppearance\u201d click \u201cEditor\u201d In the list of files on the right of the page, click \u201cfunctions.php\u201d<a class=\"moretag\" href=\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/use-shortcodes-in-text-widget\/\"> Read More ><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[56],"tags":[],"class_list":["post-2325","post","type-post","status-publish","format-standard","hentry","category-wordpress"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Use Shortcodes in a WordPress Text Widget<\/title>\n<meta name=\"description\" content=\"In this article, we&#039;ll show you how you can use shortcode within a WordPress Text widgit.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/use-shortcodes-in-text-widget\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Use Shortcodes in a WordPress Text Widget\" \/>\n<meta property=\"og:description\" content=\"In this article, we&#039;ll show you how you can use shortcode within a WordPress Text widgit.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/use-shortcodes-in-text-widget\/\" \/>\n<meta property=\"og:site_name\" content=\"InMotion Hosting Support Center\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/inmotionhosting\/\" \/>\n<meta property=\"article:published_time\" content=\"2011-11-10T14:46:43+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-22T19:57:41+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2011\/11\/WP_use-shortcodes-in-text-widgit_editing_shortcodes.gif\" \/>\n<meta name=\"author\" content=\"Brad Markle\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@InMotionHosting\" \/>\n<meta name=\"twitter:site\" content=\"@InMotionHosting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Brad Markle\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/use-shortcodes-in-text-widget\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/use-shortcodes-in-text-widget\/\"},\"author\":{\"name\":\"Brad Markle\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/5ae05d1210b0ef63c437ccedce2799bf\"},\"headline\":\"How to Use Shortcodes in a WordPress Text Widget\",\"datePublished\":\"2011-11-10T14:46:43+00:00\",\"dateModified\":\"2024-03-22T19:57:41+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/use-shortcodes-in-text-widget\/\"},\"wordCount\":133,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/use-shortcodes-in-text-widget\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2011\/11\/WP_use-shortcodes-in-text-widgit_editing_shortcodes.gif\",\"articleSection\":[\"WordPress Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/use-shortcodes-in-text-widget\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/use-shortcodes-in-text-widget\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/use-shortcodes-in-text-widget\/\",\"name\":\"How to Use Shortcodes in a WordPress Text Widget\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/use-shortcodes-in-text-widget\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/use-shortcodes-in-text-widget\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2011\/11\/WP_use-shortcodes-in-text-widgit_editing_shortcodes.gif\",\"datePublished\":\"2011-11-10T14:46:43+00:00\",\"dateModified\":\"2024-03-22T19:57:41+00:00\",\"description\":\"In this article, we'll show you how you can use shortcode within a WordPress Text widgit.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/use-shortcodes-in-text-widget\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/use-shortcodes-in-text-widget\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/use-shortcodes-in-text-widget\/#primaryimage\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2011\/11\/WP_use-shortcodes-in-text-widgit_editing_shortcodes.gif\",\"contentUrl\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2011\/11\/WP_use-shortcodes-in-text-widgit_editing_shortcodes.gif\",\"width\":820,\"height\":608,\"caption\":\"editing your themes functions.php file\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/use-shortcodes-in-text-widget\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.inmotionhosting.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Use Shortcodes in a WordPress Text Widget\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"name\":\"InMotion Hosting Support Center\",\"description\":\"Web Hosting Support &amp; Tutorials\",\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\",\"name\":\"InMotion Hosting\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"contentUrl\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"width\":696,\"height\":696,\"caption\":\"InMotion Hosting\"},\"image\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/inmotionhosting\/\",\"https:\/\/x.com\/InMotionHosting\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/5ae05d1210b0ef63c437ccedce2799bf\",\"name\":\"Brad Markle\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/author\/bradm\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Use Shortcodes in a WordPress Text Widget","description":"In this article, we'll show you how you can use shortcode within a WordPress Text widgit.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/use-shortcodes-in-text-widget\/","og_locale":"en_US","og_type":"article","og_title":"How to Use Shortcodes in a WordPress Text Widget","og_description":"In this article, we'll show you how you can use shortcode within a WordPress Text widgit.","og_url":"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/use-shortcodes-in-text-widget\/","og_site_name":"InMotion Hosting Support Center","article_publisher":"https:\/\/www.facebook.com\/inmotionhosting\/","article_published_time":"2011-11-10T14:46:43+00:00","article_modified_time":"2024-03-22T19:57:41+00:00","og_image":[{"url":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2011\/11\/WP_use-shortcodes-in-text-widgit_editing_shortcodes.gif","type":"","width":"","height":""}],"author":"Brad Markle","twitter_card":"summary_large_image","twitter_creator":"@InMotionHosting","twitter_site":"@InMotionHosting","twitter_misc":{"Written by":"Brad Markle","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/use-shortcodes-in-text-widget\/#article","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/use-shortcodes-in-text-widget\/"},"author":{"name":"Brad Markle","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/5ae05d1210b0ef63c437ccedce2799bf"},"headline":"How to Use Shortcodes in a WordPress Text Widget","datePublished":"2011-11-10T14:46:43+00:00","dateModified":"2024-03-22T19:57:41+00:00","mainEntityOfPage":{"@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/use-shortcodes-in-text-widget\/"},"wordCount":133,"commentCount":0,"publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"image":{"@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/use-shortcodes-in-text-widget\/#primaryimage"},"thumbnailUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2011\/11\/WP_use-shortcodes-in-text-widgit_editing_shortcodes.gif","articleSection":["WordPress Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/use-shortcodes-in-text-widget\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/use-shortcodes-in-text-widget\/","url":"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/use-shortcodes-in-text-widget\/","name":"How to Use Shortcodes in a WordPress Text Widget","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/use-shortcodes-in-text-widget\/#primaryimage"},"image":{"@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/use-shortcodes-in-text-widget\/#primaryimage"},"thumbnailUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2011\/11\/WP_use-shortcodes-in-text-widgit_editing_shortcodes.gif","datePublished":"2011-11-10T14:46:43+00:00","dateModified":"2024-03-22T19:57:41+00:00","description":"In this article, we'll show you how you can use shortcode within a WordPress Text widgit.","breadcrumb":{"@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/use-shortcodes-in-text-widget\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/use-shortcodes-in-text-widget\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/use-shortcodes-in-text-widget\/#primaryimage","url":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2011\/11\/WP_use-shortcodes-in-text-widgit_editing_shortcodes.gif","contentUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2011\/11\/WP_use-shortcodes-in-text-widgit_editing_shortcodes.gif","width":820,"height":608,"caption":"editing your themes functions.php file"},{"@type":"BreadcrumbList","@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/use-shortcodes-in-text-widget\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.inmotionhosting.com\/support\/"},{"@type":"ListItem","position":2,"name":"How to Use Shortcodes in a WordPress Text Widget"}]},{"@type":"WebSite","@id":"https:\/\/www.inmotionhosting.com\/support\/#website","url":"https:\/\/www.inmotionhosting.com\/support\/","name":"InMotion Hosting Support Center","description":"Web Hosting Support &amp; Tutorials","publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.inmotionhosting.com\/support\/#organization","name":"InMotion Hosting","url":"https:\/\/www.inmotionhosting.com\/support\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/","url":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","contentUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","width":696,"height":696,"caption":"InMotion Hosting"},"image":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/inmotionhosting\/","https:\/\/x.com\/InMotionHosting"]},{"@type":"Person","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/5ae05d1210b0ef63c437ccedce2799bf","name":"Brad Markle","url":"https:\/\/www.inmotionhosting.com\/support\/author\/bradm\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"primary_category":{"id":56,"name":"WordPress Tutorials","slug":"wordpress","link":"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/"},"_links":{"self":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/2325","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/comments?post=2325"}],"version-history":[{"count":5,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/2325\/revisions"}],"predecessor-version":[{"id":123151,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/2325\/revisions\/123151"}],"wp:attachment":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/media?parent=2325"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/categories?post=2325"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/tags?post=2325"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}