{"id":23667,"date":"2022-04-05T17:02:00","date_gmt":"2022-04-05T22:02:00","guid":{"rendered":"http:\/\/dev2ryanwp.wpengine.com\/?post_type=resource&#038;p=15758"},"modified":"2024-01-18T11:47:17","modified_gmt":"2024-01-18T17:47:17","slug":"your-shortcode-is-showing","status":"publish","type":"resource","link":"https:\/\/wpengine.com\/case-studies\/resources\/your-shortcode-is-showing\/","title":{"rendered":"Your Shortcode is Showing!"},"content":{"rendered":"\n<p><em>By Ben Fox<\/em><\/p>\n\n\n\n<p>You\u2019ve designed this beautiful WordPress website. Sleek, powerful, professional\u2026everything you ever imagined your dream site could do.<\/p>\n\n\n\n<p>But\u2026something is awfully wrong. It\u2019s written on your Facebook page. You\u2019ve been tweeted at. Tickets have piled up\u2026those dreaded words\u2026&#8221;hey, your shortcode is showing!&#8221;<\/p>\n\n\n\n<p>Oh the embarrassment! Oh the shame!<\/p>\n\n\n\n<p>As you put a grocery bag over your head, you realize all professionalism is lost.<\/p>\n\n\n\n<p>Ok, maybe this has never happened to you, but to be sure it never occurs, let\u2019s review what a shortcode is, and how you can prevent it from showing on your WordPress site.<\/p>\n\n\n\n\n\n<h4 class=\"wp-block-heading\">What is a WordPress shortcode?<\/h4>\n\n\n\n<p>Shortcodes were introduced to us in WordPress 2.5. The primary shortcode function is to allow us to execute code on posts, pages, etc. without having to directly write code. Instead, we can use these nifty little pieces of code that will execute a larger command out of sight.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Why is it easier to create shortcode?<\/h4>\n\n\n\n<p>Shortcodes are awesome! Let\u2019s say you want to embed a \u201cFollow Us on Twitter\u201d button at the bottom of your post. Rather than having to embed something like this to follow WP Engine:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><span style=\"font-weight: 400;color: #0000ff\">&lt;a<\/span> <span style=\"color: #800080\">href<span style=\"font-weight: 400;color: #000000\">=<\/span><\/span><span style=\"font-weight: 400;color: #008000\">\"https:\/\/twitter.com\/wpengine\"<\/span> <span style=\"color: #800080\">class<span style=\"font-weight: 400;color: #000000\">=<\/span><\/span><span style=\"font-weight: 400;color: #008000\">\"twitter-follow-button\"<\/span> <span style=\"font-weight: 400;color: #800080\">data-show-count<\/span><span style=\"color: #800080\"><span style=\"font-weight: 400;color: #000000\">=<\/span><\/span><span style=\"font-weight: 400;color: #008000\">\"false\"<\/span><span style=\"font-weight: 400\">&gt;<\/span><span style=\"font-weight: 400\">Follow @wpengine<\/span><span style=\"font-weight: 400\"><span style=\"color: #0000ff\">&lt;\/a&gt;&lt;scrip<\/span>t<\/span> <span style=\"font-weight: 400;color: #800080\">async src<\/span><span style=\"font-weight: 400\">=<\/span><span style=\"font-weight: 400;color: #008000\">\"\/\/platform.twitter.com\/widgets.js\" <span style=\"color: #800080\">charset<\/span><\/span><span style=\"font-weight: 400\">=<\/span><span style=\"font-weight: 400;color: #008000\">\"utf-8\"<\/span><span style=\"font-weight: 400;color: #0000ff\">&gt;&lt;\/script&gt;<\/span><\/pre>\n\n\n\n<p>With a basic shortcode, you can install and activate the Twitter plugin and do something like this:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">[twitter_follow screen_name=<span style=\"color: #008000\">\"wpengine\"]<\/span><\/pre>\n\n\n\n<p>Way easier!&nbsp;Way cleaner!<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Why does a shortcode show?<\/h4>\n\n\n\n<p>Well this can be a bit of a rabbit-hole.<\/p>\n\n\n\n<p>WordPress Shortcodes are executed in WordPress core, so the common reasons your users can see your shortcodes on the front-end of your WordPress website include:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>You have a WordPress plugin interfering with the shortcodes<\/li><li>You have a theme interfering with the shortcodes<\/li><li>You\u2019re somehow running an old enough version of WordPress that doesn\u2019t support shortcodes<\/li><li>The shortcode you\u2019re attempting to execute requires an associated plugin you\u2019ve yet to install\/activate<\/li><li>You\u2019ve made a spelling mistake (more common than you think)<\/li><li>If the shortcode can take an src attribute, it\u2019s possible that the source can\u2019t be found or that it simply doesn\u2019t exist<\/li><\/ul>\n\n\n\n<p>There\u2019s many, many more possible situations, but these are common issues with users who are new to shortcodes.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">How do you prevent&nbsp;a WP shortcode from showing?<\/h4>\n\n\n\n<p>To prevent shortcodes from appearing to your end-users, all you need to do is preview before publishing. Then when you\u2019re about to publish, save again, and preview changes again\u2026then you may publish.<\/p>\n\n\n\n<p><a href=\"https:\/\/en-ca.wordpress.org\/plugins\/hide-broken-shortcodes\/\">Plugins like this one<\/a> can help you hide broken shortcodes from the reader as well. This is great for keeping your shortcode out of your post or page content, but you\u2019ll still be without the functionality you\u2019re seeking from the shortcode. &#x1f641;<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">What are the downfalls?<\/h4>\n\n\n\n<p>Shortcodes are really awesome and super-helpful, but make sure you\u2019re testing them consistently. Sometimes a new update of WordPress can mess with a plugin, and if you\u2019re using that plugin for a specific custom shortcode\u2026now it\u2019s broken! It\u2019s on you to keep track of your shortcodes and properly test your site frequently from a user\u2019s perspective.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">How do you get a shortcode to stop from showing?<\/h4>\n\n\n\n<p>Check out the WordPress shortcode Plugin I recommended above and, if you\u2019re new to WordPress, a safe bet is to get your feet wet with the basic WordPress built-in shortcodes such as [video], [gallery], , [caption], and [audio].<\/p>\n\n\n\n<hr class=\"wp-block-separator\" \/>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"alignleft\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"300\" src=\"https:\/\/wpengine.com\/wp-content\/uploads\/2016\/09\/ben-fox-flowpress-300x300.jpeg\" alt=\"ben-fox-flowpress\" class=\"wp-image-19005\" srcset=\"https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2016\/09\/ben-fox-flowpress-300x300.jpeg 300w, https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2016\/09\/ben-fox-flowpress-150x150.jpeg 150w, https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2016\/09\/ben-fox-flowpress-144x144.jpeg 144w, https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2016\/09\/ben-fox-flowpress.jpeg 512w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/figure><\/div>\n\n\n\n<p><em>Ben Fox is the Co-Founder and CEO of <a href=\"http:\/\/www.flowpress.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">FlowPress<\/a>, a Toronto-based agency that specializes in WebOps for WordPress. Ben is also the Co-Founder of <a href=\"https:\/\/www.sidekick.pro\/\" target=\"_blank\" rel=\"noopener noreferrer\">SIDEKICK<\/a>, a plugin that provides real-time, voice guided Walkthroughs right inside WordPress.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>By Ben Fox You\u2019ve designed this beautiful WordPress website. Sleek, powerful, professional\u2026everything you ever imagined your dream site could do. But\u2026something is awfully wrong. It\u2019s written on your Facebook page. You\u2019ve been tweeted at. Tickets have piled up\u2026those dreaded words\u2026&#8221;hey, your shortcode is showing!&#8221; Oh the embarrassment! Oh the shame! As you put a grocery<span class=\"tile__ellipses\">&hellip;<\/span><span class=\"tile__ellipses--animated\"><\/span><\/p>\n","protected":false},"author":1,"featured_media":131919,"template":"","resource-topic":[901],"resource-role":[896],"resource-type":[916],"class_list":["post-23667","resource","type-resource","status-publish","has-post-thumbnail","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>You&#039;re Shortcode is Showing! | WP Engine\u00ae<\/title>\n<meta name=\"description\" content=\"Shortcodes were introduced to us in WordPress 2.5. Learn more.\" \/>\n<meta name=\"robots\" content=\"noindex, follow\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"You&#039;re Shortcode is Showing! | WP Engine\u00ae\" \/>\n<meta property=\"og:description\" content=\"Shortcodes were introduced to us in WordPress 2.5. Learn more.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/wpengine.com\/case-studies\/resources\/your-shortcode-is-showing\/\" \/>\n<meta property=\"og:site_name\" content=\"WP Engine\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/wpengine\" \/>\n<meta property=\"article:modified_time\" content=\"2024-01-18T17:47:17+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2016\/12\/shutterstock_1906679674.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1100\" \/>\n\t<meta property=\"og:image:height\" content=\"500\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@wpengine\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/wpengine.com\/case-studies\/resources\/your-shortcode-is-showing\/\",\"url\":\"https:\/\/wpengine.com\/case-studies\/resources\/your-shortcode-is-showing\/\",\"name\":\"You're Shortcode is Showing! | WP Engine\u00ae\",\"isPartOf\":{\"@id\":\"https:\/\/wpengine.com\/case-studies\/#website\"},\"datePublished\":\"2022-04-05T22:02:00+00:00\",\"dateModified\":\"2024-01-18T17:47:17+00:00\",\"description\":\"Shortcodes were introduced to us in WordPress 2.5. Learn more.\",\"breadcrumb\":{\"@id\":\"https:\/\/wpengine.com\/case-studies\/resources\/your-shortcode-is-showing\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/wpengine.com\/case-studies\/resources\/your-shortcode-is-showing\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/wpengine.com\/case-studies\/resources\/your-shortcode-is-showing\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/wpengine.com\/case-studies\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Resources\",\"item\":\"https:\/\/wpengine.com\/case-studies\/resources\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Your Shortcode is Showing!\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/wpengine.com\/case-studies\/#website\",\"url\":\"https:\/\/wpengine.com\/case-studies\/\",\"name\":\"WP Engine\",\"description\":\"Managed Hosting for WordPress\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/wpengine.com\/case-studies\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/wpengine.com\/case-studies\/#\/schema\/person\/f5301455463371a10d1fc290e9ad0085\",\"name\":\"WP Engine\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/wpengine.com\/case-studies\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/d8770fe9625ca7c4601f13d9d0ab86565a6dac8cd6a77bfe2ada6d83c6837870?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/d8770fe9625ca7c4601f13d9d0ab86565a6dac8cd6a77bfe2ada6d83c6837870?s=96&d=mm&r=g\",\"caption\":\"WP Engine\"},\"sameAs\":[\"https:\/\/wpengine.com\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"You're Shortcode is Showing! | WP Engine\u00ae","description":"Shortcodes were introduced to us in WordPress 2.5. Learn more.","robots":{"index":"noindex","follow":"follow"},"og_locale":"en_US","og_type":"article","og_title":"You're Shortcode is Showing! | WP Engine\u00ae","og_description":"Shortcodes were introduced to us in WordPress 2.5. Learn more.","og_url":"https:\/\/wpengine.com\/case-studies\/resources\/your-shortcode-is-showing\/","og_site_name":"WP Engine","article_publisher":"https:\/\/www.facebook.com\/wpengine","article_modified_time":"2024-01-18T17:47:17+00:00","og_image":[{"width":1100,"height":500,"url":"https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2016\/12\/shutterstock_1906679674.jpg","type":"image\/jpeg"}],"twitter_card":"summary_large_image","twitter_site":"@wpengine","twitter_misc":{"Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/wpengine.com\/case-studies\/resources\/your-shortcode-is-showing\/","url":"https:\/\/wpengine.com\/case-studies\/resources\/your-shortcode-is-showing\/","name":"You're Shortcode is Showing! | WP Engine\u00ae","isPartOf":{"@id":"https:\/\/wpengine.com\/case-studies\/#website"},"datePublished":"2022-04-05T22:02:00+00:00","dateModified":"2024-01-18T17:47:17+00:00","description":"Shortcodes were introduced to us in WordPress 2.5. Learn more.","breadcrumb":{"@id":"https:\/\/wpengine.com\/case-studies\/resources\/your-shortcode-is-showing\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/wpengine.com\/case-studies\/resources\/your-shortcode-is-showing\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/wpengine.com\/case-studies\/resources\/your-shortcode-is-showing\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/wpengine.com\/case-studies\/"},{"@type":"ListItem","position":2,"name":"Resources","item":"https:\/\/wpengine.com\/case-studies\/resources\/"},{"@type":"ListItem","position":3,"name":"Your Shortcode is Showing!"}]},{"@type":"WebSite","@id":"https:\/\/wpengine.com\/case-studies\/#website","url":"https:\/\/wpengine.com\/case-studies\/","name":"WP Engine","description":"Managed Hosting for WordPress","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/wpengine.com\/case-studies\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/wpengine.com\/case-studies\/#\/schema\/person\/f5301455463371a10d1fc290e9ad0085","name":"WP Engine","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wpengine.com\/case-studies\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/d8770fe9625ca7c4601f13d9d0ab86565a6dac8cd6a77bfe2ada6d83c6837870?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d8770fe9625ca7c4601f13d9d0ab86565a6dac8cd6a77bfe2ada6d83c6837870?s=96&d=mm&r=g","caption":"WP Engine"},"sameAs":["https:\/\/wpengine.com"]}]}},"acf":[],"grid_image_url":"https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2016\/12\/shutterstock_1906679674-1.jpg","media-type":{"term_id":916,"name":"Article","slug":"article"},"role":"<strong>Roles:<\/strong> Developer","topic":"<strong>Topics:<\/strong> WordPress","_links":{"self":[{"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/resource\/23667","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/resource"}],"about":[{"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/types\/resource"}],"author":[{"embeddable":true,"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/users\/1"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/media\/131919"}],"wp:attachment":[{"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/media?parent=23667"}],"wp:term":[{"taxonomy":"resource-topic","embeddable":true,"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/resource-topic?post=23667"},{"taxonomy":"resource-role","embeddable":true,"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/resource-role?post=23667"},{"taxonomy":"resource-type","embeddable":true,"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/resource-type?post=23667"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}