"No posts found" but count shows 5,995

Hey folks,

It’s not often I post a new thread here but I’m in need of any ideas with an issue I’ve got.

I discovered today, to my horror, that I can no longer see any posts in my admin despite the count showing the correct number.

This happens on all sites (it’s a v3.2.1 Multisite) with all post types (one of the sites uses MarketPress and the same happens with products).

The posts are in the database, visible on the frontend and editable so long as you can find your way to the edit post page.

I took the site offline, deactivate all plugins (both per-site and network), switched to Twenty Ten on all sites and de-activated mu-plugins (just domain mapping).

No dice.

Something else, which may be related, is that my network users shows 3 super admins in the count when there are only two.

I’ve checked the database and there are only two accounts (those two correctly listed) with a wp_user_level of 10. The next level down held by anyone is a 7. wp_capabilities also correctly indicates administrator for only those two accounts.

The whole network is now bare – there is nothing that isn’t out-of-the-box WordPress, it’s like a fresh install.

Any ideas?

*tears hair out onto keyboard*

  • Philip John
    • DEV MAN’s Apprentice

    Many hours and lots of suggestions later I’ve tried repairing all tables, dropping indexes, making sure collation was utf8_general_ci on all tables.

    Still nothing :slight_frown:

    With a little help from our Barry I found that the query run by WordPress is this:

    SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND (wp_posts.ID = '0') AND wp_posts.post_type = 'post' ORDER BY wp_posts.post_date DESC

    Running that in phpMyAdmin produces an empty result set but it works if I take out this bit:

    AND (wp_posts.ID = '0')

    So I just need to find out what’s adding that bit!

    Any suggestions?

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.