- Use the wp_footer or wp_head hooks to add the script inline.
- Use a plugin to add header or footer scripts.
- Modify your theme to include the script (bad idea)
- From the WP admin panel, click “Plugins” -> “Add new”.
- In the browser input box, type “Simple Custom CSS and JS”.
- Select the “Simple Custom CSS and JS” plugin and click “Install”.
- Activate the plugin.
How do I add HTML to my WordPress header?
Adding Code to Header and Footer in WordPress
Once the plugin is activated, go to Settings » Insert Headers and Footers from your admin panel. After that, you will see two boxes for adding code to header and footer. Simply paste the code in one of the two boxes.
When you want to find the head tag, you should go to your dashboard and then head over to 'Appearance'. After that, you should choose 'Editor'. Once the Editor opens, you will see a list of files, and you should click on the 'header.