How To Modify WordPress Header & Footer

If you want to modify your WordPress header and footer PHP file ( for example add google analytics or google Adsense javascript code in the website header ), you can read this article. It will tell you how to do it both by edit theme header.php / footer.php or use Insert Headers and Footers WordPress plugin.

1. Edit WordPress Theme header.php and footer.php File.

  1. Login to your WordPress admin website.
  2. Click Appearance —> Theme Editor menu item.
  3. Then select the theme from the dropdown list to edit, do not forget to click the Select button.
  4. Then click the header.php theme file in the right theme files list.
  5. Then add the javascript code in header.php file html <head> section.
  6. If you want to edit the WordPress footer then click the footer.php file and edit it.

2. Edit WordPress Header & Footer Use Insert Headers and Footers Plugin.

  1. Click Plugins —> Add New menu item to go to Add Plugins page, then search keyword Insert Headers and Footers in the search box and install it.
  2. Then click Settings —> Insert Headers and Footers menu item in the left navigation panel, and then you can insert header or footer javascript code in the related area text box on the page right side.

Subscribe to receive more programming tricks.

We don’t spam!

Subscribe to receive more programming tricks.

We don’t spam!

1 thought on “How To Modify WordPress Header & Footer”

Leave a Comment

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.