Insert code in your WordPress website header or footer

Definitions

Inserting code in your WordPress website header or footer means adding custom scripts or HTML to the top or bottom sections of your site, often for tracking, customization, or third-party services.

Before you start

✅ You can use a free plugin to insert code in the header or footer of your WordPress website.

⚠️ When it comes to code management, it can be helpful to consult with a website developer.

Step by step

1. Log in to your WordPress admin dashboard

2. Hover over Plugins and click Add New Plugin

3. Search for the Insert Headers and Footers plugin

4. Click on the Install Now button

5. Once installed, click on the Activate button

6. From the WordPress menu, click on Settings

7. From the dropdown, click on WP Headers and Footers

8. You’ll be taken to the plugin’s settings page where you’ll see two text boxes: one for the header and one for the footer. They’ll be called Scripts in Header and Scripts in Footer.

9. To insert code in the header, copy the code you want to add and paste it into the Scripts in Header text box

10. To insert code in the footer, copy the code you want to add and paste it into the Scripts in Footer text box

11. Once you’ve pasted your code snippet(s), scroll down to the bottom of the page and click on the Save Changes button to apply your changes