Make WordPress Core

Opened 8 years ago

Closed 8 years ago

#37289 closed defect (bug) (invalid)

Cannot redeclare class WP_Tax_Query

Reported by: michalzuber's profile michalzuber Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Upgrade/Install Keywords:
Focuses: Cc:


After auto upgrade I got
Cannot redeclare class WP_Tax_Query in example/wp-includes/class-wp-tax-query.php on line 22

I have $wp_version = '4.2.9';

$ grep -r 'class WP_Tax_Query' *
wp-includes/taxonomy.php:class WP_Tax_Query {
wp-includes/class-wp-tax-query.php:class WP_Tax_Query {

It's with an old install. Just visited the page, it was 4.2.7 and had some other issues

Attached patch fixed the issue.

Attachments (1)

patch.diff (21.5 KB) - added by michalzuber 8 years ago.

Download all attachments as: .zip

Change History (4)

8 years ago

#1 @swissspidy
8 years ago

  • Keywords reporter-feedback added

class-wp-tax-query.php was added in WordPress 4.4, see [33760]. I checked out the 4.2 branch and downloaded the partial update package offered on, none of which contained this file.

Are you sure you are running 4.2.x? Sounds rather like some corrupt files after doing an upgrade to 4.4 or 4.5.

#2 @michalzuber
8 years ago

  • Keywords reporter-feedback removed

Yes, looks like some corrupted files. It's an old blog (installed in 2009 :) that I visited and had some fatal error (Cannot redeclare class WP_Roles in /web/blog/wp-includes/class-wp-roles.php on line 26).
Fixed just to make WP run and it auto upgraded and then came the above mentioned error. Maybe it was 4.2.5 (had errors) then upgraded to 4.2.7 and then 4.2.9 :) Sorry, but really weird. As I mentioned an old blog with low traffic.

Yeap, running 4.2.9, check source at

What blow my mind were the files (wp-rss, wp-rss2) I saw after connecting to the FTP

The error log of my journey is at (the WP_Roles error was there from 26th June 2016, I don't have older logs)

#3 @dd32
8 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

It sounds like you've had a failed update attempt to 4.4 or later, and then it's continued the autoupdates on the 4.2.x branch. Half your files are probably 4.4/4.5 and half 4.2.

You'll need to update WordPress to the latest release (at this point in time, that's 4.5.3). You can either do that through the Updates section of the Dashboard or manually by FTP.

If you continue to experience these problems after updating, please feel free to re-open this ticket. I'm marking as invalid for now.

Note: See TracTickets for help on using tickets.