By default, we recommend installing Matomo on your WordPress site using a plugin (see these steps). However, if you cannot or choose not to use plugins, follow these steps to manually enter the Matomo tracking code into your WordPress site:

  • Log in to your WordPress dashboard.
  • Go to the Appearance menu and click on Editor.
  • From the list of files on the right-hand side, click on the header.php file.
  • Locate the closing head tag </head> in the code.
  • Copy the Matomo tracking code provided in your Matomo account (learn more).
  • Go back to your WordPress editor and paste the tracking code just above the </head> tag in the header.php file.
  • Click “Update File” to save the changes.

That’s it! Your WordPress site is now set up to track visitor data with Matomo.

Previous FAQ: How do I install the Matomo tracking code on WordPress?