Title: Unable to add code in header.php
Last modified: April 6, 2020

---

# Unable to add code in header.php

 *  Resolved [atulameta](https://wordpress.org/support/users/atulameta/)
 * (@atulameta)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/unable-to-add-code-in-header-php/)
 * I am unable to add meta tags and google adsense code to head section of header.
   php. I tried to add it in both travel log and twenty twenty themes. But, It says-“
   Something went wrong. Your change may not have been saved. Please try again. 
   There is also a chance that you may need to manually fix and upload the file 
   over [http://FTP.&#8221](http://FTP.&#8221);
    I do not have technical knowledge
   to add it via FTP, anyone please help. Thanks
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Funable-to-add-code-in-header-php%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/unable-to-add-code-in-header-php/#post-12636621)
 * Try switching to a different theme, then try saving your edits to your normal
   theme when it’s inactive. After saving you can switch back again.
 * If you still have trouble, there are some server configurations that simply do
   not allow the theme editor to work. Instead of FTP, you might be able to use 
   your hosting account’s file manager to edit files. It works similar to your computer’s
   file manager.
 * You shouldn’t be editing distributed theme files. When they are updated your 
   changes are lost. To protect your changes, you should create a [child theme](https://developer.wordpress.org/themes/advanced-topics/child-themes/).
 * I realize creating a child theme could be beyond what you feel your abilities
   are. It may be worth giving it a try to save you from having to re-edit the template
   after updates. We’re here to help if you run into trouble.
 * You might try finding a plugin that allows you to add head section content through
   a more friendly interface.
 *  Thread Starter [atulameta](https://wordpress.org/support/users/atulameta/)
 * (@atulameta)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/unable-to-add-code-in-header-php/#post-12641830)
 * I have added code using a plugin, meta tags inserter. It’s working and it was
   easy to add codes in this.
    thanks a lot, [@bcworkz](https://wordpress.org/support/users/bcworkz/).

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

The topic ‘Unable to add code in header.php’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [atulameta](https://wordpress.org/support/users/atulameta/)
 * Last activity: [6 years, 2 months ago](https://wordpress.org/support/topic/unable-to-add-code-in-header-php/#post-12641830)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
