Installing the script in WordPress

Video: How to install the Bytes Route script using WordPress

There are two ways for WordPress users to insert code in their websites or web applications.

  1. Using a plugin
  2. Manual installation

1. Using a plugin

The most convenient way for users to insert code into the WordPress header and footer is to use a plugin. The advantages of using a plugin over the manual installation are:

  • When you switch themes, your code snippets remain intact.
  • With the plugin, you can quickly and easily add code snippets to your webpage header or footer.
  • It’s easier to use because the plugin does not require any programming knowledge.

Step 1: Install and Activate Plugin: Header Footer Code Manager

Header Footer Code Manager is a free WordPress plugin that you can install and activate right from your dashboard by heading to Plugins → Add New, searching for it, clicking “Install Now” → “Activate”:

wp1 step 1 1
Plugin for adding code snippets

Step 2: Add the Bytes Route code snippet to the Header Footer Code Manager (HFCM)

Once you activate the plugin, you can access its interface by going to HFCM → Add New:

wp1 step 2 1
How to add the code snippet using the HFCM plugin

To add code to your site’s header, you need to paste it into one of the boxes under the Snippet / Code area:

  • Side Wide – adds the code snippet to the header of every single page on your site. This is what you’ll want to use most of the time.
  • Show on all Devices – adds the code snippet to desktop and mobile devices.

2. Manual installation

The javascript code can be added by going to Appearance → Theme Editor:

  1. Select the file “header.php” on the right side of the current view.
  2. For the header, insert the codes between the tags <head> and </head>.
  3. In case there are more HTML <script> tags, insert the Bytes Route code snippet as the last script. This will ensure that the Bytes Route script will load after all the information on the web application load.
  4. Finally, click the “Update File” button to save the changes to your website with the added code snippets.
wp2 step 1 1
Adding the javascript code in the head section of the website