{"id":2852,"date":"2023-07-25T12:05:55","date_gmt":"2023-07-25T06:35:55","guid":{"rendered":"https:\/\/hostkicker.com\/blog\/?p=2852"},"modified":"2023-07-25T12:08:12","modified_gmt":"2023-07-25T06:38:12","slug":"easy-guide-to-adding-custom-code-in-wordpress","status":"publish","type":"post","link":"https:\/\/hostkicker.com\/blog\/easy-guide-to-adding-custom-code-in-wordpress\/","title":{"rendered":"Easy guide to adding custom code in WordPress"},"content":{"rendered":"<p><span data-preserver-spaces=\"true\">Do you often require to add custom code to your website and are looking for an easy and secure way to add it? Here&#8217;s how you can easily add custom code in WordPress site without breaking it.\u00a0\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">Adding custom code snippets in WordPress is often done by editing the theme&#8217;s function.php file or using a site-specific plugin.\u00a0\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">However, the major concern with adding a custom code is that even a small mistake can break the entire website, impacting your visibility on the internet.\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">If you are here to learn the easy way to add the custom code snippet to your site, continue reading the blog till the end. This simple guide will provide you with an easy-to-understand method for adding code and preventing your site from breaking.\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">So, without further ado, let&#8217;s get started!<\/span><\/p>\n<h2><strong><span data-preserver-spaces=\"true\">Why adding custom code in WordPress is a major concern?<\/span><\/strong><\/h2>\n<p><span data-preserver-spaces=\"true\">While managing and customizing a WordPress site, you might need to add code snippets using the function.php file of your theme or a site-specific plugin. Both are effective methods, but the major concern is that even the slightest mistake in your custom code can break your site, making it inaccessible to your users.\u00a0\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">Also, adding the code snippet to your theme&#8217;s function.php file may not be suitable if you update your theme on a frequent basis. This is because updating your theme would remove all the customizations you implemented on your site.\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">On the contrary, if your use a site-specific plugin for adding code snippets, then adding multiple code snippets can make it difficult for you to manage the file.\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">That is why you must use a more adjustable and easier way to add and manage custom code in WordPress, which we will provide you in this blog.\u00a0<\/span><\/p>\n<h2><strong><span data-preserver-spaces=\"true\">How to add custom code in WordPress?<\/span><\/strong><\/h2>\n<p><span data-preserver-spaces=\"true\">There are various code snippet plugins you can use to add custom code snippets to your site. However, to ease your search, we&#8217;ve discovered the top and most favored code snippet plugin that you can use for your website. That is\u00a0<\/span><a class=\"editor-rtfLink\" href=\"https:\/\/wpcode.com\/\" target=\"_blank\" rel=\"noopener\"><span data-preserver-spaces=\"true\">WPCode.<\/span><\/a><span data-preserver-spaces=\"true\">\u00a0<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2853\" src=\"https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2023\/07\/WPCode-Plugin.png\" alt=\"\" width=\"1221\" height=\"612\" srcset=\"https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2023\/07\/WPCode-Plugin.png 1221w, https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2023\/07\/WPCode-Plugin-300x150.png 300w, https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2023\/07\/WPCode-Plugin-1024x513.png 1024w, https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2023\/07\/WPCode-Plugin-768x385.png 768w\" sizes=\"auto, (max-width: 1221px) 100vw, 1221px\" \/><\/p>\n<p><span data-preserver-spaces=\"true\">It&#8217;s a popular plugin that lets you easily add code snippets in WordPress easily, without requiring you to edit the function.php file of your theme.\u00a0\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">WPCode comes with a smart code snippet validation feature that helps you prevent common code errors and prevent your site from breaking.\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">It also comes with an in-built snippet library where you can discover various popular WordPress code snippets which you can use for your site, such as disable comments, disable Gutenberg, disable REST API, and more.\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">Moreover, the plugin allows you to manage all your code snippets from one place and adds tags to organize them.\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">The plugin WPCode comes with free as well as paid versions. The free version also includes all the basic features you&#8217;d need to add custom code snippets to your website.\u00a0\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">So, here&#8217;s the easiest way to add custom code in WordPress using WPCode.\u00a0<\/span><\/p>\n<h2><strong><span data-preserver-spaces=\"true\">Adding Custom code in WordPress using WPCode.<\/span><\/strong><\/h2>\n<p><span data-preserver-spaces=\"true\">To get started with WPCode, you first need to install and activate it on your site. If you are new to plugin installation, you can also refer to our guide on\u00a0<\/span><a class=\"editor-rtfLink\" href=\"https:\/\/hostkicker.com\/blog\/how-to-install-a-wordpress-plugin\/\" target=\"_blank\" rel=\"noopener\"><span data-preserver-spaces=\"true\">how to install the WordPress plugin<\/span><\/a><span data-preserver-spaces=\"true\">.\u00a0\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">Once done, you can see that the plugin adds a new menu, &#8216;Code Snippets,&#8217; to your WP.<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">Now, click on the &#8216;Code Snippets&#8217; option to begin with WPCode. This will open a screen where you&#8217;ll witness all the code snippets you&#8217;ll add to your site.\u00a0 \u00a0\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">Then, click on the &#8216;Add New&#8217; tab to add your custom code snippet to your site.\u00a0<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2854\" src=\"https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2023\/07\/adding-new-snippet-in-wpcode.png\" alt=\"\" width=\"680\" height=\"339\" srcset=\"https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2023\/07\/adding-new-snippet-in-wpcode.png 680w, https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2023\/07\/adding-new-snippet-in-wpcode-300x150.png 300w\" sizes=\"auto, (max-width: 680px) 100vw, 680px\" \/><\/p>\n<p><span data-preserver-spaces=\"true\">After clicking on this, a new &#8216;Add Snippet&#8217; page will open, where you either add a new custom code or select a code snippet from the pre-made library.\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">Now to add a new customs code snippet, click on the &#8216;Use Snippet&#8217; tab below the &#8216;Add Your Custom Code&#8217; option.\u00a0<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2855\" src=\"https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2023\/07\/select-add-custom-code-new-snippet.png\" alt=\"\" width=\"680\" height=\"360\" srcset=\"https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2023\/07\/select-add-custom-code-new-snippet.png 680w, https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2023\/07\/select-add-custom-code-new-snippet-300x159.png 300w\" sizes=\"auto, (max-width: 680px) 100vw, 680px\" \/><\/p>\n<p><span data-preserver-spaces=\"true\">Enter a title for your custom code and then copy and paste your code snippet into the code box. Then select the right &#8216;Code Type&#8217; from the right drop-down menu.\u00a0<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2856\" src=\"https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2023\/07\/create-custom-snippet.png\" alt=\"\" width=\"680\" height=\"316\" srcset=\"https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2023\/07\/create-custom-snippet.png 680w, https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2023\/07\/create-custom-snippet-300x139.png 300w\" sizes=\"auto, (max-width: 680px) 100vw, 680px\" \/><\/p>\n<p><span data-preserver-spaces=\"true\">For this tutorial, we are using a code snippet to remove the WP version number from the WP site.\u00a0<\/span><\/p>\n<pre>1 function\u00a0wpb_remove_version() {\r\n\r\n2 return\u00a0\";\r\n\r\n3 }\r\n\r\n<span data-preserver-spaces=\"true\">4 add_filter('the_generator', 'wpb_remove_version');<\/span><\/pre>\n<p><span data-preserver-spaces=\"true\">After adding the code, you&#8217;ll see two code insertion methods: Auto Insert and Shortcode(Default).<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2857\" src=\"https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2023\/07\/insertion-options-in-wpcode.png\" alt=\"\" width=\"680\" height=\"230\" srcset=\"https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2023\/07\/insertion-options-in-wpcode.png 680w, https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2023\/07\/insertion-options-in-wpcode-300x101.png 300w\" sizes=\"auto, (max-width: 680px) 100vw, 680px\" \/><\/p>\n<p><span data-preserver-spaces=\"true\">The auto-insert method will automatically insert the code snippet and execute it on your site.\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">Note that you can automatically run the code snippet only in the WP admin area, on your site&#8217;s front end, or anywhere. If you are unsure of this, you can opt for the second shortcode (Default) option.\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">The shortcode method works differently and doesn&#8217;t automatically insert the code snippet. With this method, when you save the code snippet, it will provide you with a shortcode specific to the code that you can use anywhere on your site.\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">Now, scroll down to the &#8216;Basic info&#8217; section. Here you can add the basic details concerning your code.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2858\" src=\"https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2023\/07\/enter-basic-info-in-wpcode.png\" alt=\"\" width=\"680\" height=\"241\" srcset=\"https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2023\/07\/enter-basic-info-in-wpcode.png 680w, https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2023\/07\/enter-basic-info-in-wpcode-300x106.png 300w\" sizes=\"auto, (max-width: 680px) 100vw, 680px\" \/><\/p>\n<p><span data-preserver-spaces=\"true\">Here, you&#8217;ll witness three different options: Tag, Priority, and Note.<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">The tag option will help help you sort your codes by topics and functions. The priority field will help you assign a number to your code. This allows you to decide the order of the snippet that must be executed when you want to display various snippets at the same place on your site. By default, the priority is set to 10, and you can set it as per your choice. In the third &#8216;Note&#8217; field, you can add notes about your code, like what it is for and more.\u00a0 \u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">Next, look for the &#8216;Smart Conditional Logic&#8217; section.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2859\" src=\"https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2023\/07\/adjust-smart-conditional-logic.png\" alt=\"\" width=\"680\" height=\"329\" srcset=\"https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2023\/07\/adjust-smart-conditional-logic.png 680w, https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2023\/07\/adjust-smart-conditional-logic-300x145.png 300w\" sizes=\"auto, (max-width: 680px) 100vw, 680px\" \/><\/p>\n<p><span data-preserver-spaces=\"true\">There you can enable or disable the auto-inserted options as per the set rules. You can change the settings as per your desire.\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">Once you are finished with all the settings, scroll up to the top of the screen. Then toggle the button from &#8216;Inactive&#8217; to &#8216;Active.&#8217;\u00a0<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2860\" src=\"https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2023\/07\/select-save-snippet-in-wpcode.png\" alt=\"\" width=\"680\" height=\"306\" srcset=\"https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2023\/07\/select-save-snippet-in-wpcode.png 680w, https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2023\/07\/select-save-snippet-in-wpcode-300x135.png 300w\" sizes=\"auto, (max-width: 680px) 100vw, 680px\" \/><\/p>\n<p><span data-preserver-spaces=\"true\">After that, click on the &#8216;Save Snippet&#8217; tab to store your changes.\u00a0 \u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">You can also save the code snippet without activating it. For this, simply save the snippet without clicking on the &#8216;Activate&#8217; tab.\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">If you&#8217;ve saved and activated the code snippet to your site, it will be added to your site automatically if you opted for the auto-insert option or displayed ad a shortcode.\u00a0\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">That&#8217;s it. You&#8217;ve successfully learned to add custom code in WordPress.\u00a0<\/span><\/p>\n<h2><strong><span data-preserver-spaces=\"true\">How to handle custom code errors?<\/span><\/strong><\/h2>\n<p><span data-preserver-spaces=\"true\">If you make a mistake in your custom code while adding it to the function.php file of your theme or in your site-specific plugin, then your site will immediately become inaccessible, and you&#8217;d witness a 500 internal server error or a syntax error.\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">Now, to fix this error, you&#8217;ll need to manually inactive your code using an FTP client.\u00a0\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">The best part of using the WPCode plugin is that it automatically detects a syntax error in the code snippet and deactivates the code immediately. <\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2864\" src=\"https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2023\/07\/fixing-code-snippet-error.png\" alt=\"\" width=\"680\" height=\"325\" srcset=\"https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2023\/07\/fixing-code-snippet-error.png 680w, https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2023\/07\/fixing-code-snippet-error-300x143.png 300w\" sizes=\"auto, (max-width: 680px) 100vw, 680px\" \/><\/p>\n<p><span data-preserver-spaces=\"true\">The plugin will also display an error message suggesting you fix the error and try it again.\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">Also, the plugin&#8217;s smart code snippet validation feature will also detect the error while adding the custom code.\u00a0\u00a0<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2865\" src=\"https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2023\/07\/smart-code-validation-in-wpcode.png\" alt=\"\" width=\"680\" height=\"362\" srcset=\"https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2023\/07\/smart-code-validation-in-wpcode.png 680w, https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2023\/07\/smart-code-validation-in-wpcode-300x160.png 300w\" sizes=\"auto, (max-width: 680px) 100vw, 680px\" \/><\/p>\n<p><span data-preserver-spaces=\"true\">To fix this, you need to hover over the error message. This will provide you with instructions to fix it.\u00a0<\/span><\/p>\n<h2><strong><span data-preserver-spaces=\"true\">How to manage your custom code snippets in WPCode?<\/span><\/strong><\/h2>\n<p><span data-preserver-spaces=\"true\">WPCode is a user-friendly plugin that comes with an intuitive interface. It lets you easily manage your custom code snippets on your WordPress site.\u00a0\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">The plugin allows you to save your code snippets without activating them. You can simply activate or deactivate them as and when needed.\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">WPCode also allows you to filter your code snippets by their types and location and easily organize them using tags. <img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2866\" src=\"https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2023\/07\/All-snippets-in-wpcode.png\" alt=\"\" width=\"773\" height=\"510\" srcset=\"https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2023\/07\/All-snippets-in-wpcode.png 773w, https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2023\/07\/All-snippets-in-wpcode-300x198.png 300w, https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2023\/07\/All-snippets-in-wpcode-768x507.png 768w\" sizes=\"auto, (max-width: 773px) 100vw, 773px\" \/><\/span><\/p>\n<p><span data-preserver-spaces=\"true\">In addition, the plugin lets you export a specific code or bulk export all easily. For this, you can navigate to Code Snippets &gt;&gt; Tools and select the &#8216;Export&#8217; button to export the code.\u00a0\u00a0<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2862\" src=\"https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2023\/07\/export-snippets-in-wpcode.png\" alt=\"\" width=\"680\" height=\"411\" srcset=\"https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2023\/07\/export-snippets-in-wpcode.png 680w, https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2023\/07\/export-snippets-in-wpcode-300x181.png 300w\" sizes=\"auto, (max-width: 680px) 100vw, 680px\" \/><\/p>\n<p><span data-preserver-spaces=\"true\">Furthermore, you can also easily import your code snippets to your site if you are migrating to a different server.\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">For this, you need to head over to the Code Snippets &gt;&gt; Tools &gt;&gt; Import page. <\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2863\" src=\"https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2023\/07\/import-code-snippets-in-wpcode.png\" alt=\"\" width=\"680\" height=\"464\" srcset=\"https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2023\/07\/import-code-snippets-in-wpcode.png 680w, https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2023\/07\/import-code-snippets-in-wpcode-300x205.png 300w\" sizes=\"auto, (max-width: 680px) 100vw, 680px\" \/><\/p>\n<p><span data-preserver-spaces=\"true\">Then upload the export file, and you are done.<\/span><\/p>\n<h2><strong><span data-preserver-spaces=\"true\">Conclusion<\/span><\/strong><\/h2>\n<p><span data-preserver-spaces=\"true\">Adding custom code to your WordPress website is an important step to enhance its functionality and achieve your desired goal. We&#8217;ve used an effective code snippet plugin, WPCode, to ease your process. The WPCode plugin provides a simple and efficient way to add custom code to your website. It allows you to customize your website as per your requirements without impacting your website&#8217;s presence on the internet.\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">Here we&#8217;ve discussed the process in the simplest manner to assist you in easily adding the code and managing code errors. By following these easy steps, you can easily add custom code to your WordPress website using the WPCode plugin. However, it&#8217;s important to ensure that the code you add is safe, error-free, and compatible with your WordPress version.\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">With WPCode, you can conveniently add and manage custom code on your WordPress website without worrying about any technical issues. Hope this guide has assisted you in adding custom code to your site using WPCode effortlessly.\u00a0<\/span><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Do you often require to add custom code to your website and are looking for an easy and secure way to add it? Here&#8217;s how you can easily add custom code in WordPress site without breaking it.\u00a0\u00a0 Adding custom code snippets in WordPress is often done by editing the theme&#8217;s function.php file or using a [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":2868,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2852","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wp-tutorials"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v19.3 (Yoast SEO v27.5) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Easy guide to adding custom code in WordPress - Hostkicker<\/title>\n<meta name=\"description\" content=\"Learn the simple way to add custom code in WordPress using WPCode. It can prevent your site from breaking &amp; help you easily add the code.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/hostkicker.com\/blog\/easy-guide-to-adding-custom-code-in-wordpress\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Easy guide to adding custom code in WordPress\" \/>\n<meta property=\"og:description\" content=\"Learn the simple way to add custom code in WordPress using WPCode. It can prevent your site from breaking &amp; help you easily add the code.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/hostkicker.com\/blog\/easy-guide-to-adding-custom-code-in-wordpress\/\" \/>\n<meta property=\"og:site_name\" content=\"Hostkicker\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-25T06:35:55+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-07-25T06:38:12+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2023\/07\/Easy-guide-to-adding-custom-code-in-wp.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"693\" \/>\n\t<meta property=\"og:image:height\" content=\"511\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Olivia Smith\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Olivia Smith\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/hostkicker.com\\\/blog\\\/easy-guide-to-adding-custom-code-in-wordpress\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/hostkicker.com\\\/blog\\\/easy-guide-to-adding-custom-code-in-wordpress\\\/\"},\"author\":{\"name\":\"Olivia Smith\",\"@id\":\"https:\\\/\\\/hostkicker.com\\\/blog\\\/#\\\/schema\\\/person\\\/f06306b595baa96c90a0491b941d7660\"},\"headline\":\"Easy guide to adding custom code in WordPress\",\"datePublished\":\"2023-07-25T06:35:55+00:00\",\"dateModified\":\"2023-07-25T06:38:12+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/hostkicker.com\\\/blog\\\/easy-guide-to-adding-custom-code-in-wordpress\\\/\"},\"wordCount\":1547,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/hostkicker.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/hostkicker.com\\\/blog\\\/easy-guide-to-adding-custom-code-in-wordpress\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/hostkicker.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/Easy-guide-to-adding-custom-code-in-wp.jpg\",\"articleSection\":[\"Wp tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/hostkicker.com\\\/blog\\\/easy-guide-to-adding-custom-code-in-wordpress\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/hostkicker.com\\\/blog\\\/easy-guide-to-adding-custom-code-in-wordpress\\\/\",\"url\":\"https:\\\/\\\/hostkicker.com\\\/blog\\\/easy-guide-to-adding-custom-code-in-wordpress\\\/\",\"name\":\"Easy guide to adding custom code in WordPress - Hostkicker\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/hostkicker.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/hostkicker.com\\\/blog\\\/easy-guide-to-adding-custom-code-in-wordpress\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/hostkicker.com\\\/blog\\\/easy-guide-to-adding-custom-code-in-wordpress\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/hostkicker.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/Easy-guide-to-adding-custom-code-in-wp.jpg\",\"datePublished\":\"2023-07-25T06:35:55+00:00\",\"dateModified\":\"2023-07-25T06:38:12+00:00\",\"description\":\"Learn the simple way to add custom code in WordPress using WPCode. It can prevent your site from breaking & help you easily add the code.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/hostkicker.com\\\/blog\\\/easy-guide-to-adding-custom-code-in-wordpress\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/hostkicker.com\\\/blog\\\/easy-guide-to-adding-custom-code-in-wordpress\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/hostkicker.com\\\/blog\\\/easy-guide-to-adding-custom-code-in-wordpress\\\/#primaryimage\",\"url\":\"https:\\\/\\\/hostkicker.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/Easy-guide-to-adding-custom-code-in-wp.jpg\",\"contentUrl\":\"https:\\\/\\\/hostkicker.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/Easy-guide-to-adding-custom-code-in-wp.jpg\",\"width\":693,\"height\":511,\"caption\":\"Learn the simple way to add custom code in WordPress using WPCode. It can prevent your site from breaking &amp; help you easily add the code.\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/hostkicker.com\\\/blog\\\/easy-guide-to-adding-custom-code-in-wordpress\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/hostkicker.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Easy guide to adding custom code in WordPress\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/hostkicker.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/hostkicker.com\\\/blog\\\/\",\"name\":\"Hostkicker\",\"description\":\"Blog\",\"publisher\":{\"@id\":\"https:\\\/\\\/hostkicker.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/hostkicker.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/hostkicker.com\\\/blog\\\/#organization\",\"name\":\"Hostkicker\",\"url\":\"https:\\\/\\\/hostkicker.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/hostkicker.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/hostkicker.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/12\\\/hostkicker-logo-01.png\",\"contentUrl\":\"https:\\\/\\\/hostkicker.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/12\\\/hostkicker-logo-01.png\",\"width\":940,\"height\":218,\"caption\":\"Hostkicker\"},\"image\":{\"@id\":\"https:\\\/\\\/hostkicker.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/hostkicker.com\\\/blog\\\/#\\\/schema\\\/person\\\/f06306b595baa96c90a0491b941d7660\",\"name\":\"Olivia Smith\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/24a6b2466362238ad275f97a2f2fc49ce8d139c034114d6b9c52de1b12ebf1bd?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/24a6b2466362238ad275f97a2f2fc49ce8d139c034114d6b9c52de1b12ebf1bd?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/24a6b2466362238ad275f97a2f2fc49ce8d139c034114d6b9c52de1b12ebf1bd?s=96&d=mm&r=g\",\"caption\":\"Olivia Smith\"},\"url\":\"https:\\\/\\\/hostkicker.com\\\/blog\\\/author\\\/olivia\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Easy guide to adding custom code in WordPress - Hostkicker","description":"Learn the simple way to add custom code in WordPress using WPCode. It can prevent your site from breaking & help you easily add the code.","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:\/\/hostkicker.com\/blog\/easy-guide-to-adding-custom-code-in-wordpress\/","og_locale":"en_US","og_type":"article","og_title":"Easy guide to adding custom code in WordPress","og_description":"Learn the simple way to add custom code in WordPress using WPCode. It can prevent your site from breaking & help you easily add the code.","og_url":"https:\/\/hostkicker.com\/blog\/easy-guide-to-adding-custom-code-in-wordpress\/","og_site_name":"Hostkicker","article_published_time":"2023-07-25T06:35:55+00:00","article_modified_time":"2023-07-25T06:38:12+00:00","og_image":[{"width":693,"height":511,"url":"https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2023\/07\/Easy-guide-to-adding-custom-code-in-wp.jpg","type":"image\/jpeg"}],"author":"Olivia Smith","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Olivia Smith","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/hostkicker.com\/blog\/easy-guide-to-adding-custom-code-in-wordpress\/#article","isPartOf":{"@id":"https:\/\/hostkicker.com\/blog\/easy-guide-to-adding-custom-code-in-wordpress\/"},"author":{"name":"Olivia Smith","@id":"https:\/\/hostkicker.com\/blog\/#\/schema\/person\/f06306b595baa96c90a0491b941d7660"},"headline":"Easy guide to adding custom code in WordPress","datePublished":"2023-07-25T06:35:55+00:00","dateModified":"2023-07-25T06:38:12+00:00","mainEntityOfPage":{"@id":"https:\/\/hostkicker.com\/blog\/easy-guide-to-adding-custom-code-in-wordpress\/"},"wordCount":1547,"commentCount":0,"publisher":{"@id":"https:\/\/hostkicker.com\/blog\/#organization"},"image":{"@id":"https:\/\/hostkicker.com\/blog\/easy-guide-to-adding-custom-code-in-wordpress\/#primaryimage"},"thumbnailUrl":"https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2023\/07\/Easy-guide-to-adding-custom-code-in-wp.jpg","articleSection":["Wp tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/hostkicker.com\/blog\/easy-guide-to-adding-custom-code-in-wordpress\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/hostkicker.com\/blog\/easy-guide-to-adding-custom-code-in-wordpress\/","url":"https:\/\/hostkicker.com\/blog\/easy-guide-to-adding-custom-code-in-wordpress\/","name":"Easy guide to adding custom code in WordPress - Hostkicker","isPartOf":{"@id":"https:\/\/hostkicker.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/hostkicker.com\/blog\/easy-guide-to-adding-custom-code-in-wordpress\/#primaryimage"},"image":{"@id":"https:\/\/hostkicker.com\/blog\/easy-guide-to-adding-custom-code-in-wordpress\/#primaryimage"},"thumbnailUrl":"https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2023\/07\/Easy-guide-to-adding-custom-code-in-wp.jpg","datePublished":"2023-07-25T06:35:55+00:00","dateModified":"2023-07-25T06:38:12+00:00","description":"Learn the simple way to add custom code in WordPress using WPCode. It can prevent your site from breaking & help you easily add the code.","breadcrumb":{"@id":"https:\/\/hostkicker.com\/blog\/easy-guide-to-adding-custom-code-in-wordpress\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/hostkicker.com\/blog\/easy-guide-to-adding-custom-code-in-wordpress\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/hostkicker.com\/blog\/easy-guide-to-adding-custom-code-in-wordpress\/#primaryimage","url":"https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2023\/07\/Easy-guide-to-adding-custom-code-in-wp.jpg","contentUrl":"https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2023\/07\/Easy-guide-to-adding-custom-code-in-wp.jpg","width":693,"height":511,"caption":"Learn the simple way to add custom code in WordPress using WPCode. It can prevent your site from breaking &amp; help you easily add the code."},{"@type":"BreadcrumbList","@id":"https:\/\/hostkicker.com\/blog\/easy-guide-to-adding-custom-code-in-wordpress\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/hostkicker.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Easy guide to adding custom code in WordPress"}]},{"@type":"WebSite","@id":"https:\/\/hostkicker.com\/blog\/#website","url":"https:\/\/hostkicker.com\/blog\/","name":"Hostkicker","description":"Blog","publisher":{"@id":"https:\/\/hostkicker.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/hostkicker.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/hostkicker.com\/blog\/#organization","name":"Hostkicker","url":"https:\/\/hostkicker.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/hostkicker.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2021\/12\/hostkicker-logo-01.png","contentUrl":"https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2021\/12\/hostkicker-logo-01.png","width":940,"height":218,"caption":"Hostkicker"},"image":{"@id":"https:\/\/hostkicker.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/hostkicker.com\/blog\/#\/schema\/person\/f06306b595baa96c90a0491b941d7660","name":"Olivia Smith","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/24a6b2466362238ad275f97a2f2fc49ce8d139c034114d6b9c52de1b12ebf1bd?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/24a6b2466362238ad275f97a2f2fc49ce8d139c034114d6b9c52de1b12ebf1bd?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/24a6b2466362238ad275f97a2f2fc49ce8d139c034114d6b9c52de1b12ebf1bd?s=96&d=mm&r=g","caption":"Olivia Smith"},"url":"https:\/\/hostkicker.com\/blog\/author\/olivia\/"}]}},"jetpack_featured_media_url":"https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2023\/07\/Easy-guide-to-adding-custom-code-in-wp.jpg","_links":{"self":[{"href":"https:\/\/hostkicker.com\/blog\/wp-json\/wp\/v2\/posts\/2852","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hostkicker.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hostkicker.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hostkicker.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/hostkicker.com\/blog\/wp-json\/wp\/v2\/comments?post=2852"}],"version-history":[{"count":4,"href":"https:\/\/hostkicker.com\/blog\/wp-json\/wp\/v2\/posts\/2852\/revisions"}],"predecessor-version":[{"id":2871,"href":"https:\/\/hostkicker.com\/blog\/wp-json\/wp\/v2\/posts\/2852\/revisions\/2871"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hostkicker.com\/blog\/wp-json\/wp\/v2\/media\/2868"}],"wp:attachment":[{"href":"https:\/\/hostkicker.com\/blog\/wp-json\/wp\/v2\/media?parent=2852"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hostkicker.com\/blog\/wp-json\/wp\/v2\/categories?post=2852"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hostkicker.com\/blog\/wp-json\/wp\/v2\/tags?post=2852"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}