{"id":1856,"date":"2024-12-26T12:46:18","date_gmt":"2024-12-26T11:46:18","guid":{"rendered":"https:\/\/wpmastertoolkit.com\/module\/inserer-le-code-head-body-et-footer\/"},"modified":"2025-01-08T12:31:06","modified_gmt":"2025-01-08T11:31:06","slug":"inserer-le-code-head-body-et-footer","status":"publish","type":"module","link":"https:\/\/wpmastertoolkit.com\/en\/module\/insert-head-body-and-footer-code\/","title":{"rendered":"Insert code &lt;head&gt;, &lt;body&gt; and &lt;footer&gt;"},"content":{"rendered":"<h1 class=\"wp-block-heading\">Insert code in <code data-no-auto-translation=\"\">&lt;head&gt;<\/code>, <code data-no-auto-translation=\"\">&lt;body&gt;<\/code> and <code data-no-auto-translation=\"\">&lt;footer&gt;<\/code> Introducing the WPMasterToolKit module<\/h1>\n\n\n\n<p>For any WordPress site owner, it may be necessary to add pieces of code in different sections of your pages, such as the <code data-no-auto-translation=\"\">&lt;head&gt;<\/code>just after the opening of the <code data-no-auto-translation=\"\">&lt;body&gt;<\/code>or before the <code data-no-auto-translation=\"\">&lt;footer&gt;<\/code>. Whether it's integrating Google Analytics, Tag Manager, Facebook pixels or other custom scripts, these tasks are often tedious and require several separate plugins. That's why we've developed the <strong>\"Insert <code data-no-auto-translation=\"\">&lt;head&gt;<\/code>, <code data-no-auto-translation=\"\">&lt;body&gt;<\/code> and <code data-no-auto-translation=\"\">&lt;footer&gt;<\/code> Code \"<\/strong> as part of WPMasterToolKit: a simple yet powerful tool for effortlessly inserting these codes.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Which plugins does the \"Insert <code data-no-auto-translation=\"\">&lt;head&gt;<\/code>, <code data-no-auto-translation=\"\">&lt;body&gt;<\/code> and <code data-no-auto-translation=\"\">&lt;footer&gt;<\/code> Code\" can replace ?<\/h2>\n\n\n\n<p>With this module, you can replace several specialized plugins such as :<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Insert Headers and Footers<\/strong><\/li>\n\n\n\n<li><strong>PixelYourSite<\/strong><\/li>\n\n\n\n<li><strong>Custom Code Inserter<\/strong><\/li>\n\n\n\n<li>...and many more.<\/li>\n<\/ul>\n\n\n\n<p>By combining these features in a single module, you can simplify your WordPress configuration, reduce the load on your site and minimize potential conflicts between plugins.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What the module lets you do<\/h2>\n\n\n\n<p>This module is designed to manage the following tasks:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Adding tags <code data-no-auto-translation=\"\">&lt;meta&gt;<\/code>, <code data-no-auto-translation=\"\">&lt;link&gt;<\/code>, <code data-no-auto-translation=\"\">&lt;script&gt;<\/code> or <code data-no-auto-translation=\"\">&lt;style&gt;<\/code> in the <code data-no-auto-translation=\"\">&lt;head&gt;<\/code> of your pages.<\/li>\n\n\n\n<li>Insert custom code immediately after tag opening <code data-no-auto-translation=\"\">&lt;body&gt;<\/code>.<\/li>\n\n\n\n<li>Add scripts or styles before closing the tag <code data-no-auto-translation=\"\">&lt;\/body&gt;<\/code>.<\/li>\n\n\n\n<li>Support common integrations such as :\n<ul class=\"wp-block-list\">\n<li>Google Analytics, Tag Manager, and Optimize.<\/li>\n\n\n\n<li>Ad tracking pixels for Facebook, TikTok and Twitter.<\/li>\n\n\n\n<li>AdSense or Google Ads conversion tracking scripts.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">How to use this module<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Activate module<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Activate the module in the WPMasterToolKit interface.<\/li>\n\n\n\n<li>Access the dedicated menu under <strong>\"WP MasterToolKit Settings<\/strong> in your WordPress dashboard.<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Add your codes<\/h3>\n\n\n\n<figure class=\"wp-block-image size-large\"><img alt=\"WP interface for inserting HTML\/CSS\/JS code.\" fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"893\" src=\"https:\/\/wpmastertoolkit.com\/wp-content\/uploads\/2024\/12\/image-105-1024x893.png\" class=\"wp-image-3756\" srcset=\"https:\/\/wpmastertoolkit.com\/wp-content\/uploads\/2024\/12\/image-105-1024x893.png 1024w, https:\/\/wpmastertoolkit.com\/wp-content\/uploads\/2024\/12\/image-105-300x262.png 300w, https:\/\/wpmastertoolkit.com\/wp-content\/uploads\/2024\/12\/image-105-768x670.png 768w, https:\/\/wpmastertoolkit.com\/wp-content\/uploads\/2024\/12\/image-105-1536x1340.png 1536w, https:\/\/wpmastertoolkit.com\/wp-content\/uploads\/2024\/12\/image-105.png 1687w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<ol class=\"wp-block-list\">\n<li>You will find three distinct sections in the module menu:\n<ul class=\"wp-block-list\">\n<li><strong>Front code <code data-no-auto-translation=\"\">&lt;\/head><\/code><\/strong> For <code data-no-auto-translation=\"\">&lt;meta&gt;<\/code>, <code data-no-auto-translation=\"\">&lt;link&gt;<\/code> or scripts to load into the header.<\/li>\n\n\n\n<li><strong>Code after <code data-no-auto-translation=\"\">&lt;body&gt;<\/code><\/strong> Ideal for tools like Google Tag Manager.<\/li>\n\n\n\n<li><strong>Front code <code data-no-auto-translation=\"\">&lt;\/body&gt;<\/code><\/strong> For follow-up scripts or features that require late loading.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>In each section, you can :\n<ul class=\"wp-block-list\">\n<li>Define a <strong>priority<\/strong> to adjust the code loading order.<\/li>\n\n\n\n<li>Insert code directly into a text zone (compatible with HTML, CSS or JavaScript).<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Click on <strong>Register<\/strong> to apply your changes.<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Practical example<\/h3>\n\n\n\n<p>To integrate a Facebook pixel at the beginning of the <code data-no-auto-translation=\"\">&lt;body&gt;<\/code> :<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Go to the <strong>Code after <code data-no-auto-translation=\"\">&lt;body&gt;<\/code><\/strong>.<\/li>\n\n\n\n<li>Paste the script provided by Facebook.<\/li>\n\n\n\n<li>Adjust priority if necessary.<\/li>\n\n\n\n<li>Save changes.<\/li>\n<\/ul>\n\n\n\n<p>The script will then be automatically added to all your pages!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The technical choices behind the module<\/h2>\n\n\n\n<p>We have designed this module with several key principles in mind:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Optimized performance<\/strong> The code is only loaded if you add specific content. If no insertion is configured, the module has no impact on performance.<\/li>\n\n\n\n<li><strong>Flexibility<\/strong> You can define priorities for each code to better control the order in which they are executed.<\/li>\n\n\n\n<li><strong>Security<\/strong> All user inputs are sanitized and validated to prevent malicious code injections.<\/li>\n\n\n\n<li><strong>Conviviality<\/strong> An intuitive interface, with enriched code editors (CodeMirror), makes configuration easy even for novice users.<\/li>\n<\/ul>\n\n\n\n<p>In addition, we use native WordPress actions such as <code data-no-auto-translation=\"\">wp_head<\/code>, <code data-no-auto-translation=\"\">wp_body_open<\/code> and <code data-no-auto-translation=\"\">wp_footer<\/code> to guarantee maximum compatibility with themes and other plugins.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>The module <strong>Insert <code data-no-auto-translation=\"\">&lt;head&gt;<\/code>, <code data-no-auto-translation=\"\">&lt;body&gt;<\/code> and <code data-no-auto-translation=\"\">&lt;footer&gt;<\/code> Code<\/strong> from WPMasterToolKit is a must-have for anyone wishing to manage their scripts and tracking codes centrally, simply and efficiently. Not only does it reduce the number of plugins required, it also ensures cleaner, optimized management of your custom tags.<\/p>\n\n\n\n<p>With this module, you have everything you need to customize and enhance your WordPress site, without having to touch the code of your theme files or install additional plugins. Try it today and discover a new way to manage your integrations!<\/p>","protected":false},"excerpt":{"rendered":"<p>The WPMasterToolKit plugin, via its \"Insert\" module <head>, <body> and <\/p>\n<footer> Code,\" allows WordPress administrators to easily add custom code such as scripts and meta tags in the <head>, <body> and <\/p>\n<footer> of their site, centralizing the management of these additions without the need for several separate plugins. This module simplifies the insertion of code for analysis tools or conversion tags, and provides precise control through script priority management, optimizing site performance.<\/p>","protected":false},"featured_media":0,"parent":0,"template":"","meta":{"_acf_changed":true,"_seopress_robots_primary_cat":"","_seopress_titles_title":"Optimisez votre site WordPress avec WPMasterToolKit","_seopress_titles_desc":"G\u00e9rez vos codes dans ,  et  facilement. Am\u00e9liorez la performance et \u00e9vitez les conflits avec WPMasterToolKit.","_seopress_robots_index":"","_surecart_dashboard_logo_width":"180px","_surecart_dashboard_show_logo":true,"_surecart_dashboard_navigation_orders":true,"_surecart_dashboard_navigation_invoices":true,"_surecart_dashboard_navigation_subscriptions":true,"_surecart_dashboard_navigation_downloads":true,"_surecart_dashboard_navigation_billing":true,"_surecart_dashboard_navigation_account":true},"class_list":["post-1856","module","type-module","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/wpmastertoolkit.com\/en\/wp-json\/wp\/v2\/module\/1856","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpmastertoolkit.com\/en\/wp-json\/wp\/v2\/module"}],"about":[{"href":"https:\/\/wpmastertoolkit.com\/en\/wp-json\/wp\/v2\/types\/module"}],"wp:attachment":[{"href":"https:\/\/wpmastertoolkit.com\/en\/wp-json\/wp\/v2\/media?parent=1856"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}