Insert code in
, <body>
and
Introducing the WPMasterToolKit module
For any WordPress site owner, it may be necessary to add pieces of code in different sections of your pages, such as the just after the opening of the
<body>
or before the . 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 "Insert
,
<body>
and Code " as part of WPMasterToolKit: a simple yet powerful tool for effortlessly inserting these codes.
Which plugins does the "Insert
, <body>
and
Code" can replace ?
With this module, you can replace several specialized plugins such as :
- Insert Headers and Footers
- PixelYourSite
- Custom Code Inserter
- ...and many more.
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.
What the module lets you do
This module is designed to manage the following tasks:
- Adding tags
,
,
or
in the
of your pages.
- Insert custom code immediately after tag opening
<body>
. - Add scripts or styles before closing the tag
</body>
. - Support common integrations such as :
- Google Analytics, Tag Manager, and Optimize.
- Ad tracking pixels for Facebook, TikTok and Twitter.
- AdSense or Google Ads conversion tracking scripts.
How to use this module
Activate module
- Activate the module in the WPMasterToolKit interface.
- Access the dedicated menu under "WP MasterToolKit Settings in your WordPress dashboard.
Add your codes
- You will find three distinct sections in the module menu:
- Front code
For
,
or scripts to load into the header.
- Code after
<body>
Ideal for tools like Google Tag Manager. - Front code
</body>
For follow-up scripts or features that require late loading.
- Front code
- In each section, you can :
- Define a priority to adjust the code loading order.
- Insert code directly into a text zone (compatible with HTML, CSS or JavaScript).
- Click on Register to apply your changes.
Practical example
To integrate a Facebook pixel at the beginning of the <body>
:
- Go to the Code after
<body>
. - Paste the script provided by Facebook.
- Adjust priority if necessary.
- Save changes.
The script will then be automatically added to all your pages!
The technical choices behind the module
We have designed this module with several key principles in mind:
- Optimized performance The code is only loaded if you add specific content. If no insertion is configured, the module has no impact on performance.
- Flexibility You can define priorities for each code to better control the order in which they are executed.
- Security All user inputs are sanitized and validated to prevent malicious code injections.
- Conviviality An intuitive interface, with enriched code editors (CodeMirror), makes configuration easy even for novice users.
In addition, we use native WordPress actions such as wp_head
, wp_body_open
and wp_footer
to guarantee maximum compatibility with themes and other plugins.
Conclusion
The module Insert ,
<body>
and Code 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.
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!