Firstly let’s realize that inserting a code in header/footer of WordPress should be well thought as an illegitimate code may be a potential security risk.
But there are valid reason to insert legitimate code for the following reasons.
- Tracking/Analytical code
- Advertisement code
- Social media sharing buttons
- Other SEO code
When you want to edit in such scenario, you may need to edit the php files of your theme, directly. It is a high sensitive change. If you are not php aware, this is not an option for you.
Even if you know PHP, it is recommended to use a valid WP plugins. But there is another risk too. The plugin should be compatible with your WordPress version. As on when WordPress is updated, this plugin should be maintained and upgraded by the development team as well. So you need to choose a wise plugin.
Let’s see one of such plugin today – WPCode – Insert Headers and Footers + Custom Code Snippets – WordPress Code Manager (This is not a sponsored post). Login to your WordPress admin dashboard.
Plugin installation is completed. We shall see how to configure it to insert your preferred code.
That’s all. You don’t have to go through the pain of editing the theme files manually. The code will be injected by the plugin. If you wonder, how can you get a Real User Monitoring for your own website, you may sign up for a trial at apac.eginnovations.com (not a sponsored post).
Compatibility:
- WordPress 6.4.3
- eG Innovations 7.2
—
This post is written as part of #WriteAPageADay campaign of BlogChatter