- Leveraging the Head & Footer Code plugin (suitable for users with little or no technical background)
- Adding the code to the functions.php file
Fix #1: Use a Plugin like Head & Footer Code
The free plugin allows you to insert code seamlessly in several ways. It offers utility with various applications including Facebook Pixel, Google Analytics, custom CSS, and more.
- From the admin dashboard, navigate to the Plugins tab, and click on the Add New option. Then, search for “Head & Footer Code” and click on Install Now.
- After installing the plugin and activating buttons, go to the plugin’s settings by going to the Tools section and selecting Head & Footer Code. You will find three sections here- header, footer, and body.
As you see, this method is extremely beginner-friendly and does the trick in three simple steps. Additionally, it also allows you to add other types of code and custom CSS effectively. However, you will be installing a third-party plugin that might not be suitable for you if you’re trying to keep your extensions to a minimum.
Fix #2: Add the code to your functions.php file
This method involves using the built-in functions and editing the functions.php file. In other words, you will be manually uploading the scripts to your server.
It is advisable to create a child theme before going through with this method. This ensures that you’re able to update the parent theme safely. In addition, you are also advised to take a backup of your site in case something goes wrong.
- Find and launch the functions.php file and paste the following code snippet in it:
- Check out our recommendations for the best wordpress web hosting.