Title: Adding Code to
Last modified: March 8, 2023

---

# Adding Code to

 *  Resolved [mitchbartlett](https://wordpress.org/support/users/mitchbartlett/)
 * (@mitchbartlett)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/adding-code-to/)
 * How do you add code like Google Analytics to the <head> tag?

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [thelmachido a11n](https://wordpress.org/support/users/thelmachido/)
 * (@thelmachido)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/adding-code-to/#post-16543113)
 * > How do you add code like Google Analytics to the <head> tag?
 * Hi [@mitchbartlett](https://wordpress.org/support/users/mitchbartlett/) you can
   create a child-theme for your site using a plugin called [Create Block Theme](https://wordpress.org/plugins/create-block-theme/).
 * Activate the plugin, head over to `Appearance > Create Block Theme > Create Child
   Theme of ***`
 * Once that is done you will be able to see the theme files to add the code, however,
   you might need to use a plugin like [Header and Footers plugin](https://wordpress.org/plugins/insert-headers-and-footers/)
   to add code to your site’s header.
 *  Thread Starter [mitchbartlett](https://wordpress.org/support/users/mitchbartlett/)
 * (@mitchbartlett)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/adding-code-to/#post-16646045)
 * Thanks!
 *  Moderator [Kathryn Presner](https://wordpress.org/support/users/zoonini/)
 * (@zoonini)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/adding-code-to/#post-16646072)
 * [@mitchbartlett](https://wordpress.org/support/users/mitchbartlett/) Instead 
   of creating a child theme, you could consider just using [a Google Analytics plugin like one of these](https://wordpress.org/plugins/search/google+analytics/).
   These have the added benefit of not needing to re-add your GA code if you switch
   themes, and is a simpler route than a child theme, if all you need is to add 
   GA code.
 * I’ll mark this thread as resolved but feel free to start a new one if you have
   other questions.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Adding Code to’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/twentytwentythree/1.6/screenshot.
   png)
 * Twenty Twenty-Three
 * [Support Threads](https://wordpress.org/support/theme/twentytwentythree/)
 * [Active Topics](https://wordpress.org/support/theme/twentytwentythree/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/twentytwentythree/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/twentytwentythree/reviews/)

 * 3 replies
 * 3 participants
 * Last reply from: [Kathryn Presner](https://wordpress.org/support/users/zoonini/)
 * Last activity: [3 years, 3 months ago](https://wordpress.org/support/topic/adding-code-to/#post-16646072)
 * Status: resolved