{"id":4152,"date":"2022-02-02T09:06:12","date_gmt":"2022-02-02T09:06:12","guid":{"rendered":"https:\/\/elementor.com\/resources\/?p=4152"},"modified":"2022-02-02T09:09:09","modified_gmt":"2022-02-02T09:09:09","slug":"what-are-shortcodes-in-wordpress","status":"publish","type":"post","link":"https:\/\/elementor.com\/resources\/glossary\/what-are-shortcodes-in-wordpress\/","title":{"rendered":"What Are Shortcodes in WordPress?"},"content":{"rendered":"\n<p>In WordPress, a <strong>shortcode<\/strong> is a tiny bit of code that allows web creators to do various things with minimal effort. So, a <strong>shortcode<\/strong> is similar to a shortcut to add features to a site that would typically require high technical ability and complex computer code.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How Do Shortcodes Work?<\/h2>\n\n\n\n<p>WP 2.5 introduced <a href=\"https:\/\/elementor.com\/help\/how-to-use-shortcodes\/\"><strong>shortcode<\/strong><\/a><strong> <\/strong>to enable code to be executed within WP pages, widgets, and posts without directly writing code. The code execution enables creating objects or embedding files directly into a page or post where the user wants them to appear \u2013 and doing so with just a single line of code. Many 3rd party plugins also use shortcodes.<\/p>\n\n\n\n<p>A shortcode is written between two square brackets. For example, the [youtube] shortcode can embed any public YouTube video into any post or page. Another example is  for embedding a video.<\/p>\n\n\n\n<p>A shortcode can also have attributes. For example, the built-in WP video shortcode can take a src (source) attribute,<\/p>\n\n\n\n<p>WordPress comes with various built-in shortcodes, including the caption, embed, audio, video, gallery, and other functionality. Others can be added by plugins by applying the Shortcode API.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In WordPress, a shortcode is a tiny bit of code that allows web creators to do various things with minimal effort<\/p>\n","protected":false},"author":1292159,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_angie_page":false,"page_builder":"","footnotes":""},"categories":[15,31],"tags":[16],"class_list":["post-4152","post","type-post","status-publish","format-standard","hentry","category-glossary","category-wordpress","tag-build"],"acf":[],"_links":{"self":[{"href":"https:\/\/elementor.com\/resources\/wp-json\/wp\/v2\/posts\/4152","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/elementor.com\/resources\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/elementor.com\/resources\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/elementor.com\/resources\/wp-json\/wp\/v2\/users\/1292159"}],"replies":[{"embeddable":true,"href":"https:\/\/elementor.com\/resources\/wp-json\/wp\/v2\/comments?post=4152"}],"version-history":[{"count":4,"href":"https:\/\/elementor.com\/resources\/wp-json\/wp\/v2\/posts\/4152\/revisions"}],"predecessor-version":[{"id":4156,"href":"https:\/\/elementor.com\/resources\/wp-json\/wp\/v2\/posts\/4152\/revisions\/4156"}],"wp:attachment":[{"href":"https:\/\/elementor.com\/resources\/wp-json\/wp\/v2\/media?parent=4152"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/elementor.com\/resources\/wp-json\/wp\/v2\/categories?post=4152"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/elementor.com\/resources\/wp-json\/wp\/v2\/tags?post=4152"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}