Title: Header.php Update Error
Last modified: January 21, 2024

---

# Header.php Update Error

 *  [lukehowe1](https://wordpress.org/support/users/lukehowe1/)
 * (@lukehowe1)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/header-php-update-error/)
 * Team,
 * I’m having trouble updating my header.php file to work with some Google SEO tags.
   I’m getting the following error:
 * > Your PHP code changes were not applied due to an error on line 2349 of file
   > wp-includes/class-wpdb.php. Please fix and try saving again.Out of memory (
   > allocated 137363456) (tried to allocate 1069056 bytes)
 * I’ve tried a few remedies such as increasing the size of the memory defined in
   the wp-config.php file. Can someone help me get on track, please? This error 
   also occurs if I try to click the “update file” button without having made any
   changes as well.

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

 *  Moderator [James Huff](https://wordpress.org/support/users/macmanx/)
 * (@macmanx)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/header-php-update-error/#post-17360753)
 * Specifically, what exactly are you trying to change and how?
 *  Thread Starter [lukehowe1](https://wordpress.org/support/users/lukehowe1/)
 * (@lukehowe1)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/header-php-update-error/#post-17360762)
 * Thank you for taking interest. I’m trying to add a Google SEO tag to my header.
   php file by adding it via the header.php section of the theme file editor tab
   under “Appearance”.
    -  This reply was modified 2 years, 4 months ago by [lukehowe1](https://wordpress.org/support/users/lukehowe1/).
 *  Moderator [James Huff](https://wordpress.org/support/users/macmanx/)
 * (@macmanx)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/header-php-update-error/#post-17361051)
 * Ok, that should generally work just fine.
 * So, without further specifics, I recommend using a plugin instead, like [https://wordpress.org/plugins/wordpress-seo/](https://wordpress.org/plugins/wordpress-seo/)
   or [https://wordpress.org/plugins/google-site-kit/](https://wordpress.org/plugins/google-site-kit/)
 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/header-php-update-error/#post-17363554)
 * Is your SEO tag code making some sort of query in order to properly construct
   the tag? The error you posted is due to some query being so broad and far reaching
   that it sucked up all the memory available. The query needs to be better refined
   so that does not happen.
 * If you are not making any query, your code could contain an error which has a
   knock on effect on a query made somewhere else farther down the line. (unlikely
   but possible)
 * Or the out of memory error could be unrelated to your code, that your server’s
   memory utilization is challenged in general and trying to update the code just
   happened to be the random event that kicked it over. While increasing memory 
   in wp-config.php can often help, it will not help if the amount allocated exceeds
   what is physically allocated by your host. If this is the case, consult with 
   your host to see what options you have for getting more memory allocated.
 *  Thread Starter [lukehowe1](https://wordpress.org/support/users/lukehowe1/)
 * (@lukehowe1)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/header-php-update-error/#post-17364036)
 * Sir,
   I agree that it should work fine but it does not.I’m getting the following
   error:
 * > Your PHP code changes were not applied due to an error on line 2349 of file
   > wp-includes/class-wpdb.php. Please fix and try saving again.Out of memory (
   > allocated 137363456) (tried to allocate 1069056 bytes)
 *  Moderator [James Huff](https://wordpress.org/support/users/macmanx/)
 * (@macmanx)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/header-php-update-error/#post-17364039)
 * We’re aware, that’s the same error you shared earlier.
 * Without any more specifics, I can only recommend using a plugin instead, like
   those I recommended earlier: [https://wordpress.org/support/topic/header-php-update-error/#post-17361051](https://wordpress.org/support/topic/header-php-update-error/#post-17361051)
 * Answering bcworkz’s questions from earlier might help us give you a more effective
   solution: [https://wordpress.org/support/topic/header-php-update-error/#post-17363554](https://wordpress.org/support/topic/header-php-update-error/#post-17363554)
 *  Thread Starter [lukehowe1](https://wordpress.org/support/users/lukehowe1/)
 * (@lukehowe1)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/header-php-update-error/#post-17364041)
 * [@bcworkz](https://wordpress.org/support/users/bcworkz/):
   Thank you for that 
   info. We are hosting our site through Domain.com. I can engage with them but 
   I think the key issue here is that I get the error regardless of whether or not
   the SEO tag is applied. That is, after failing to add the tag, I tried to just“
   save” the default configs without adding the SEO tag as a troubleshooting step.
   I’ve found that this error doesn’t appear to be tied to the SEO tag since it 
   happens regardless of whether or not the tag is inserted.Could I insert and save
   the tag directly through an SSH session to avoid this error?
 *  Thread Starter [lukehowe1](https://wordpress.org/support/users/lukehowe1/)
 * (@lukehowe1)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/header-php-update-error/#post-17364043)
 * [@macmanx](https://wordpress.org/support/users/macmanx/):
   Sir,What specifics 
   can I provide to help the troubleshooting process? I’m not at the decision making
   level in my organization to edit workflow processes. I have pushed those plug-
   in suggestions up but not heard back.However, in the meantime, I’m curious as
   to why I get the exact same error trying to save the default header file?
    -  This reply was modified 2 years, 4 months ago by [lukehowe1](https://wordpress.org/support/users/lukehowe1/).
 *  Moderator [James Huff](https://wordpress.org/support/users/macmanx/)
 * (@macmanx)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/header-php-update-error/#post-17364133)
 * > What specifics can I provide to help the troubleshooting process?
 * What you provided at [https://wordpress.org/support/topic/header-php-update-error/#post-17364041](https://wordpress.org/support/topic/header-php-update-error/#post-17364041)
   was excellent information.
 * This problem may be a plugin or theme conflict. Please attempt to deactivate 
   all plugins and switch to the default Twenty Twenty-Three theme. If the problem
   goes away, re-activate them one by one to identify the source of the problem.
 * If you still get the memory error with all plugins deactivated and the Twenty
   Twenty-Three theme active, here are three ways to increase PHP’s memory allocation:
    1. If you can edit or override the system php.ini file, increase the memory limit.
       For example, `memory_limit = 512M`
    2. If you cannot edit or override the system php.ini file, add `php_value memory_limit
       512M` to your .htaccess file.
    3. If neither works, it’s time to temporarily ask your hosting provider to increase
       PHP’s memory allocation on your account. Keep in mind that most decent hosting
       providers temporarily allow users to increase the memory allocation. If your
       hosting provider won’t accommodate you, perhaps it’s time to find a new one.
       We have some recommendations at [https://wordpress.org/hosting/](https://wordpress.org/hosting/)
 * (in the above examples, the limit is set to 512MB)
 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/header-php-update-error/#post-17366609)
 * > Could I insert and save the tag directly through an SSH session to avoid this
   > error?
 * Sure! Or via FTP or your hosting file manager. While this may get you the tag
   you want, it doesn’t resolve the memory issue.
 * > I get the error regardless of whether or not the SEO tag is applied.
 *  This is because what you’re doing is a symptom, it’s not the cause. The cause
   is a combination of limited memory availability and something about your WP installation
   consuming a lot of memory, likely a theme or plugin as James had suggested.
 *  Thread Starter [lukehowe1](https://wordpress.org/support/users/lukehowe1/)
 * (@lukehowe1)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/header-php-update-error/#post-17366923)
 * [@all](https://wordpress.org/support/users/all/):
   Ah! Thank you! I believe the
   issue/resolution is beginning to take shape here! I was curious what could cause
   the memory issue since this would be the first “manual” change to any PHP that
   we’ve done. Are you saying that, for example, some other business unit enabled
   some plug-in or theme somewhere that could be causing this issue?If this is a
   correct understanding of the situation then, could you help me understand what
   the memory here is being used for? As in, I understand what trying to overtax
   my PC’s RAM would do but what are some side effects/consequences of over-utilization
   that I can look for going forward? For example, what are some risks/costs to 
   my supervisor if she were to say “just force the tag via SSH?”
 *  Moderator [James Huff](https://wordpress.org/support/users/macmanx/)
 * (@macmanx)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/header-php-update-error/#post-17366990)
 * > Are you saying that, for example, some other business unit enabled some plug-
   > in or theme somewhere that could be causing this issue?
 * All we can say for sure is that it’s not WordPress core hogging all the memory.
 * That leaves:
    1. A plugin is hogging all of the memory.
    2. The theme is hogging all of the memory.
    3. PHP has not been alloted enough memory to begin with.
    4. There is not enough memory available on the server to satisfy PHP’s allotment.
 * > could you help me understand what the memory here is being used for?
 * No, we have no more access to your site than any normal visitor, nor do we want
   any.
 * You’ll need to follow the steps as described: [https://wordpress.org/support/topic/header-php-update-error/#post-17364133](https://wordpress.org/support/topic/header-php-update-error/#post-17364133)
 * > what are some risks/costs to my supervisor if she were to say “just force the
   > tag via SSH?”
 * Your site should have more than enough memory available to make a simple file
   edit. While you could certainly edit the file elsewhere to avoid the issue, it
   doesn’t fix the problem, and down the line you’ll encounter something else that
   can’t get enough memory to function.
 * (also, please don’t at-mention “all”, that just notifies [this user](https://wordpress.org/support/users/all/))

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

The topic ‘Header.php Update Error’ is closed to new replies.

## Tags

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

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 12 replies
 * 3 participants
 * Last reply from: [James Huff](https://wordpress.org/support/users/macmanx/)
 * Last activity: [2 years, 4 months ago](https://wordpress.org/support/topic/header-php-update-error/#post-17366990)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
