{"id":36066,"date":"2024-04-17T14:22:22","date_gmt":"2024-04-17T14:22:22","guid":{"rendered":"https:\/\/10web.io\/blog\/?p=36066"},"modified":"2024-04-24T11:15:21","modified_gmt":"2024-04-24T11:15:21","slug":"how-to-use-shortcode-in-wordpress","status":"publish","type":"post","link":"https:\/\/10web.io\/blog\/how-to-use-shortcode-in-wordpress\/","title":{"rendered":"How to Use Shortcode in WordPress: 6 Proven Methods"},"content":{"rendered":"<p><span style=\"font-weight: 400;\">Shortcodes in WordPress are a powerful feature that allows users to execute code within posts, pages, and widgets without having to write lengthy code each time. Whether you&#8217;re looking to embed files, create objects, or execute functions, shortcodes streamline the process, making it accessible even for those with limited coding knowledge. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">This guide will walk you through the various ways you can add shortcodes to your WordPress site, from inserting them in posts and pages to integrating them into theme files. <\/span><\/p>\n<h2><span style=\"font-weight: 400;\">FAQ<\/span><\/h2>\n<p><div class=\"faq-shortcode\">\n    <p class=\"faq_title\">How do I enter a shortcode in WordPress?<\/p>\n    <div class=\"faq_content\"> To enter a shortcode in WordPress, simply add the shortcode in square brackets directly into your post, page, or widget content area. For example, if you have a shortcode to display a gallery, you would type the specific shortcode where you want the gallery to appear. Save or update the content, and the shortcode will execute and display the desired content or functionality when viewed on your site. <\/div>\n<\/div>\n<br \/>\n<div class=\"faq-shortcode\">\n    <p class=\"faq_title\">How do I use shortcode in WordPress menu?<\/p>\n    <div class=\"faq_content\"> To use a shortcode in a WordPress menu, you&#8217;ll need to add custom code to your theme&#8217;s <span style=\"font-weight: 400;\">functions.php<\/span><span style=\"font-weight: 400;\"> file to enable shortcode processing in menu items. After doing so, you can insert the shortcode directly into the Navigation label field of your menu item in the WordPress menu editor. <\/div>\n<\/div>\n<br \/>\n<div class=\"faq-shortcode\">\n    <p class=\"faq_title\">How do I link a shortcode button in WordPress?<\/p>\n    <div class=\"faq_content\"> To link a shortcode button in WordPress, if the shortcode supports it, you can include the URL directly in the shortcode like this:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">[button_shortcode url=&#8221;https:\/\/example.com&#8221;]Button Text[\/button_shortcode] <span style=\"font-weight: 400;\"> <\/span><\/span><\/p>\n<p>Replace <span style=\"font-weight: 400;\">https:<\/span><span style=\"font-weight: 400;\">\/\/example.com<\/span><span style=\"font-weight: 400;\"> with your desired URL and adjust the shortcode as necessary. <\/div>\n<\/div>\n<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">Key characteristics and use cases of shortcodes<\/span><\/h2>\n<h3><span style=\"font-weight: 400;\">Key characteristics<\/span><\/h3>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Simplicity: Users can add functionalities such as embedding media, creating galleries, or displaying content that requires complex PHP code just by typing a simple shortcode.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Flexibility: Shortcodes can be used in posts, pages, and widgets, offering a versatile solution for adding dynamic content across a site.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Customizability: Apart from the default shortcodes that come with WordPress or plugins, users can create custom shortcodes to perform specific tasks or display custom content, tailored to the needs of their website.<\/span><\/li>\n<\/ul>\n<h3><span style=\"font-weight: 400;\">Common uses of shortcodes<\/span><\/h3>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Embedding media: Shortcodes can be used to easily embed media files like videos and audio files directly into posts or pages.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Creating galleries: With a shortcode, users can create beautiful image galleries by simply specifying the IDs of the images they want to include.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Displaying content conditionally: Some shortcodes can check for certain conditions (like user login status) and display content accordingly.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Integrating plugins: Many plugins provide shortcodes to integrate their features into your site seamlessly. For example, a shortcode from a contact form plugin to display a form anywhere on your site.<\/span><\/li>\n<\/ul>\n<h2>How to use shortcode in WordPress?<\/h2>\n<h3><b>Method 1: Adding a shortcode in WordPress posts and pages<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Adding a shortcode to your WordPress content allows you to insert custom dynamic elements developed by plugins or themes. Here\u2019s a step-by-step guide to doing this efficiently:<\/span><\/p>\n<ol class=\"black\">\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Navigate to your WordPress dashboard.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Go to <\/span><b>Posts<\/b><span style=\"font-weight: 400;\"> or <\/span><b>Pages<\/b><span style=\"font-weight: 400;\"> depending on where you want to add the shortcode.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Choose to either create a new item or edit an existing one.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Click the <\/span><b>+<\/b><span style=\"font-weight: 400;\"> button at the top of the editor to open the block library.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Type <\/span><b>Shortcode<\/b><span style=\"font-weight: 400;\"> in the search bar or find it under the <\/span><b>Widgets<\/b><span style=\"font-weight: 400;\"> section to add the Shortcode block to your content.<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Adding-the-Shortcode-block-to-content-742x416.jpg\" alt=\"Adding the Shortcode block to content\" width=\"742\" height=\"416\" class=\"alignnone size-medium wp-image-36069\" srcset=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Adding-the-Shortcode-block-to-content-742x416.jpg 742w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Adding-the-Shortcode-block-to-content-1484x832.jpg 1484w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Adding-the-Shortcode-block-to-content-150x84.jpg 150w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Adding-the-Shortcode-block-to-content-768x431.jpg 768w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Adding-the-Shortcode-block-to-content-1536x862.jpg 1536w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Adding-the-Shortcode-block-to-content-371x208.jpg 371w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Adding-the-Shortcode-block-to-content-600x337.jpg 600w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Adding-the-Shortcode-block-to-content.jpg 1560w\" sizes=\"auto, (max-width: 742px) 100vw, 742px\" \/><br \/>\n<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Click inside the Shortcode block where it says Write shortcode here\u2026.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Enter the actual shortcode you wish to use (e.g., <\/span><span style=\"font-weight: 400;\">[your_shortcode]<\/span><span style=\"font-weight: 400;\">). Make sure you replace <\/span><span style=\"font-weight: 400;\">[your_shortcode]<\/span><span style=\"font-weight: 400;\"> with the shortcode provided by your plugin or theme.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Use the <\/span><b>Preview<\/b><span style=\"font-weight: 400;\"> button to see how the shortcode executes in the context of your content. This step helps ensure it works as expected and looks integrated.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Adjust the positioning within the content or tweak the surrounding text to better accommodate the shortcode output.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Once you are satisfied with the preview, click <\/span><b>Publish<\/b><span style=\"font-weight: 400;\"> (for new posts or pages) or <\/span><b>Update<\/b><span style=\"font-weight: 400;\"> (if you are editing an existing one) to make the changes live.<\/span><\/li>\n<\/ol>\n<ol><\/ol>\n<p><span style=\"font-weight: 400;\">Adding shortcodes in WordPress editor is straightforward and does not require direct editing of HTML or PHP code, making it accessible for users without programming knowledge.<\/span><\/p>\n<h3><b>Method 2: Adding a shortcode in WordPress sidebar widgets<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Incorporating a shortcode into a sidebar widget can enhance your site&#8217;s functionality by allowing custom content from plugins to be displayed within the sidebar. Follow these steps to do so effectively:<\/span><\/p>\n<ol class=\"black\">\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Access your WordPress dashboard.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Select <\/span><b>Appearance<\/b><span style=\"font-weight: 400;\"> from the left sidebar, and then click on <\/span><b>Widgets<\/b><span style=\"font-weight: 400;\">. This will take you to the widgets management area.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Locate the <\/span><b>Shortcode<\/b><span style=\"font-weight: 400;\"> widget in the available widgets list.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Drag and drop the widget into your desired sidebar area on the right. This area might be labeled as <\/span><b>Main sidebar,<\/b> <b>Footer<\/b><span style=\"font-weight: 400;\">, or another custom sidebar depending on your theme.<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Adding-a-shortcode-in-WordPress-sidebar-widgets--742x416.jpg\" alt=\"Adding a shortcode in WordPress sidebar widgets\" width=\"742\" height=\"416\" class=\"alignnone size-medium wp-image-36070\" srcset=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Adding-a-shortcode-in-WordPress-sidebar-widgets--742x416.jpg 742w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Adding-a-shortcode-in-WordPress-sidebar-widgets--1484x832.jpg 1484w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Adding-a-shortcode-in-WordPress-sidebar-widgets--150x84.jpg 150w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Adding-a-shortcode-in-WordPress-sidebar-widgets--768x431.jpg 768w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Adding-a-shortcode-in-WordPress-sidebar-widgets--1536x862.jpg 1536w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Adding-a-shortcode-in-WordPress-sidebar-widgets--371x208.jpg 371w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Adding-a-shortcode-in-WordPress-sidebar-widgets--600x337.jpg 600w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Adding-a-shortcode-in-WordPress-sidebar-widgets-.jpg 1560w\" sizes=\"auto, (max-width: 742px) 100vw, 742px\" \/><br \/>\n<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">In the text area provided within the widget, enter the shortcode you want to use (e.g., <\/span><span style=\"font-weight: 400;\">[your_shortcode]<\/span><span style=\"font-weight: 400;\">). Replace <\/span><span style=\"font-weight: 400;\">[your_shortcode]<\/span><span style=\"font-weight: 400;\"> with the specific shortcode that triggers the desired functionality.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Click the <\/span><b>Save<\/b><span style=\"font-weight: 400;\"> button on the widget to apply the changes.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Visit the front-end of your website to view the shortcode\u2019s output in the sidebar. This ensures it is working correctly and integrates well with your site\u2019s design.<\/span><\/li>\n<\/ol>\n<ol><\/ol>\n<p><span style=\"font-weight: 400;\">This method allows you to enhance sidebars with custom content managed through shortcodes, offering more flexibility in how content is displayed site-wide.<\/span><\/p>\n<h3><b>Method 3: Adding a shortcode in the old WordPress classic editor<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">If you&#8217;re still utilizing the classic editor in WordPress, here&#8217;s a guide to inserting shortcodes into your posts and pages.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Open the post or page for editing where you need to include the shortcode. You can place the shortcode anywhere within the content editor where you&#8217;d like it to appear. Ensure that the shortcode is on a separate line.<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Adding-a-shortcode-in-the-old-WordPress-classic-editor--742x416.jpg\" alt=\"Adding a shortcode in the old WordPress classic editor\" width=\"742\" height=\"416\" class=\"alignnone size-medium wp-image-36071\" srcset=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Adding-a-shortcode-in-the-old-WordPress-classic-editor--742x416.jpg 742w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Adding-a-shortcode-in-the-old-WordPress-classic-editor--1484x832.jpg 1484w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Adding-a-shortcode-in-the-old-WordPress-classic-editor--150x84.jpg 150w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Adding-a-shortcode-in-the-old-WordPress-classic-editor--768x431.jpg 768w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Adding-a-shortcode-in-the-old-WordPress-classic-editor--1536x862.jpg 1536w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Adding-a-shortcode-in-the-old-WordPress-classic-editor--371x208.jpg 371w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Adding-a-shortcode-in-the-old-WordPress-classic-editor--600x337.jpg 600w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Adding-a-shortcode-in-the-old-WordPress-classic-editor-.jpg 1560w\" sizes=\"auto, (max-width: 742px) 100vw, 742px\" \/><br \/>\n<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Remember to save your modifications. Then, preview your post or page to check how the shortcode works.<\/span><\/p>\n<h3><b>Method 4: Adding a shortcode in WordPress theme files<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">For more advanced customization, you might want to insert a shortcode directly into the theme files. This approach is suitable for users familiar with PHP and file management. Follow these steps to ensure a safe and effective implementation:<\/span><\/p>\n<ol class=\"black\">\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Always start by backing up your WordPress site. This precaution ensures you can restore the original state if anything goes wrong during the editing process.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Use an FTP client to connect to your server and navigate to the <\/span><span style=\"font-weight: 400;\">\/wp-content\/themes\/your-theme\/<\/span><span style=\"font-weight: 400;\"> directory, where <\/span><span style=\"font-weight: 400;\">your-theme<\/span><span style=\"font-weight: 400;\"> is the directory of the theme you are using.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Alternatively, you can access the theme files directly from the WordPress dashboard by going to <\/span><b>Appearance<\/b><span style=\"font-weight: 400;\"> &gt; <\/span><b>Theme editor<\/b><span style=\"font-weight: 400;\">.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Identify the PHP file where you want the shortcode to appear. Common files for this purpose include <\/span><span style=\"font-weight: 400;\">sidebar.php<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">footer.php<\/span><span style=\"font-weight: 400;\">, or <\/span><span style=\"font-weight: 400;\">header.php<\/span><span style=\"font-weight: 400;\">.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Open the file for editing.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Place the following PHP code where you want the shortcode\u2019s output to appear in the file:<\/span><span style=\"font-weight: 400;\"> <\/span><\/li>\n<\/ol>\n<pre><span style=\"font-weight: 400;\">echo<\/span> <span style=\"font-weight: 400;\">do_shortcode<\/span><span style=\"font-weight: 400;\">(<\/span><span style=\"font-weight: 400;\">'[your_shortcode]'<\/span><span style=\"font-weight: 400;\">);<\/span><\/pre>\n<ol start=\"4\" class=\"black\">\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Replace <\/span><span style=\"font-weight: 400;\">[your_shortcode]<\/span><span style=\"font-weight: 400;\"> with the specific shortcode you are implementing.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Save the changes to the PHP file.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Visit your site to confirm that the shortcode executes correctly and displays as intended within the theme structure.<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">This method is powerful but requires caution. Always back up your site before making changes to theme files.<\/span><\/p>\n<h3><b>Method 5: Adding a shortcode in block theme files with the full-site editor<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">The Full Site Editor (FSE) in WordPress represents a significant evolution in theme customization, allowing for direct editing of templates through a block-based interface. Follow these steps to integrate shortcodes into your block theme effectively:<\/span><\/p>\n<ol class=\"black\">\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Navigate to your WordPress dashboard.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Go to <\/span><b>Appearance<\/b><span style=\"font-weight: 400;\"> and select <\/span><b>Editor<\/b><span style=\"font-weight: 400;\">. This will open the Full Site Editor.<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Adding-a-shortcode-in-block-theme-files-with-the-full-site-editor-742x416.jpg\" alt=\"Adding a shortcode in block theme files with the full-site editor\" width=\"742\" height=\"416\" class=\"alignnone size-medium wp-image-36072\" srcset=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Adding-a-shortcode-in-block-theme-files-with-the-full-site-editor-742x416.jpg 742w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Adding-a-shortcode-in-block-theme-files-with-the-full-site-editor-1484x832.jpg 1484w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Adding-a-shortcode-in-block-theme-files-with-the-full-site-editor-150x84.jpg 150w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Adding-a-shortcode-in-block-theme-files-with-the-full-site-editor-768x431.jpg 768w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Adding-a-shortcode-in-block-theme-files-with-the-full-site-editor-1536x862.jpg 1536w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Adding-a-shortcode-in-block-theme-files-with-the-full-site-editor-371x208.jpg 371w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Adding-a-shortcode-in-block-theme-files-with-the-full-site-editor-600x337.jpg 600w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Adding-a-shortcode-in-block-theme-files-with-the-full-site-editor.jpg 1560w\" sizes=\"auto, (max-width: 742px) 100vw, 742px\" \/><br \/>\n<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Within the FSE, you&#8217;ll see your site&#8217;s template structure displayed visually.<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Selecting-the-template-or-template-part-you-wish-to-customize-742x416.jpg\" alt=\"Selecting the template or template part you wish to customize.\" width=\"742\" height=\"416\" class=\"alignnone size-medium wp-image-36073\" srcset=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Selecting-the-template-or-template-part-you-wish-to-customize-742x416.jpg 742w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Selecting-the-template-or-template-part-you-wish-to-customize-1484x832.jpg 1484w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Selecting-the-template-or-template-part-you-wish-to-customize-150x84.jpg 150w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Selecting-the-template-or-template-part-you-wish-to-customize-768x431.jpg 768w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Selecting-the-template-or-template-part-you-wish-to-customize-1536x862.jpg 1536w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Selecting-the-template-or-template-part-you-wish-to-customize-371x208.jpg 371w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Selecting-the-template-or-template-part-you-wish-to-customize-600x337.jpg 600w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Selecting-the-template-or-template-part-you-wish-to-customize.jpg 1560w\" sizes=\"auto, (max-width: 742px) 100vw, 742px\" \/><br \/>\n<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Click on the area where you want to add the shortcode to bring up the block inserter tool.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Search for and select the <\/span><b>Shortcode<\/b><span style=\"font-weight: 400;\"> block from the list of available blocks.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Place the Shortcode block in the desired location within your template.<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Adding-a-shortcode-with-the-full-site-editor--742x416.jpg\" alt=\"Adding a shortcode with the full-site editor\" width=\"742\" height=\"416\" class=\"alignnone size-medium wp-image-36074\" srcset=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Adding-a-shortcode-with-the-full-site-editor--742x416.jpg 742w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Adding-a-shortcode-with-the-full-site-editor--1484x832.jpg 1484w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Adding-a-shortcode-with-the-full-site-editor--150x84.jpg 150w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Adding-a-shortcode-with-the-full-site-editor--768x431.jpg 768w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Adding-a-shortcode-with-the-full-site-editor--1536x862.jpg 1536w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Adding-a-shortcode-with-the-full-site-editor--371x208.jpg 371w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Adding-a-shortcode-with-the-full-site-editor--600x337.jpg 600w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Adding-a-shortcode-with-the-full-site-editor-.jpg 1560w\" sizes=\"auto, (max-width: 742px) 100vw, 742px\" \/><br \/>\n<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Click inside the Shortcode block and type the shortcode you want to use (e.g., <\/span><span style=\"font-weight: 400;\">[your_shortcode]<\/span><span style=\"font-weight: 400;\">).<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Replace <\/span><span style=\"font-weight: 400;\">[your_shortcode]<\/span><span style=\"font-weight: 400;\"> with the specific shortcode provided by your plugin or custom code.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">After entering the shortcode, click the <\/span><b>Save<\/b><span style=\"font-weight: 400;\"> button at the top right to save your changes to the template.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Ensure to save the overall changes to the site if prompted, which may include updating other template parts or global styles.<\/span><\/li>\n<\/ol>\n<ol><\/ol>\n<ol><\/ol>\n<ol><\/ol>\n<p><span style=\"font-weight: 400;\">This method integrates shortcodes seamlessly into the block-based theme structure.<\/span><\/p>\n<h3><b>Method 6: Creating your own custom shortcode in WordPress<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Creating custom shortcodes allows you to add unique functionality to your WordPress site that can be reused across posts, pages, or widgets. Follow these steps to create and use a custom shortcode effectively:<\/span><\/p>\n<ol class=\"black\">\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Decide whether to add the custom code directly to your theme\u2019s <\/span><span style=\"font-weight: 400;\">functions.php<\/span><span style=\"font-weight: 400;\"> file or a site-specific plugin. Using a plugin is generally safer because your changes will persist even if you change your theme.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Open your <\/span><span style=\"font-weight: 400;\">functions.php<\/span><span style=\"font-weight: 400;\"> file or your custom plugin file.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Define a new function that encapsulates the functionality you want to add. For example, to display the current year:<\/span><\/li>\n<\/ol>\n<pre><span style=\"font-weight: 400;\">function<\/span> <span style=\"font-weight: 400;\">show_current_year<\/span><span style=\"font-weight: 400;\">() {<\/span>\r\n\r\n<span style=\"font-weight: 400;\"> <\/span><span style=\"font-weight: 400;\">return<\/span> <span style=\"font-weight: 400;\">date<\/span><span style=\"font-weight: 400;\">(<\/span><span style=\"font-weight: 400;\">'Y'<\/span><span style=\"font-weight: 400;\">)<\/span><\/pre>\n<ol start=\"4\" class=\"black\">\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Below the function, use the <\/span><span style=\"font-weight: 400;\">add_shortcode()<\/span><span style=\"font-weight: 400;\"> function to register your new shortcode with WordPress:<\/span><\/li>\n<\/ol>\n<pre><span style=\"font-weight: 400;\">add_shortcode<\/span><span style=\"font-weight: 400;\">(<\/span><span style=\"font-weight: 400;\">'current_year'<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">'show_current_year'<\/span><span style=\"font-weight: 400;\">);<\/span><\/pre>\n<ol start=\"5\" class=\"black\">\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">The first parameter is the shortcode tag (<\/span><span style=\"font-weight: 400;\">current_year<\/span><span style=\"font-weight: 400;\">), which users will type within brackets (e.g., <\/span><span style=\"font-weight: 400;\">[current_year]<\/span><span style=\"font-weight: 400;\">) in their posts or widgets.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">The second parameter is the name of the function you just defined (<\/span><span style=\"font-weight: 400;\">show_current_year<\/span><span style=\"font-weight: 400;\">).<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Now, you can insert <\/span><span style=\"font-weight: 400;\">[current_year]<\/span><span style=\"font-weight: 400;\"> in posts, pages, widgets, or even in PHP files through the <\/span><span style=\"font-weight: 400;\">do_shortcode(&#8216;[current_year]&#8217;);<\/span><span style=\"font-weight: 400;\"> function. This shortcode will output the current year wherever it is used.<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">By following these instructions, you can create a versatile shortcode that adds significant functionality to your WordPress site.<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">If you decide to use a plugin, you have to install the WPcode plugin.<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Installing-the-WPcode-plugin-742x416.jpg\" alt=\"Installing the WPcode plugin\" width=\"742\" height=\"416\" class=\"alignnone size-medium wp-image-36075\" srcset=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Installing-the-WPcode-plugin-742x416.jpg 742w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Installing-the-WPcode-plugin-1484x832.jpg 1484w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Installing-the-WPcode-plugin-150x84.jpg 150w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Installing-the-WPcode-plugin-768x431.jpg 768w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Installing-the-WPcode-plugin-1536x862.jpg 1536w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Installing-the-WPcode-plugin-371x208.jpg 371w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Installing-the-WPcode-plugin-600x337.jpg 600w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Installing-the-WPcode-plugin.jpg 1560w\" sizes=\"auto, (max-width: 742px) 100vw, 742px\" \/><br \/>\n<\/span><\/li>\n<\/ul>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">After it is activated find the <\/span><b>Code snippets<\/b><span style=\"font-weight: 400;\"> choose <\/span><b>+ Add snippet<\/b><span style=\"font-weight: 400;\"> and add the code there.<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Adding-the-code-in-WPcode-plugin--742x416.jpg\" alt=\"Adding the code in WPcode plugin\" width=\"742\" height=\"416\" class=\"alignnone size-medium wp-image-36076\" srcset=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Adding-the-code-in-WPcode-plugin--742x416.jpg 742w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Adding-the-code-in-WPcode-plugin--1484x832.jpg 1484w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Adding-the-code-in-WPcode-plugin--150x84.jpg 150w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Adding-the-code-in-WPcode-plugin--768x431.jpg 768w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Adding-the-code-in-WPcode-plugin--1536x862.jpg 1536w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Adding-the-code-in-WPcode-plugin--371x208.jpg 371w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Adding-the-code-in-WPcode-plugin--600x337.jpg 600w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Adding-the-code-in-WPcode-plugin-.jpg 1560w\" sizes=\"auto, (max-width: 742px) 100vw, 742px\" \/><br \/>\n<\/span><\/li>\n<\/ul>\n<h2><b>Shortcodes vs. Gutenberg blocks<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">When deciding between using shortcodes and Gutenberg blocks in WordPress, consider the following key points:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Gutenberg blocks offer a visual, user-friendly interface perfect for those who prefer to see changes as they happen. They integrate seamlessly with WordPress&#8217;s site-wide editing features and are designed with accessibility in mind, making them a great choice for users who value intuitive design and ease of use.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Shortcodes, on the other hand, are ideal for those comfortable with coding. They offer flexibility for embedding specialized functionalities that blocks might not support. Shortcodes are also crucial for ensuring older themes or legacy content remains functional, providing an essential tool for long-standing WordPress sites.<\/span><\/p>\n<h3><span style=\"font-weight: 400;\">The difference between blocks and shortcodes <\/span><\/h3>\n<table class=\"tenweb-table-new\">\n<tbody>\n<tr>\n<td><\/td>\n<td><b>Shortcodes<\/b><\/td>\n<td><b>Gutenberg blocks<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">User interface preference<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Code based approach<\/span><\/td>\n<td><span style=\"font-weight: 400;\">For visual editing<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Functionality needs<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Custom integrations<\/span><\/td>\n<td><span style=\"font-weight: 400;\">General content and design<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Technical proficiency<\/span><\/td>\n<td><span style=\"font-weight: 400;\">For advanced users<\/span><\/td>\n<td><span style=\"font-weight: 400;\">For users with less expertise<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Compatibility\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Wide range of themes and plugins<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Block-compatible themes and plugins<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2><span style=\"font-weight: 400;\">Conclusion<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Shortcodes are an integral feature of WordPress that provides a streamlined approach to adding dynamic content and functionality to your website. By understanding how to add and customize shortcodes, you can significantly enhance the user experience and efficiency of your site management. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">Whether through simple additions in posts and widgets or by integrating custom code into your theme files, the flexibility of shortcodes is invaluable. As WordPress continues to evolve, particularly with the increasing use of the Block Editor, shortcodes remain a fundamental tool for both novice and experienced developers, bridging ease of use with powerful website customization.<\/span><br \/>\n\r\n<style>\r\n  #ctablocks_scrollbox-with-icon_91{\r\n            color: #ffffff;\r\n    border-radius: 6px;\r\n  }\r\n\r\n  #ctablocks_scrollbox-with-icon_91 p{\r\n    color: #ffffff;\r\n  }\r\n  #ctablocks_scrollbox-with-icon_91 .button{\r\n          background-color: rgb(51,57,241);\r\n        color: #ffffff;\r\n    border-color: #3339f1 !important;\r\n  }\r\n  #ctablocks_scrollbox-with-icon_91 .button:hover{\r\n    background: rgba(51,57,241,0.8);\r\n    color: #ffffff;\r\n    opacity: 1;\r\n  }\r\n  #ctablocks_scrollbox-with-icon_91.ctablocks_container {\r\n    left: 100%;\r\n  }\r\n  @media screen and (max-width: 1300px) {\r\n      #ctablocks_scrollbox-with-icon_91.ctablocks_container {\r\n          left: 0;\r\n          margin: 0 auto;\r\n      }\r\n  }\r\n  #ctablocks_scrollbox-with-icon_91 .ctablocks_content {\r\n      background-color: #000000;\r\n  }\r\n<\/style>\r\n<div id=\"ctablocks_scrollbox-with-icon_91\" class=\"ctablocks_container scrollbox-with-icon_type\r\n      \">\r\n\r\n  <div class=\"ctablocks_content clear\">\r\n    <div class=\"ctablocks_content_info\">\r\n              <h4>Simplify WordPress with 10Web<\/h4>\r\n        <h4 class=\"mobile-title\">Simplify WordPress with 10Web<\/h4>\r\n              <p>Skip and automate manual work with 10Web Managed WordPress Hosting and the 10Web AI Website Builder.<\/p>\r\n          <\/div>\r\n    <div class=\"ctablocks_content_button\">\r\n              <a href=\"https:\/\/10web.io\/ai-website-builder\/\" class=\"button\" data-gtag=\"sign-up-blog\" data-buttontype=\"sign-up\" data-gtag=\"cta-91\" data-buttontype=\"cta-scrollbox-with-icon\"\r\n\t        >Learn How<\/a>\r\n            \r\n    <\/div>\r\n  <\/div>\r\n    <span class=\"close_ctablocks\">\r\n      <img decoding=\"async\" class=\"close-icon\" src=\"https:\/\/10web.io\/blog\/wp-content\/plugins\/cta-blocks\/assets\/images\/close_w.svg\" class=\"close\">\r\n      <img decoding=\"async\" class=\"floating-icon\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Info-icon_Blog.png\" alt=\"Simplify WordPress with 10Web\" title=\"Simplify WordPress with 10Web\">\r\n<!--      <img decoding=\"async\" class=\"arrow-icon white\" src=\"\/cta-blocks\/assets\/images\/arrow-icon.svg\" class=\"close\">\r\n-->      <img decoding=\"async\" class=\"arrow-icon purple\" src=\"https:\/\/10web.io\/blog\/wp-content\/plugins\/cta-blocks\/assets\/images\/arrow-icon-purple.svg\" class=\"close\">\r\n  <\/span>\r\n<\/div>\r\n<br \/>\n <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Shortcodes in WordPress are a powerful feature that allows users to execute code within posts, pages, and widgets without having to write lengthy code each time. Whether you&#8217;re looking to embed files, create objects, or execute functions, shortcodes streamline the process, making it accessible even for those with limited coding knowledge. This guide will walk you through the various ways&#8230;<\/p>\n","protected":false},"author":11,"featured_media":34945,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"two_page_speed":[],"footnotes":"","tenweb_blog_toc":"<ul>\r\n\t<li>\r\n\t\t<a href=\"#faq\">FAQ<\/a>\r\n\t<\/li>\r\n\t<li>\r\n\t\t<a href=\"#key-characteristics-and-use-cases-of-shortcodes\">Key characteristics and use cases of shortcodes<\/a>\r\n\t\t<ul>\r\n\t\t\t<li>\r\n\t\t\t\t<a href=\"#key-characteristics\">Key characteristics<\/a>\r\n\t\t\t<\/li>\r\n\t\t\t<li>\r\n\t\t\t\t<a href=\"#common-uses-of-shortcodes\">Common uses of shortcodes<\/a>\r\n\t\t\t<\/li>\r\n\t\t<\/ul>\r\n\t<\/li>\r\n\t<li>\r\n\t\t<a href=\"#how-to-use-shortcode-in-wordpress\">How to use shortcode in WordPress?<\/a>\r\n\t\t<ul>\r\n\t\t\t<li>\r\n\t\t\t\t<a href=\"#method-1-adding-a-shortcode-in-wordpress-posts-and-pages\">Method 1: Adding a shortcode in WordPress posts and pages<\/a>\r\n\t\t\t<\/li>\r\n\t\t\t<li>\r\n\t\t\t\t<a href=\"#method-2-adding-a-shortcode-in-wordpress-sidebar-widgets\">Method 2: Adding a shortcode in WordPress sidebar widgets<\/a>\r\n\t\t\t<\/li>\r\n\t\t\t<li>\r\n\t\t\t\t<a href=\"#method-3-adding-a-shortcode-in-the-old-wordpress-classic-editor\">Method 3: Adding a shortcode in the old WordPress classic editor<\/a>\r\n\t\t\t<\/li>\r\n\t\t\t<li>\r\n\t\t\t\t<a href=\"#method-4-adding-a-shortcode-in-wordpress-theme-files\">Method 4: Adding a shortcode in WordPress theme files<\/a>\r\n\t\t\t<\/li>\r\n\t\t\t<li>\r\n\t\t\t\t<a href=\"#method-5-adding-a-shortcode-in-block-theme-files-with-the-full-site-editor\">Method 5: Adding a shortcode in block theme files with the full-site editor<\/a>\r\n\t\t\t<\/li>\r\n\t\t\t<li>\r\n\t\t\t\t<a href=\"#method-6-creating-your-own-custom-shortcode-in-wordpress\">Method 6: Creating your own custom shortcode in WordPress<\/a>\r\n\t\t\t<\/li>\r\n\t\t<\/ul>\r\n\t<\/li>\r\n\t<li>\r\n\t\t<a href=\"#shortcodes-vs-gutenberg-blocks\">Shortcodes vs. Gutenberg blocks<\/a>\r\n\t\t<ul>\r\n\t\t\t<li>\r\n\t\t\t\t<a href=\"#the-difference-between-blocks-and-shortcodes\">The difference between blocks and shortcodes<\/a>\r\n\t\t\t<\/li>\r\n\t\t<\/ul>\r\n\t<\/li>\r\n\t<li>\r\n\t\t<a href=\"#conclusion\">Conclusion<\/a>\r\n\t<\/li>\r\n<\/ul>\r\n","tenweb_blog_competitor_type":"","tenweb_blog_competitor_names":"","tenweb_blog_twb_version":0,"tenweb_blog_type":""},"categories":[463],"tags":[],"class_list":["post-36066","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-guides"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v23.0 (Yoast SEO v23.0) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Use Shortcode in WordPress: 6 Proven Methods - 10Web<\/title>\n<meta name=\"description\" content=\"Discover 6 proven methods to use shortcodes in WordPress effectively. Enhance site functionality with ease using this step-by-step guide.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/10web.io\/blog\/how-to-use-shortcode-in-wordpress\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Use Shortcode in WordPress: 6 Proven Methods\" \/>\n<meta property=\"og:description\" content=\"Discover 6 proven methods to use shortcodes in WordPress effectively. Enhance site functionality with ease using this step-by-step guide.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/10web.io\/blog\/how-to-use-shortcode-in-wordpress\/\" \/>\n<meta property=\"og:site_name\" content=\"10Web - Build &amp; Host Your WordPress Website\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/10Web.io\/\" \/>\n<meta property=\"article:published_time\" content=\"2024-04-17T14:22:22+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-24T11:15:21+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/use_shortcode_in_wordpress.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1569\" \/>\n\t<meta property=\"og:image:height\" content=\"880\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Tigran Nazaryan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@10Web_io\" \/>\n<meta name=\"twitter:site\" content=\"@10Web_io\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Tigran Nazaryan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to Use Shortcode in WordPress: 6 Proven Methods - 10Web","description":"Discover 6 proven methods to use shortcodes in WordPress effectively. Enhance site functionality with ease using this step-by-step guide.","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:\/\/10web.io\/blog\/how-to-use-shortcode-in-wordpress\/","og_locale":"en_US","og_type":"article","og_title":"How to Use Shortcode in WordPress: 6 Proven Methods","og_description":"Discover 6 proven methods to use shortcodes in WordPress effectively. Enhance site functionality with ease using this step-by-step guide.","og_url":"https:\/\/10web.io\/blog\/how-to-use-shortcode-in-wordpress\/","og_site_name":"10Web - Build &amp; Host Your WordPress Website","article_publisher":"https:\/\/www.facebook.com\/10Web.io\/","article_published_time":"2024-04-17T14:22:22+00:00","article_modified_time":"2024-04-24T11:15:21+00:00","og_image":[{"width":1569,"height":880,"url":"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/use_shortcode_in_wordpress.jpg","type":"image\/jpeg"}],"author":"Tigran Nazaryan","twitter_card":"summary_large_image","twitter_creator":"@10Web_io","twitter_site":"@10Web_io","twitter_misc":{"Written by":"Tigran Nazaryan","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/10web.io\/blog\/how-to-use-shortcode-in-wordpress\/#article","isPartOf":{"@id":"https:\/\/10web.io\/blog\/how-to-use-shortcode-in-wordpress\/"},"author":{"name":"Tigran Nazaryan","@id":"https:\/\/10web.io\/blog\/#\/schema\/person\/9466e64f67fc213397b384bbe3af3bd0"},"headline":"How to Use Shortcode in WordPress: 6 Proven Methods","datePublished":"2024-04-17T14:22:22+00:00","dateModified":"2024-04-24T11:15:21+00:00","mainEntityOfPage":{"@id":"https:\/\/10web.io\/blog\/how-to-use-shortcode-in-wordpress\/"},"wordCount":1920,"commentCount":0,"publisher":{"@id":"https:\/\/10web.io\/blog\/#organization"},"image":{"@id":"https:\/\/10web.io\/blog\/how-to-use-shortcode-in-wordpress\/#primaryimage"},"thumbnailUrl":"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/use_shortcode_in_wordpress.jpg","articleSection":["Guides"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/10web.io\/blog\/how-to-use-shortcode-in-wordpress\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/10web.io\/blog\/how-to-use-shortcode-in-wordpress\/","url":"https:\/\/10web.io\/blog\/how-to-use-shortcode-in-wordpress\/","name":"How to Use Shortcode in WordPress: 6 Proven Methods - 10Web","isPartOf":{"@id":"https:\/\/10web.io\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/10web.io\/blog\/how-to-use-shortcode-in-wordpress\/#primaryimage"},"image":{"@id":"https:\/\/10web.io\/blog\/how-to-use-shortcode-in-wordpress\/#primaryimage"},"thumbnailUrl":"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/use_shortcode_in_wordpress.jpg","datePublished":"2024-04-17T14:22:22+00:00","dateModified":"2024-04-24T11:15:21+00:00","description":"Discover 6 proven methods to use shortcodes in WordPress effectively. Enhance site functionality with ease using this step-by-step guide.","breadcrumb":{"@id":"https:\/\/10web.io\/blog\/how-to-use-shortcode-in-wordpress\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/10web.io\/blog\/how-to-use-shortcode-in-wordpress\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/10web.io\/blog\/how-to-use-shortcode-in-wordpress\/#primaryimage","url":"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/use_shortcode_in_wordpress.jpg","contentUrl":"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/use_shortcode_in_wordpress.jpg","width":1569,"height":880},{"@type":"BreadcrumbList","@id":"https:\/\/10web.io\/blog\/how-to-use-shortcode-in-wordpress\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/10web.io\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Use Shortcode in WordPress: 6 Proven Methods"}]},{"@type":"WebSite","@id":"https:\/\/10web.io\/blog\/#website","url":"https:\/\/10web.io\/blog\/","name":"10Web Blog - Build & Host Your WordPress Website","description":"10Web is an All-in-One Website Building Platform, offering Managed WordPress Hosting on Google Cloud, Beautiful Templates, Premium Plugins and Services.","publisher":{"@id":"https:\/\/10web.io\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/10web.io\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/10web.io\/blog\/#organization","name":"10Web","url":"https:\/\/10web.io\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/10web.io\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2025\/04\/Logo-768x686-1.png","contentUrl":"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2025\/04\/Logo-768x686-1.png","width":768,"height":686,"caption":"10Web"},"image":{"@id":"https:\/\/10web.io\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/10Web.io\/","https:\/\/x.com\/10Web_io","https:\/\/www.instagram.com\/10web.io\/","https:\/\/www.linkedin.com\/company\/10web\/mycompany\/","https:\/\/www.youtube.com\/c\/10Web"]},{"@type":"Person","@id":"https:\/\/10web.io\/blog\/#\/schema\/person\/9466e64f67fc213397b384bbe3af3bd0","name":"Tigran Nazaryan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/10web.io\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/ce2393558e7591a237212f11acac58fb?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ce2393558e7591a237212f11acac58fb?s=96&d=mm&r=g","caption":"Tigran Nazaryan"},"description":"Tigran Nazaryan is an experienced science and technology professional. After seeing great potential in the automation of web development, he co-founded and became CInO of 10Web. Tigran is passionate about creating solutions to bring AI automation into web development and turning great ideas into powerful technological achievements.","sameAs":["https:\/\/www.linkedin.com\/in\/tnazaryan\/"],"url":"https:\/\/10web.io\/blog\/author\/tigran\/"}]}},"acf":[],"_links":{"self":[{"href":"https:\/\/10web.io\/blog\/wp-json\/wp\/v2\/posts\/36066","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/10web.io\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/10web.io\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/10web.io\/blog\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/10web.io\/blog\/wp-json\/wp\/v2\/comments?post=36066"}],"version-history":[{"count":0,"href":"https:\/\/10web.io\/blog\/wp-json\/wp\/v2\/posts\/36066\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/10web.io\/blog\/wp-json\/wp\/v2\/media\/34945"}],"wp:attachment":[{"href":"https:\/\/10web.io\/blog\/wp-json\/wp\/v2\/media?parent=36066"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/10web.io\/blog\/wp-json\/wp\/v2\/categories?post=36066"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/10web.io\/blog\/wp-json\/wp\/v2\/tags?post=36066"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}