How to Combine External JavaScript in WordPress (Best Plugins)

Simple Custom CSS and JS Add JS Code

WordPress is the most popular CMS in the world powering over 40% of websites on the Internet. To add extra functionality to a WordPress website combining external JavaScript codes is required. By default, WordPress does not save the JS codes, and if someone tries to add it through Theme’s function.php file there is always a chance of breaking the website. The best way to combine external JavaScript in WordPress is by using Plugins. Below are the three best plugins one can use to add External JS codes in WordPress.

Combine External JavaScript in WordPress

JavaScript is one of the most popular programming languages in the world. It is primarily a client-side language. What does it mean? It means one can add dynamic content by combining JavaScript codes and it will load up for visitors by not using any server resources. There might be occasions like you want to add a third-party tool like Google Analytics.

Use the plugins I have recommended, and you will easily be able to add JS codes to your WordPress website

1. Insert Headers and Footers by WPBeginner

The best plugin to add JavaScript in WordPress is Insert Headers and Footers. It is developed by WPBeginner, the famous WordPress blog. The best part of this plugin is it is completely free. Follow the below steps to add JavaScript codes to your website using this plugin.

Step 1: Log in to your WordPress Dashboard, hover over Plugins, and tap on Add New.

Add New Plugin 1

Step 2: Search for Insert Headers and Footers and tap on Install and then Activate. Alternatively, visit this link to download Insert Headers and Footers plugin and upload it on your site.

Insert Headers and Footers 1

Step 3: Once the plugin is activated hover over Settings, you will see an option Insert Headers and Footers, tap on it.

Insert Headers and Footers Plugin

Step 4: From the settings page you can enter Scripts in Header, Body, or Footer. Enter the code as you need, scroll down and save the changes.

Insert Headers and footers settings

2. Simple Custom CSS and JS

Next up in my recommendation list are Simple Custom CSS and JS. It is one the best plugin with over 300k active installs to adding External JS Codes in WordPress. Follow along with the steps I have provided to use it.

Step 1: Log in to WordPress Dashboard and head over to Plugins and then tap on Add New.

Add New Plugin

Step 2: On the Add New Plugins page search for Simple Custom CSS and JS. Tap on Install and once the plugin is installed tap on Activate.

Simple Custom CSS and JS

Step 3: As soon as the Plugin will be activated its shortcut will start appearing in the Sidebar, tap on + Custom CSS 7 & JS.

Simple Custom CSS and JS WordPress Dashboard

Step 4: On the next screen tap on Add JS Code.

Simple Custom CSS and JS Add JS Code

Step 5: Give a name to the Script and replace the text that says Add your JavaScript code here with the external script you want to add.

Simple Custom CSS and JS External JS

3. WP Coder

Last on my list is WP Coder, you can use it to add custom JavaScript on your website pages. It provides a shortcode for each JS Code you will add. Use the shortcode on the webpage you want the JS code to appear. Below are the steps you can follow to install and use WP Coder.

Step 1: Search for WP Coder in WordPress Plugin directory, tap on Install Now, and then Activate.

WP Coder

Step 2: Once the plugin has been installed an option named Wow Plugins will appear in the Sidebar. Hover over it and select WP Coder.

WP Coder WordPress Dashboard

Step 3: On the next screen tap on Add New.

WP Coder Add New

Step 4: To add a new JS Code first enter a name then Tap on JS Code, enter the code in the box and save it. A unique shortcode will be generated for each Code you will save. Now enter the given shortcode where you want the JavaScript code to appear.

WP Coder Add JS Code

Final Words

So, these are the three best plugins for combining External JavaScript in WordPress. I would recommend using Insert Headers and Footers as it is free and works well to add any JS code flawlessly. If you want to insert a lot of different JS Codes, then try Simple Custom CSS and JS. Lastly, to add JS codes on specific pages use WP Coder. Which plugin do you find useful? Do let us know in the comments.

Leave a Reply

Your email address will not be published. Required fields are marked *

Get a Quote

Give us a call or fill in the form below and we will contact you. We endeavor to answer all inquiries within 24 hours on business days.

    Open chat