How do I add a script to a head tag in WordPress?

How do I add code to head tag in WordPress?

Option 2: Add directly to the header.php file

  1. Go to “Appearance”, then “Editor”, then “header. php”.
  2. Search for .
  3. Paste the tracking code before the closing tag.
  4. Save the code by clicking “Update File”.

How do I add a script to the body tag in WordPress?

Inserting scripts before the closing

IT IS IMPORTANT:  How do I not use blocks in WordPress?