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 click the Select button.
    select wordpress stargazer theme template
  4. Then click the header.php theme file in right theme files list.
    add google adsense auto-ads javascript in header.php file
  5. Then add the javascript code in header.php file html <head> section.
  6. If you want to edit WordPress footer then click 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 left navigation panel, and then you can insert header or footer javascript code in related area text box.
    wordpress plugin insert headers and footers configuration
READ :   How To Add Google Adsense Ads In Your Wordpress Themes

1 Comment


  1. Hello! Good manual I would like to change my header and footer, but from a template we can also change the code in PHP?

    I work with this editor: https://themesgenerator.com/ , and I do not know if in WordPress I can do this.

    Thanks for the info.

    Reply

Leave a Reply

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.