Title: Warning: Cannot modify header information &#8211; query.php
Last modified: August 19, 2016

---

# Warning: Cannot modify header information – query.php

 *  [barryofguilder](https://wordpress.org/support/users/barryofguilder/)
 * (@barryofguilder)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/warning-cannot-modify-header-information-queryphp/)
 * I started a brand new WordPress website today using 3.0.1. When I try to go to
   any of the pages (not posts) that I created, I get the following error:
 * >  Notice: Only variables should be assigned by reference in /home/content/b/
   > r/o/brookoflife/html/bol_wp/wp-includes/query.php on line 1508
   > Warning: Cannot modify header information – headers already sent by (output
   > started at /home/content/b/r/o/brookoflife/html/bol_wp/wp-includes/query.php:
   > 1508) in /home/content/b/r/o/brookoflife/html/bol_wp/wp-includes/pluggable.
   > php on line 890
 * It’s really weird, because it’s in one of the core files and I don’t mess with
   those. I went to line 1508 in the **query.php** file and noticed the following
   line:
 *     ```
       $this->queried_object =& get_page_by_path($qv['pagename']);
       ```
   
 * I removed the ampersand, saved the file, and I don’t get the error anymore. The
   pages display like normal.
 * Has anyone come across this? I’m kind of worried since I just modified a core
   WordPress file. I don’t want this to start screwing up later on. Any help would
   be appreciated.

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

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/warning-cannot-modify-header-information-queryphp/#post-1634391)
 * [Solving “headers already sent” warnings](http://codex.wordpress.org/FAQ_Troubleshooting#How_do_I_solve_the_Headers_already_sent_warning_problem.3F)
 *  Thread Starter [barryofguilder](https://wordpress.org/support/users/barryofguilder/)
 * (@barryofguilder)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/warning-cannot-modify-header-information-queryphp/#post-1634565)
 * Yes, I know about that, but this did not solve my problem.
 *  [Samuel B](https://wordpress.org/support/users/samboll/)
 * (@samboll)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/warning-cannot-modify-header-information-queryphp/#post-1634566)
 * put the code back
    deactivate your plugins and test re-activate one by one testing
   in between
 *  [dj3huti](https://wordpress.org/support/users/dj3huti/)
 * (@dj3huti)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/warning-cannot-modify-header-information-queryphp/#post-1634673)
 * With respect, Samuel B, that’s not helpful. This is caused by having the wordpress
   core failing strict error reporting for php 5.2 and up.
 * “only variables should be assigned by reference”
 * I’m assuming strict is usually turned off in WP, but it really should be coded
   to be compliant.
 *  [bobcouttie](https://wordpress.org/support/users/bobcouttie/)
 * (@bobcouttie)
 * [15 years ago](https://wordpress.org/support/topic/warning-cannot-modify-header-information-queryphp/#post-1634680)
 * I’m getting something similar but only with pages:
 * “Notice: Only variables should be assigned by reference in ****/wp-includes/query.
   php on line 1600”
 *  [stpitner](https://wordpress.org/support/users/stpitner/)
 * (@stpitner)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/warning-cannot-modify-header-information-queryphp/#post-1634684)
 * I’m in the same situation as bobcouttie – on just my pages I am receiving the
   warning in regards to this warning. I’m using WP 3.1.3.
 * Notice: Only variables should be assigned by reference in /<removed>/wp-includes/
   query.php on line 1600
 *  [stpitner](https://wordpress.org/support/users/stpitner/)
 * (@stpitner)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/warning-cannot-modify-header-information-queryphp/#post-1634685)
 * I found out that the site I was working on was still using PHP 4.4, something
   like that. I upgraded it to PHP 5.2, and the Warning goes away. Everyone is going
   to have to upgrade to PHP 5.2 in order to run 3.2, so this issue presumably will
   become moot really fast.

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

The topic ‘Warning: Cannot modify header information – query.php’ is closed to new
replies.

## Tags

 * [PHP Warning](https://wordpress.org/support/topic-tag/php-warning/)
 * [php-error](https://wordpress.org/support/topic-tag/php-error/)
 * [query.php](https://wordpress.org/support/topic-tag/query-php/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 7 replies
 * 6 participants
 * Last reply from: [stpitner](https://wordpress.org/support/users/stpitner/)
 * Last activity: [14 years, 11 months ago](https://wordpress.org/support/topic/warning-cannot-modify-header-information-queryphp/#post-1634685)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
