There is a lot of necessities to add code in the header or footer. You might need to integrate with web services to your website and thus you have to add codes. That is not it even when you use different plugins you might need to add custom codes in your header or footer.
If you don’t know how to add code to the WordPress header and footer, then this post is for you. After reading this post you will be able to add code very easily.
Let’s see then.
How To Add Code In WordPress Header And Footer
You can add code in WordPress in two ways. Either you can add code using plugins or without using any plugins.
Add Code In WordPress Header & Footer Without Using Plugins
Plugins always slow you down a bit but save your precious time. If you have experience with coding, then it is wise to add code in the WordPress header & footer without using plugins.
At first, navigate to Appearance -> Theme Editor.
Now open header.php or footer.php by clicking on it.
Once the file is opened, you can add code in WordPress Header and footer as you like. You can write your code under the </body> tag.
Once you are done click on the Update file.
Add Code In WordPress Header & Footer Using Plugins
To add code in WordPress Header & Footer using a plugin, at first install and activate Insert Headers and Footers plugin.
Now navigate to Settings -> Insert Headers and Footers from your Admin dashboard. You will see three different boxes for adding code, header, body, and footer.
Simply put the code in the specific box where you want to add code. For example, if you want to add code in the header, then write your code in the header box. Don’t forget to click the save button once you are done.
Later on, the code will be automatically loaded.
I hope now you will be able to add code in WordPress headers and footers by yourself. If you face any problem feel free to share it here, I will be happy to help you. If you liked the post then please share it with your friends and don’t forget to share your thoughts in the comment box below.