Title: Editing header.php?
Last modified: July 22, 2018

---

# Editing header.php?

 *  [Relja](https://wordpress.org/support/users/relja/)
 * (@relja)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/editing-header-php-2/)
 * I need to edit – precisely to insert some code into header.php file of my active
   theme.
 * Trying to do so from WordPress gives an error.
 * From what I gather, plugin “Subscribe to Comments Reloaded” is known to cause
   the problem. I know I could deactivate it.
 * However, it seems simpler to me to just download the header.php to my computer,
   edit it, then upload the edited version.
 * THE QUESTION:
    Is there any reason I shouldn’t do it this way? Could it cause
   some problems?

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

 *  [Armando Duran](https://wordpress.org/support/users/armandoduran/)
 * (@armandoduran)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/editing-header-php-2/#post-10515856)
 * I don’t think it is a problem to download, edit and then upload header.php.
 * But remember that it is best to make any modifications to the theme files by 
   creating a child theme and then copying files to be modified to the child theme
   folder.
 * You may be already doing this, but I just wanted to mention that.
 *  Thread Starter [Relja](https://wordpress.org/support/users/relja/)
 * (@relja)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/editing-header-php-2/#post-10515999)
 * Thanks for the reply.
 * As for the theme changes, I just don’t edit theme. Sticking to a theme that suits
   me (Catch Base) the way it is. This is the first time I’m editing anything. It’s
   for an ads serving purpose – I don’t think there will be any edits apart from
   that in the near future. Just copy/paste 10 lines of code that are required to
   be put “just before the </head> tag in the header.php”.
 * My plan was to:
    1) download the original header.php, and keep an original copy.
   2) make a copy for editing. 3) instert something like this: original content 
   goes to here // begining of my code editing – comment so I can edit it back easier
   required code by the app //end of my editing </head> (the original content continues
   here)
 * 4) upload the edited version to the server.
    -  This reply was modified 7 years, 10 months ago by [Relja](https://wordpress.org/support/users/relja/).
    -  This reply was modified 7 years, 10 months ago by [Relja](https://wordpress.org/support/users/relja/).
 *  [Vinit](https://wordpress.org/support/users/wp-vin/)
 * (@wp-vin)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/editing-header-php-2/#post-10516064)
 * what error WordPress gives to you?
    is it not letting you save the file? it could
   be file write permission error.
 *  [Armando Duran](https://wordpress.org/support/users/armandoduran/)
 * (@armandoduran)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/editing-header-php-2/#post-10516873)
 * “If you modify a theme directly and it is updated, then your modifications may
   be lost. By using a child theme you will ensure that your modifications are preserved.”
 * It’s worth taking a read at the [Child Themes](https://codex.wordpress.org/Child_Themes)
   documentation, where you will find other helpful resources listed at the bottom
   of that page, for example “[How To Make A Child Theme](https://wpsites.net/wordpress-themes/how-to-make-your-own-child-theme-for-wordpress-beginners-guide/)“.
 * If you don’t want to go through the process of creating a child theme yourself,
   here are two plugins that can do it for you:
    - [Child Theme Wizard](https://wordpress.org/plugins/child-theme-wizard/)
    - [Child Themify](https://wordpress.org/plugins/child-themify/)
 * I hope this helps!
 *  Thread Starter [Relja](https://wordpress.org/support/users/relja/)
 * (@relja)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/editing-header-php-2/#post-10516955)
 * [@vinit](https://wordpress.org/support/users/vinit/)
    The error has been discussed
   in WordPress help forum. From what I gathered, many have encountered the problem
   since the relatively recent WordPress updates.
 * Also, I had found a text explaining that “Subscribe to comments reloaded” plugin
   can also cause the problem.
 * WordPress editor takes long time trying to update, returning this:
 * “Unable to communicate back with site to check for fatal errors, so the PHP change
   was reverted. You will need to upload your PHP file change by some other means,
   such as by using SFTP.”
 * [@armando](https://wordpress.org/support/users/armando/) Duran
 * Thanks, I will take your advice and see about a Child Theme – sounds like a better,
   more sensible long term solution, even if it takes some more time right now.
 *  [Israel Barragan](https://wordpress.org/support/users/reedyseth/)
 * (@reedyseth)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/editing-header-php-2/#post-10517678)
 * Hi [@relja](https://wordpress.org/support/users/relja/), if you have a screenshot
   with the error with StCR I can help you to fix it, only if the problem is related
   to StCR. I haven’t seen an error editing the theme files in the WordPress backend.
 *  Thread Starter [Relja](https://wordpress.org/support/users/relja/)
 * (@relja)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/editing-header-php-2/#post-10517799)
 * [@reedyseth](https://wordpress.org/support/users/reedyseth/)
 * The error doesn’t mention StCR, just writes, below the update button:
    “Unable
   to communicate back with site to check for fatal errors, so the PHP change was
   reverted. You will need to upload your PHP file change by some other means, such
   as by using SFTP.”
 *  [Israel Barragan](https://wordpress.org/support/users/reedyseth/)
 * (@reedyseth)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/editing-header-php-2/#post-10520680)
 * So then how can you confirm the error is coming from StCR? As a Developer and
   Sysadmin you only trust what you can see on the logs and errors given by the 
   software, on this case is PHP, so enable the error display and debug settings
   and you will get a more detail error, if this is not the case then you will have
   to hire an expert on this matter to assist you finding the real error and then
   report it back to here.
 *  Thread Starter [Relja](https://wordpress.org/support/users/relja/)
 * (@relja)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/editing-header-php-2/#post-10520719)
 * Makes perfect sense. Not sure how to enable debuging, nor if it would be fine
   to do on a live site? :/

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

The topic ‘Editing header.php?’ is closed to new replies.

## Tags

 * [header edit](https://wordpress.org/support/topic-tag/header-edit/)
 * [header.php](https://wordpress.org/support/topic-tag/header-php/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 9 replies
 * 4 participants
 * Last reply from: [Relja](https://wordpress.org/support/users/relja/)
 * Last activity: [7 years, 10 months ago](https://wordpress.org/support/topic/editing-header-php-2/#post-10520719)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
