Using WordPress: Add Script to Header
Video Explaining the Best WordPress Plugin to Add Scripts
Written Guide of Using a WordPress plugin to Add Header Script
- Go to “Plugins > Add New” once you are logged into your WordPress dashboard. (You must be able to install plugins for this to work.)
- Search for the “Insert Headers and Footers” plugin from the folks over at WPBeginner. Install and activate that plugin.
- Now we’ll use the plugin to add a script to our WordPress head. We’ll need to go to “Settings > Insert Headers and Footers” in the left sidebar once the plugin is running.
- Depending on whether your script needs to be added to your page headers or footers, you’ll paste it into the appropriate box. Then press “Save.”
With those step, your done. You’re all set to get your WordPress header scripts running on the pages your visitors see. Hopefully that wasn’t too hard.
Further Reading on WordPress Header and Footer Script Injection
wp_enqueue_script in WordPress PHP. We’ve got a great Quick Guide all about that: